]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virt-aa-helper: Set the supported features
authorShivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Tue, 6 Feb 2018 13:08:14 +0000 (08:08 -0500)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 6 Feb 2018 14:12:21 +0000 (15:12 +0100)
The virt-aa-helper fails to parse the xmls with the memory/cpu
hotplug features or user assigned aliases. Set the features in
xmlopt->config for the parsing to succeed.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
src/conf/domain_conf.h
src/security/virt-aa-helper.c

index 21e00451572b3587a57ca774c9e17c265cdcfb1a..091f2ee71a156b7953123e3a611e15391900e482 100644 (file)
@@ -2532,6 +2532,8 @@ typedef bool (*virDomainObjListACLFilter)(virConnectPtr conn,
                                           virDomainDefPtr def);
 
 
+/* NB: Any new flag to this list be considered to be set in
+ * virt-aa-helper code if the flag prevents parsing. */
 typedef enum {
     VIR_DOMAIN_DEF_FEATURE_WIDE_SCSI = (1 << 0),
     VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG = (1 << 1),
index f7ccae0b022fc269f6db4db8a6a212185035eb21..29a459da20af01b13a979da65c52cbd82445c6f0 100644 (file)
@@ -654,6 +654,11 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
     return rc;
 }
 
+virDomainDefParserConfig virAAHelperDomainDefParserConfig = {
+    .features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG |
+                VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN |
+                VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS,
+};
 
 static int
 get_definition(vahControl * ctl, const char *xmlStr)
@@ -673,7 +678,8 @@ get_definition(vahControl * ctl, const char *xmlStr)
         goto exit;
     }
 
-    if (!(ctl->xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL))) {
+    if (!(ctl->xmlopt = virDomainXMLOptionNew(&virAAHelperDomainDefParserConfig,
+                                              NULL, NULL, NULL, NULL))) {
         vah_error(ctl, 0, _("Failed to create XML config object"));
         goto exit;
     }