mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
virCaps: conf: start splitting out irrelevat data
The virCaps structure gathered a ton of irrelevant data over time that. The original reason is that it was propagated to the XML parser functions. This patch aims to create a new data structure virDomainXMLConf that will contain immutable data that are used by the XML parser. This will allow two things we need: 1) Get rid of the stuff from virCaps 2) Allow us to add callbacks to check and add driver specific stuff after domain XML is parsed. This first attempt removes pointers to private data allocation functions to this new structure and update all callers and function that require them.
This commit is contained in:
1 parent
be27de6e8d
commit
27cf98e2d1
65 files changed
+659
-424
No files matched your search
+7
-1
@@ -13,6 +13,7 @@
|
||||
|
||||
static virCapsPtr caps;
|
||||
static virVMXContext ctx;
|
||||
static virDomainXMLConfPtr xmlconf;
|
||||
|
||||
static int testDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
|
||||
virArch arch ATTRIBUTE_UNUSED)
|
||||
@@ -72,6 +73,7 @@ testCapsInit(void)
|
||||
|
||||
failure:
|
||||
virObjectUnref(caps);
|
||||
virObjectUnref(xmlconf);
|
||||
caps = NULL;
|
||||
}
|
||||
|
||||
@@ -92,7 +94,8 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
|
||||
goto failure;
|
||||
}
|
||||
|
||||
def = virDomainDefParseString(caps, xmlData, 1 << VIR_DOMAIN_VIRT_VMWARE,
|
||||
def = virDomainDefParseString(caps, xmlconf, xmlData,
|
||||
1 << VIR_DOMAIN_VIRT_VMWARE,
|
||||
VIR_DOMAIN_XML_INACTIVE);
|
||||
|
||||
if (def == NULL) {
|
||||
@@ -237,6 +240,9 @@ mymain(void)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!(xmlconf = virDomainXMLConfNew(NULL, NULL)))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
ctx.opaque = NULL;
|
||||
ctx.parseFileName = NULL;
|
||||
ctx.formatFileName = testFormatVMXFileName;
|
||||
|
||||
Reference in new issue
Block a user