[libvirt] [PATCHv2] Trivially support DomainHasManagedSaveImage
Eric Blake
eblake at redhat.com
Wed Feb 4 22:37:34 UTC 2015
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150204/033781d4/attachment-0001.sig>
More information about the libvir-list
mailing list