[libvirt] [PATCH] lxc: trivially support DomainHasManagedSaveImage

Return 0 instead of ERR_NO_SUPPORT to avoid spamming daemon logs when 'virsh dominfo' is run. https://bugzilla.redhat.com/show_bug.cgi?id=1095637 --- src/lxc/lxc_driver.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 07ddce3..b5aa1cc 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -5717,6 +5717,29 @@ lxcNodeAllocPages(virConnectPtr conn, } +static int +lxcDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) +{ + virDomainObjPtr vm = NULL; + int ret = -1; + + virCheckFlags(0, -1); + + if (!(vm = lxcDomObjFromDomain(dom))) + return ret; + + if (virDomainHasManagedSaveImageEnsureACL(dom->conn, vm->def) < 0) + goto cleanup; + + ret = 0; + + cleanup: + if (vm) + virObjectUnlock(vm); + return ret; +} + + /* Function Tables */ static virHypervisorDriver lxcDriver = { .no = VIR_DRV_LXC, @@ -5810,6 +5833,7 @@ static virHypervisorDriver lxcDriver = { .domainLxcOpenNamespace = lxcDomainLxcOpenNamespace, /* 1.0.2 */ .nodeGetFreePages = lxcNodeGetFreePages, /* 1.2.6 */ .nodeAllocPages = lxcNodeAllocPages, /* 1.2.9 */ + .domainHasManagedSaveImage = lxcDomainHasManagedSaveImage, /* 1.2.12 */ }; static virStateDriver lxcStateDriver = { -- 2.0.4

On Thu, Jan 15, 2015 at 03:12:01PM +0100, Ján Tomko wrote:
Return 0 instead of ERR_NO_SUPPORT to avoid spamming daemon logs when 'virsh dominfo' is run.
https://bugzilla.redhat.com/show_bug.cgi?id=1095637 --- src/lxc/lxc_driver.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
What about all the other virt drivers too ? If virsh is going to do this, then we really ought to make every virt driver have this same no-op impl. The bug only reports it against LXC since that's what the reporter tested, but anyone could see it against other virt drivers Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 01/15/2015 03:20 PM, Daniel P. Berrange wrote:
On Thu, Jan 15, 2015 at 03:12:01PM +0100, Ján Tomko wrote:
Return 0 instead of ERR_NO_SUPPORT to avoid spamming daemon logs when 'virsh dominfo' is run.
https://bugzilla.redhat.com/show_bug.cgi?id=1095637 --- src/lxc/lxc_driver.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
What about all the other virt drivers too ? If virsh is going to do this, then we really ought to make every virt driver have this same no-op impl. The bug only reports it against LXC since that's what the reporter tested, but anyone could see it against other virt drivers
The problem is - I can't tell if a driver doesn't have any ManagedSave* APIs implemented because nobody took the time to implement them in libvirt, or because the hypervisor does not support it. For example if VirtualBox used without libvirtd can do a save, I think it would be wrong to always return 0 in our vbox driver. Jan
participants (2)
-
Daniel P. Berrange
-
Ján Tomko