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

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

 



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@xxxxxxxxxxxxxxxxxx

--
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]