[libvirt] [PATCH] qemu: process: Use enum belonging to correct type

Peter Krempa posted 1 patch 5 years, 2 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/b70fb35d81f625ec4e14392de0d2711e8659cd53.1547797411.git.pkrempa@redhat.com
src/qemu/qemu_process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] qemu: process: Use enum belonging to correct type
Posted by Peter Krempa 5 years, 2 months ago
GCC was unhappy about comparison between two distinct enum types. Use
the correct value instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---

Pushed as a build fix.

 src/qemu/qemu_process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index afa960a683..855bd9cb14 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7835,7 +7835,7 @@ qemuProcessRefreshLegacyBlockjob(void *payload,
         return 0;
     }

-    if (jobtype == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT &&
+    if (jobtype == QEMU_BLOCKJOB_TYPE_COMMIT &&
         disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT)
         jobtype = disk->mirrorJob;

-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: process: Use enum belonging to correct type
Posted by Daniel P. Berrangé 5 years, 2 months ago
On Fri, Jan 18, 2019 at 08:44:02AM +0100, Peter Krempa wrote:
> GCC was unhappy about comparison between two distinct enum types. Use
> the correct value instead.

It is nice to see that GCC is actually intelligent enough to catch
this kind of mistake these days !

> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
> 
> Pushed as a build fix.
> 
>  src/qemu/qemu_process.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index afa960a683..855bd9cb14 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -7835,7 +7835,7 @@ qemuProcessRefreshLegacyBlockjob(void *payload,
>          return 0;
>      }
> 
> -    if (jobtype == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT &&
> +    if (jobtype == QEMU_BLOCKJOB_TYPE_COMMIT &&
>          disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT)
>          jobtype = disk->mirrorJob;
> 
> -- 
> 2.20.1
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: process: Use enum belonging to correct type
Posted by Peter Krempa 5 years, 2 months ago
On Fri, Jan 18, 2019 at 09:57:19 +0000, Daniel Berrange wrote:
> On Fri, Jan 18, 2019 at 08:44:02AM +0100, Peter Krempa wrote:
> > GCC was unhappy about comparison between two distinct enum types. Use
> > the correct value instead.
> 
> It is nice to see that GCC is actually intelligent enough to catch
> this kind of mistake these days !

Yes, I'm surprised as well. It's actually ironic since I started using
clang just for this series as it was also finding some problems noted by
Jano. Now I've configured vpath for both compilers, just to be sure.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list