diff mbox

[Xen-devel,libvirt,bisection] complete build-amd64-libvirt

Message ID 1405086227.27875.8.camel@kazak.uk.xensource.com
State New
Headers show

Commit Message

Ian Campbell July 11, 2014, 1:43 p.m. UTC
On Fri, 2014-07-11 at 09:23 +0200, Olaf Hering wrote:
> On Fri, Jul 11, xen.org wrote:
> 
> >   commit 4e7e5e9f7b29ef1c6924116e045a9b2c4bd3ea1a
> >   Author: Olaf Hering <olaf@aepfle.de>
> >   Date:   Mon Jul 7 17:05:17 2014 +0200
> >   
> >       libxl: add discard support to libxl_device_disk
> 
> This used to work for me. What has changed?
> 
> libxl/libxl_conf.c: In function 'libxlDiskSetDiscard':
> libxl/libxl_conf.c:724:19: error: conversion to incomplete type
> make[3]: *** [libxl/libvirt_driver_libxl_impl_la-libxl_conf.lo] Error 1
> 
>  718 static int
>  719 libxlDiskSetDiscard(libxl_device_disk *x_disk, int discard)
>  720 {
>  721     if (!x_disk->readwrite)
>  722         return 0;
>  723 #if defined(LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE)
>  724     switch ((enum virDomainDiskDiscard)discard) {

The enum is declared as 
typedef enum {
        ....
} virDomainDiskDiscard;

So using the enum tag in the cast is wrong.

commit 5a2bd4c9171d65a7d2ce836bff5047bccddf10f0
Author: Julio Faracco <jcfaracco@gmail.com>
Date:   Sat May 31 21:22:30 2014 -0300

    conf: more enum cleanups in "src/conf/domain_conf.h"
    
looks to have converted everything like this.

-----8<-------------------

From 2702cbbffd40384571b39bb6da21d76fc7b8ccd6 Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@citrix.com>
Date: Fri, 11 Jul 2014 14:38:30 +0100
Subject: [PATCH] libxl: Correct cast to virDomainDiskDiscard enum.

This was converted to a typedef in 5a2bd4c9171d "conf: more enum
cleanups in "src/conf/domain_conf.h"" causing:
    libxl/libxl_conf.c: In function 'libxlDiskSetDiscard':
    libxl/libxl_conf.c:724:19: error: conversion to incomplete type

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 src/libxl/libxl_conf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Olaf Hering July 11, 2014, 1:48 p.m. UTC | #1
On Fri, Jul 11, Ian Campbell wrote:

> The enum is declared as 
> typedef enum {
>         ....
> } virDomainDiskDiscard;
> 
> So using the enum tag in the cast is wrong.

Thanks Ian, looks like overlapping changes. I did not compile test
my libvirt change against master.


Olaf
Jim Fehlig July 11, 2014, 3:06 p.m. UTC | #2
Ian Campbell wrote:
> From 2702cbbffd40384571b39bb6da21d76fc7b8ccd6 Mon Sep 17 00:00:00 2001
> From: Ian Campbell <ian.campbell@citrix.com>
> Date: Fri, 11 Jul 2014 14:38:30 +0100
> Subject: [PATCH] libxl: Correct cast to virDomainDiskDiscard enum.
>
> This was converted to a typedef in 5a2bd4c9171d "conf: more enum
> cleanups in "src/conf/domain_conf.h"" causing:
>     libxl/libxl_conf.c: In function 'libxlDiskSetDiscard':
>     libxl/libxl_conf.c:724:19: error: conversion to incomplete type
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  src/libxl/libxl_conf.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index 0b4a0b5..f620d47 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -721,7 +721,7 @@ libxlDiskSetDiscard(libxl_device_disk *x_disk, int discard)
>      if (!x_disk->readwrite)
>          return 0;
>  #if defined(LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE)
> -    switch ((enum virDomainDiskDiscard)discard) {
> +    switch ((virDomainDiskDiscard)discard) {
>      case VIR_DOMAIN_DISK_DISCARD_DEFAULT:
>      case VIR_DOMAIN_DISK_DISCARD_LAST:
>          break;
>   

Thanks for the fix.  I've pushed the patch.

Regards,
Jim
diff mbox

Patch

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 0b4a0b5..f620d47 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -721,7 +721,7 @@  libxlDiskSetDiscard(libxl_device_disk *x_disk, int discard)
     if (!x_disk->readwrite)
         return 0;
 #if defined(LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE)
-    switch ((enum virDomainDiskDiscard)discard) {
+    switch ((virDomainDiskDiscard)discard) {
     case VIR_DOMAIN_DISK_DISCARD_DEFAULT:
     case VIR_DOMAIN_DISK_DISCARD_LAST:
         break;