]> xenbits.xensource.com Git - libvirt.git/commitdiff
hyperv: Fix 32bit compilation
authorCole Robinson <crobinso@redhat.com>
Mon, 1 Mar 2021 18:15:37 +0000 (13:15 -0500)
committerCole Robinson <crobinso@redhat.com>
Mon, 1 Mar 2021 18:46:20 +0000 (13:46 -0500)
Example:
../src/hyperv/hyperv_driver.c:3007:54: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
 3007 |             virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not attach serial port %lu"), i);

Signed-off-by: Cole Robinson <crobinso@redhat.com>
src/hyperv/hyperv_driver.c

index 701456cdb30e60398d262c0b49ce3dbcc882c2cc..e4f537bd12eee20d489f1c39d4fe5fe56cf4528a 100644 (file)
@@ -3004,7 +3004,7 @@ hypervDomainDefineXML(virConnectPtr conn, const char *xml)
     /* Attach serials */
     for (i = 0; i < def->nserials; i++) {
         if (hypervDomainAttachSerial(domain, def->serials[i]) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not attach serial port %lu"), i);
+            virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not attach serial port %zu"), i);
             goto error;
         }
     }
@@ -3012,7 +3012,7 @@ hypervDomainDefineXML(virConnectPtr conn, const char *xml)
     /* Attach networks */
     for (i = 0; i < def->nnets; i++) {
         if (hypervDomainAttachSyntheticEthernetAdapter(domain, def->nets[i], hostname) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not attach network %lu"), i);
+            virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not attach network %zu"), i);
             goto error;
         }
     }