Re: [PATCH 6/6] bhyve: Ignore no-op flags during virDomainUndefine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/8/19 10:37 PM, Eric Blake wrote:
> We can ignore flags rather than rejecting them as unknown since a
> correct implementation of those flags is a no-op given that bhyve
> lacks managed save or snapshots.
> 
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
> ---
>  src/bhyve/bhyve_driver.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
> index ffda7853b8..c2378c536f 100644
> --- a/src/bhyve/bhyve_driver.c
> +++ b/src/bhyve/bhyve_driver.c
> @@ -584,7 +584,10 @@ bhyveDomainUndefineFlags(virDomainPtr domain, unsigned int flags)
>      virDomainObjPtr vm;
>      int ret = -1;
> 
> -    virCheckFlags(0, -1);
> +    /* We have no managed save or snapshots, so we can ignore those flags */
> +    virCheckFlags(VIR_DOMAIN_UNDEFINE_MANAGED_SAVE |
> +                  VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA, NULL);

Returning NULL is wrong; this should be -1. What's more, this disagrees
with esx, which does:

    /* No managed save, so we explicitly reject
     * VIR_DOMAIN_UNDEFINE_MANAGED_SAVE.  No snapshot metadata for
     * ESX, so we can trivially ignore that flag.  */
    virCheckFlags(VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA, -1);

so I'll use that construct in v2.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux