Re: [PATCHv2] Trivially support DomainHasManagedSaveImage

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

 



On 02/04/2015 05:36 AM, Ján Tomko wrote:
> Return 0 instead of ERR_NO_SUPPORT in each driver
> where we don't support managed save.
> 
> This avoids spamming daemon logs when 'virsh dominfo' is run.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1095637
> ---
>  src/bhyve/bhyve_driver.c         | 25 ++++++++++++++++++++++++-
>  src/esx/esx_driver.c             | 11 ++++++++++-
>  src/lxc/lxc_driver.c             | 26 +++++++++++++++++++++++++-
>  src/openvz/openvz_driver.c       | 12 +++++++++++-
>  src/parallels/parallels_driver.c | 11 ++++++++++-
>  src/phyp/phyp_driver.c           | 11 ++++++++++-
>  src/uml/uml_driver.c             | 33 ++++++++++++++++++++++++++++++++-
>  src/vbox/vbox_common.c           | 11 ++++++++++-
>  src/vmware/vmware_driver.c       | 11 ++++++++++-
>  src/xenapi/xenapi_driver.c       | 11 ++++++++++-
>  10 files changed, 152 insertions(+), 10 deletions(-)

> +static int
> +bhyveDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags)
> +{
> +    virDomainObjPtr vm = NULL;
> +    int ret = -1;
> +
> +    virCheckFlags(0, -1);
> +
> +    if (!(vm = bhyveDomObjFromDomain(domain)))
> +        goto cleanup;

Here, you validate that the vm exists.

>  
> +static int
> +esxDomainHasManagedSaveImage(virDomainPtr dom ATTRIBUTE_UNUSED, unsigned int flags)
> +{
> +    virCheckFlags(0, -1);
> +
> +    return 0;

whereas here, you blindly return 0 even if the vm does not exist.  That
feels inconsistent to me; I'd feel better if we returned 0 only if we
know the domain exists.  But I can also be persuaded to live with the
weaker semantics, in which case:

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://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]