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(a)linux.vnet.ibm.com>
---
src/conf/domain_conf.c | 21 ---------------------
src/conf/domain_conf.h | 21 +++++++++++++++++++++
src/security/virt-aa-helper.c | 7 +++++++
3 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a1c2506..20ce83e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -64,27 +64,6 @@
VIR_LOG_INIT("conf.domain_conf");
-/* This structure holds various callbacks and data needed
- * while parsing and creating domain XMLs */
-struct _virDomainXMLOption {
- virObject parent;
-
- /* XML parser callbacks and defaults */
- virDomainDefParserConfig config;
-
- /* domain private data management callbacks */
- virDomainXMLPrivateDataCallbacks privateData;
-
- /* XML namespace callbacks */
- virDomainXMLNamespace ns;
-
- /* ABI stability callbacks */
- virDomainABIStability abi;
-
- /* Private data for save image stored in snapshot XML */
- virSaveCookieCallbacks saveCookie;
-};
-
#define VIR_DOMAIN_DEF_FORMAT_COMMON_FLAGS \
(VIR_DOMAIN_DEF_FORMAT_SECURE | \
VIR_DOMAIN_DEF_FORMAT_INACTIVE | \
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 6f7f96b..aacb88a 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2662,6 +2662,27 @@ struct _virDomainABIStability {
virDomainABIStabilityDomain domain;
};
+/* This structure holds various callbacks and data needed
+ * while parsing and creating domain XMLs */
+struct _virDomainXMLOption {
+ virObject parent;
+
+ /* XML parser callbacks and defaults */
+ virDomainDefParserConfig config;
+
+ /* domain private data management callbacks */
+ virDomainXMLPrivateDataCallbacks privateData;
+
+ /* XML namespace callbacks */
+ virDomainXMLNamespace ns;
+
+ /* ABI stability callbacks */
+ virDomainABIStability abi;
+
+ /* Private data for save image stored in snapshot XML */
+ virSaveCookieCallbacks saveCookie;
+};
+
virDomainXMLOptionPtr virDomainXMLOptionNew(virDomainDefParserConfigPtr config,
virDomainXMLPrivateDataCallbacksPtr priv,
virDomainXMLNamespacePtr xmlns,
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index f7ccae0..8b0ca46 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -699,6 +699,13 @@ get_definition(vahControl * ctl, const char *xmlStr)
goto exit;
}
+ if (virtType == VIR_DOMAIN_VIRT_QEMU || virtType == VIR_DOMAIN_VIRT_KVM) {
+ ctl->xmlopt->config.features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG |
+ VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN |
+ VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS |
+ VIR_DOMAIN_DEF_FEATURE_USER_ALIAS;
+ }
+
if (virCapabilitiesAddGuestDomain(guest,
virtType,
NULL,