[libvirt] [PATCH] Return VIR_ERR_NO_SUPPORT in qemu SetMemory()/SetVcpus() if domain is active.

qemu doesn't support setting the memory or vcpus of an active guest. In this case, use the VIR_ERR_NO_SUPPORT return code to indicate that the action failed because its not supported. Index: src/qemu_driver.c =================================================================== RCS file: /data/cvs/libvirt/src/qemu_driver.c,v retrieving revision 1.85 diff -u -p -r1.85 qemu_driver.c --- src/qemu_driver.c 10 Jun 2008 10:43:28 -0000 1.85 +++ src/qemu_driver.c 11 Jun 2008 20:35:09 -0000 @@ -2148,7 +2148,7 @@ static int qemudDomainSetMemory(virDomai } if (qemudIsActiveVM(vm)) { - qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR, + qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT, "%s", _("cannot set memory of an active domain")); return -1; } @@ -2404,7 +2404,7 @@ static int qemudDomainSetVcpus(virDomain } if (qemudIsActiveVM(vm)) { - qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR, "%s", + qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT, "%s", _("cannot change vcpu count of an active domain")); return -1; } -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

On Wed, Jun 11, 2008 at 01:45:19PM -0700, Kaitlin Rupert wrote:
qemu doesn't support setting the memory or vcpus of an active guest. In this case, use the VIR_ERR_NO_SUPPORT return code to indicate that the action failed because its not supported.
Right, that's what we discussed yesterday, makes sense, applied and commited Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Hi, is support for virtio_balloon driver planned? Using it, the memory size can be changed for running KVM domains... BR nik On Thu, Jun 12, 2008 at 04:57:32AM -0400, Daniel Veillard wrote:
On Wed, Jun 11, 2008 at 01:45:19PM -0700, Kaitlin Rupert wrote:
qemu doesn't support setting the memory or vcpus of an active guest. In this case, use the VIR_ERR_NO_SUPPORT return code to indicate that the action failed because its not supported.
Right, that's what we discussed yesterday, makes sense, applied and commited
Daniel
-- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
-- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- ------------------------------------- Nikola CIPRICH LinuxBox.cz, s.r.o. 28. rijna 168, 709 01 Ostrava tel.: +420 596 603 142 fax: +420 596 621 273 mobil: +420 777 093 799 www.linuxbox.cz mobil servis: +420 737 238 656 email servis: servis@linuxbox.cz -------------------------------------

On Mon, Jun 30, 2008 at 05:31:59PM +0200, Nikola Ciprich wrote:
Hi, is support for virtio_balloon driver planned?
can you detect its presence at runtime ?
Using it, the memory size can be changed for running KVM domains...
I doubt anybody would object code adding the feature, the problem is getting the code and something that fail/work reliably depending on the vailability of the driver. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

can you detect its presence at runtime ? from a slight look to patches yes, it will be possible using monitor "info ballon" command which will print either "Ballooning not activated in VM" or "balloon: actual=%d", so I guess
Hi Daniel, thanks for reply. Well, it seems that I'm a bit ahead of time here, the balloning support didn't even make it to QEMU trunk... So there is not big hurry with it :) To answer Your questions: this should be sufficient.
I doubt anybody would object code adding the feature, the problem is getting the code and something that fail/work reliably depending on the vailability of the driver. Seems like this should not be that complex. I'll give ballooning patches a try and if it works well, I'll try to prepare some libvirt patches. I'll let You know about progress OK?
Daniel regards nik
-- ------------------------------------- Nikola CIPRICH LinuxBox.cz, s.r.o. 28. rijna 168, 709 01 Ostrava tel.: +420 596 603 142 fax: +420 596 621 273 mobil: +420 777 093 799 www.linuxbox.cz mobil servis: +420 737 238 656 email servis: servis@linuxbox.cz -------------------------------------

On Wed, Jul 02, 2008 at 11:12:38AM +0200, Nikola Ciprich wrote:
Hi Daniel,
thanks for reply. Well, it seems that I'm a bit ahead of time here, the balloning support didn't even make it to QEMU trunk... So there is not big hurry with it :)
Okay, thanks for the status report :-)
can you detect its presence at runtime ? from a slight look to patches yes, it will be possible using monitor "info ballon" command which will print either "Ballooning not activated in VM" or "balloon: actual=%d", so I guess
To answer Your questions: this should be sufficient.
sounds right
I doubt anybody would object code adding the feature, the problem is getting the code and something that fail/work reliably depending on the vailability of the driver. Seems like this should not be that complex. I'll give ballooning patches a try and if it works well, I'll try to prepare some libvirt patches. I'll let You know about progress OK?
Excellent :-) Thanks in advance ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (3)
-
Daniel Veillard
-
Kaitlin Rupert
-
Nikola Ciprich