[libvirt] [PATCH v2 2/5] qemu: Use correct domain xml flag

Eric Blake posted 5 patches 6 years, 11 months ago
[libvirt] [PATCH v2 2/5] qemu: Use correct domain xml flag
Posted by Eric Blake 6 years, 11 months ago
Although VIR_DOMAIN_DEF_FORMAT_INACTIVE and VIR_DOMAIN_XML_INACTIVE
happen to have the same value (1<<1), they come from different enums;
and it is nicer to reason about a 'flags' variable if all uses of
that variable are compared against the same enum type.  Messed up in
commit 06f75ff2 (3.8.0).

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b039675d1a..2458343a86 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7360,7 +7360,7 @@ static char
      * ignore the VIR_DOMAIN_XML_UPDATE_CPU flag.
      */
     if (virDomainObjIsActive(vm) &&
-        !(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE))
+        !(flags & VIR_DOMAIN_XML_INACTIVE))
         flags &= ~VIR_DOMAIN_XML_UPDATE_CPU;

     ret = qemuDomainFormatXML(driver, vm, flags);
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 2/5] qemu: Use correct domain xml flag
Posted by John Ferlan 6 years, 11 months ago

On 2/14/19 4:29 PM, Eric Blake wrote:
> Although VIR_DOMAIN_DEF_FORMAT_INACTIVE and VIR_DOMAIN_XML_INACTIVE
> happen to have the same value (1<<1), they come from different enums;
> and it is nicer to reason about a 'flags' variable if all uses of
> that variable are compared against the same enum type.  Messed up in
> commit 06f75ff2 (3.8.0).
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>  src/qemu/qemu_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list