[PATCH] esx: Accept VIR_DOMAIN_AFFECT_CURRENT in addition to VIR_DOMAIN_AFFECT_LIVE

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

 



Basically autotranslate VIR_DOMAIN_AFFECT_CURRENT to VIR_DOMAIN_AFFECT_LIVE.

Modification impact is handled lax anyway. There is no distinction between
a live and a stored config in the VMware world. A strict modification impact
handling would require to check the virtual machine state each time and enforce
VIR_DOMAIN_AFFECT_LIVE-only for running and VIR_DOMAIN_AFFECT_CONFIG-only
for inactive domains. But that would be useless overhead.
---
 src/esx/esx_driver.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index f53b9c4..85640ce 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -2531,7 +2531,7 @@ esxDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
     esxVI_TaskInfoState taskInfoState;
     char *taskInfoErrorMessage = NULL;
 
-    if (flags != VIR_DOMAIN_AFFECT_LIVE) {
+    if (flags != VIR_DOMAIN_AFFECT_CURRENT && flags != VIR_DOMAIN_AFFECT_LIVE) {
         virReportError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
         return -1;
     }
@@ -2615,7 +2615,8 @@ esxDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
     esxVI_ObjectContent *hostSystem = NULL;
     esxVI_DynamicProperty *dynamicProperty = NULL;
 
-    if (flags != (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)) {
+    if (flags != (VIR_DOMAIN_AFFECT_CURRENT | VIR_DOMAIN_VCPU_MAXIMUM) &&
+        flags != (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)) {
         virReportError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
         return -1;
     }
@@ -5222,7 +5223,7 @@ esxDomainGetMetadata(virDomainPtr domain, int type,
     esxVI_String *propertyNameList = NULL;
     esxVI_ObjectContent *virtualMachine = NULL;
 
-    if (flags != VIR_DOMAIN_AFFECT_LIVE) {
+    if (flags != VIR_DOMAIN_AFFECT_CURRENT && flags != VIR_DOMAIN_AFFECT_LIVE) {
         virReportError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
         return NULL;
     }
-- 
1.7.9.5

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