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

Eric Blake eblake at redhat.com
Tue Jul 9 17:30:34 UTC 2019


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 at redhat.com>
> ---
>  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190709/c734c627/attachment-0001.sig>


More information about the libvir-list mailing list