diff mbox series

hyperv: Fix 32bit compilation

Message ID e074a89f4d66b4e53cc6fbceb630296aacc31bb3.1614624836.git.crobinso@redhat.com
State New
Headers show
Series hyperv: Fix 32bit compilation | expand

Commit Message

Cole Robinson March 1, 2021, 6:54 p.m. UTC
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>

---
Pushed

 src/hyperv/hyperv_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.29.2

Comments

Matt Coleman March 2, 2021, 3:34 a.m. UTC | #1
> On Mar 1, 2021, at 1:54 PM, Cole Robinson <crobinso@redhat.com> wrote:

> 

> 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>

> ---

> Pushed

> 

> src/hyperv/hyperv_driver.c | 4 ++--

> 1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c

> index 701456cdb3..e4f537bd12 100644

> --- a/src/hyperv/hyperv_driver.c

> +++ b/src/hyperv/hyperv_driver.c

> @@ -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;

>         }

>     }

> -- 

> 2.29.2

> 


Reviewed-by: Matt Coleman <matt@datto.com>


-- 
Matt
diff mbox series

Patch

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 701456cdb3..e4f537bd12 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -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;
         }
     }