size_t nguests_max;
virCapsGuestPtr *guests;
- /* Move to virDomainXMLConf later */
+ /* Move to virDomainXMLOption later */
unsigned char macPrefix[VIR_MAC_PREFIX_BUFLEN];
unsigned int emulatorRequired : 1;
const char *defaultDiskDriverName;
/* This structure holds various callbacks and data needed
* while parsing and creating domain XMLs */
-struct _virDomainXMLConf {
+struct _virDomainXMLOption {
virObject parent;
/* domain private data management callbacks */
static virClassPtr virDomainObjClass;
static virClassPtr virDomainObjListClass;
-static virClassPtr virDomainXMLConfClass;
+static virClassPtr virDomainXMLOptionClass;
static void virDomainObjDispose(void *obj);
static void virDomainObjListDispose(void *obj);
virDomainObjListDispose)))
return -1;
- if (!(virDomainXMLConfClass = virClassNew(virClassForObject(),
- "virDomainXMLConf",
- sizeof(virDomainXMLConf),
- NULL)))
+ if (!(virDomainXMLOptionClass = virClassNew(virClassForObject(),
+ "virDomainXMLOption",
+ sizeof(virDomainXMLOption),
+ NULL)))
return -1;
return 0;
/**
- * virDomainXMLConfNew:
+ * virDomainXMLOptionNew:
*
* Allocate a new domain XML configuration
*/
-virDomainXMLConfPtr
-virDomainXMLConfNew(virDomainXMLPrivateDataCallbacksPtr priv,
- virDomainXMLNamespacePtr xmlns)
+virDomainXMLOptionPtr
+virDomainXMLOptionNew(virDomainXMLPrivateDataCallbacksPtr priv,
+ virDomainXMLNamespacePtr xmlns)
{
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
if (virDomainObjInitialize() < 0)
return NULL;
- if (!(xmlconf = virObjectNew(virDomainXMLConfClass)))
+ if (!(xmlopt = virObjectNew(virDomainXMLOptionClass)))
return NULL;
if (priv)
- xmlconf->privateData = *priv;
+ xmlopt->privateData = *priv;
if (xmlns)
- xmlconf->ns = *xmlns;
+ xmlopt->ns = *xmlns;
- return xmlconf;
+ return xmlopt;
}
/**
- * virDomainXMLConfGetNamespace:
+ * virDomainXMLOptionGetNamespace:
*
- * @xmlconf: XML parser configuration object
+ * @xmlopt: XML parser configuration object
*
* Returns a pointer to the stored namespace structure.
- * The lifetime of the pointer is equal to @xmlconf;
+ * The lifetime of the pointer is equal to @xmlopt;
*/
virDomainXMLNamespacePtr
-virDomainXMLConfGetNamespace(virDomainXMLConfPtr xmlconf)
+virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt)
{
- return &xmlconf->ns;
+ return &xmlopt->ns;
}
}
virDomainObjPtr
-virDomainObjNew(virDomainXMLConfPtr xmlconf)
+virDomainObjNew(virDomainXMLOptionPtr xmlopt)
{
virDomainObjPtr domain;
if (!(domain = virObjectLockableNew(virDomainObjClass)))
return NULL;
- if (xmlconf->privateData.alloc) {
- if (!(domain->privateData = (xmlconf->privateData.alloc)())) {
+ if (xmlopt->privateData.alloc) {
+ if (!(domain->privateData = (xmlopt->privateData.alloc)())) {
virReportOOMError();
goto error;
}
- domain->privateDataFreeFunc = xmlconf->privateData.free;
+ domain->privateDataFreeFunc = xmlopt->privateData.free;
}
if (!(domain->snapshots = virDomainSnapshotObjListNew()))
*/
static virDomainObjPtr
virDomainObjListAddLocked(virDomainObjListPtr doms,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const virDomainDefPtr def,
unsigned int flags,
virDomainDefPtr *oldDef)
goto error;
}
- if (!(vm = virDomainObjNew(xmlconf)))
+ if (!(vm = virDomainObjNew(xmlopt)))
goto cleanup;
vm->def = def;
virDomainObjPtr virDomainObjListAdd(virDomainObjListPtr doms,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const virDomainDefPtr def,
unsigned int flags,
virDomainDefPtr *oldDef)
virDomainObjPtr ret;
virObjectLock(doms);
- ret = virDomainObjListAddLocked(doms, xmlconf, def, flags, oldDef);
+ ret = virDomainObjListAddLocked(doms, xmlopt, def, flags, oldDef);
virObjectUnlock(doms);
return ret;
}
*/
int
virDomainObjSetDefTransient(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
virDomainObjPtr domain,
bool live)
{
if (domain->newDef)
return 0;
- if (!(domain->newDef = virDomainDefCopy(caps, xmlconf, domain->def, false)))
+ if (!(domain->newDef = virDomainDefCopy(caps, xmlopt, domain->def, false)))
goto out;
ret = 0;
*/
virDomainDefPtr
virDomainObjGetPersistentDef(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
virDomainObjPtr domain)
{
- if (virDomainObjSetDefTransient(caps, xmlconf, domain, false) < 0)
+ if (virDomainObjSetDefTransient(caps, xmlopt, domain, false) < 0)
return NULL;
if (domain->newDef)
*/
int
virDomainLiveConfigHelperMethod(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
virDomainObjPtr dom,
unsigned int *flags,
virDomainDefPtr *persistentDef)
"transient domain"));
goto cleanup;
}
- if (!(*persistentDef = virDomainObjGetPersistentDef(caps, xmlconf, dom))) {
+ if (!(*persistentDef = virDomainObjGetPersistentDef(caps, xmlopt, dom))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Get persistent config failed"));
goto cleanup;
static virDomainDefPtr
virDomainDefParseXML(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
xmlDocPtr xml,
xmlNodePtr root,
xmlXPathContextPtr ctxt,
/* we have to make a copy of all of the callback pointers here since
* we won't have the virCaps structure available during free
*/
- def->ns = xmlconf->ns;
+ def->ns = xmlopt->ns;
if (def->ns.parse &&
(def->ns.parse)(xml, root, ctxt, &def->namespaceData) < 0)
static virDomainObjPtr
virDomainObjParseXML(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
xmlDocPtr xml,
xmlXPathContextPtr ctxt,
unsigned int expectedVirtTypes,
int state;
int reason = 0;
- if (!(obj = virDomainObjNew(xmlconf)))
+ if (!(obj = virDomainObjNew(xmlopt)))
return NULL;
if (!(config = virXPathNode("./domain", ctxt))) {
oldnode = ctxt->node;
ctxt->node = config;
- obj->def = virDomainDefParseXML(caps, xmlconf, xml, config, ctxt, expectedVirtTypes,
+ obj->def = virDomainDefParseXML(caps, xmlopt, xml, config, ctxt, expectedVirtTypes,
flags);
ctxt->node = oldnode;
if (!obj->def)
}
VIR_FREE(nodes);
- if (xmlconf->privateData.parse &&
- ((xmlconf->privateData.parse)(ctxt, obj->privateData)) < 0)
+ if (xmlopt->privateData.parse &&
+ ((xmlopt->privateData.parse)(ctxt, obj->privateData)) < 0)
goto error;
return obj;
virDomainDefParse(const char *xmlStr,
const char *filename,
virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
unsigned int expectedVirtTypes,
unsigned int flags)
{
int keepBlanksDefault = xmlKeepBlanksDefault(0);
if ((xml = virXMLParse(filename, xmlStr, _("(domain_definition)")))) {
- def = virDomainDefParseNode(caps, xmlconf, xml, xmlDocGetRootElement(xml),
+ def = virDomainDefParseNode(caps, xmlopt, xml, xmlDocGetRootElement(xml),
expectedVirtTypes, flags);
xmlFreeDoc(xml);
}
virDomainDefPtr
virDomainDefParseString(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *xmlStr,
unsigned int expectedVirtTypes,
unsigned int flags)
{
- return virDomainDefParse(xmlStr, NULL, caps, xmlconf,
+ return virDomainDefParse(xmlStr, NULL, caps, xmlopt,
expectedVirtTypes, flags);
}
virDomainDefPtr
virDomainDefParseFile(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *filename,
unsigned int expectedVirtTypes,
unsigned int flags)
{
- return virDomainDefParse(NULL, filename, caps, xmlconf,
+ return virDomainDefParse(NULL, filename, caps, xmlopt,
expectedVirtTypes, flags);
}
virDomainDefPtr
virDomainDefParseNode(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
xmlDocPtr xml,
xmlNodePtr root,
unsigned int expectedVirtTypes,
}
ctxt->node = root;
- def = virDomainDefParseXML(caps, xmlconf, xml, root, ctxt,
+ def = virDomainDefParseXML(caps, xmlopt, xml, root, ctxt,
expectedVirtTypes, flags);
cleanup:
static virDomainObjPtr
virDomainObjParseNode(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
xmlDocPtr xml,
xmlNodePtr root,
unsigned int expectedVirtTypes,
}
ctxt->node = root;
- obj = virDomainObjParseXML(caps, xmlconf, xml, ctxt, expectedVirtTypes, flags);
+ obj = virDomainObjParseXML(caps, xmlopt, xml, ctxt, expectedVirtTypes, flags);
cleanup:
xmlXPathFreeContext(ctxt);
static virDomainObjPtr
virDomainObjParseFile(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *filename,
unsigned int expectedVirtTypes,
unsigned int flags)
int keepBlanksDefault = xmlKeepBlanksDefault(0);
if ((xml = virXMLParseFile(filename))) {
- obj = virDomainObjParseNode(caps, xmlconf, xml,
+ obj = virDomainObjParseNode(caps, xmlopt, xml,
xmlDocGetRootElement(xml),
expectedVirtTypes, flags);
xmlFreeDoc(xml);
static char *
-virDomainObjFormat(virDomainXMLConfPtr xmlconf,
+virDomainObjFormat(virDomainXMLOptionPtr xmlopt,
virDomainObjPtr obj,
unsigned int flags)
{
virDomainTaintTypeToString(i));
}
- if (xmlconf->privateData.format &&
- ((xmlconf->privateData.format)(&buf, obj->privateData)) < 0)
+ if (xmlopt->privateData.format &&
+ ((xmlopt->privateData.format)(&buf, obj->privateData)) < 0)
goto error;
virBufferAdjustIndent(&buf, 2);
}
int
-virDomainSaveStatus(virDomainXMLConfPtr xmlconf,
+virDomainSaveStatus(virDomainXMLOptionPtr xmlopt,
const char *statusDir,
virDomainObjPtr obj)
{
int ret = -1;
char *xml;
- if (!(xml = virDomainObjFormat(xmlconf, obj, flags)))
+ if (!(xml = virDomainObjFormat(xmlopt, obj, flags)))
goto cleanup;
if (virDomainSaveXML(statusDir, obj->def, xml))
static virDomainObjPtr
virDomainObjListLoadConfig(virDomainObjListPtr doms,
virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *configDir,
const char *autostartDir,
const char *name,
if ((configFile = virDomainConfigFile(configDir, name)) == NULL)
goto error;
- if (!(def = virDomainDefParseFile(caps, xmlconf, configFile,
+ if (!(def = virDomainDefParseFile(caps, xmlopt, configFile,
expectedVirtTypes,
VIR_DOMAIN_XML_INACTIVE)))
goto error;
if ((autostart = virFileLinkPointsTo(autostartLink, configFile)) < 0)
goto error;
- if (!(dom = virDomainObjListAddLocked(doms, xmlconf, def, 0, &oldDef)))
+ if (!(dom = virDomainObjListAddLocked(doms, xmlopt, def, 0, &oldDef)))
goto error;
dom->autostart = autostart;
static virDomainObjPtr
virDomainObjListLoadStatus(virDomainObjListPtr doms,
virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *statusDir,
const char *name,
unsigned int expectedVirtTypes,
if ((statusFile = virDomainConfigFile(statusDir, name)) == NULL)
goto error;
- if (!(obj = virDomainObjParseFile(caps, xmlconf, statusFile, expectedVirtTypes,
+ if (!(obj = virDomainObjParseFile(caps, xmlopt, statusFile, expectedVirtTypes,
VIR_DOMAIN_XML_INTERNAL_STATUS |
VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET |
VIR_DOMAIN_XML_INTERNAL_PCI_ORIG_STATES)))
int
virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *configDir,
const char *autostartDir,
int liveStatus,
if (liveStatus)
dom = virDomainObjListLoadStatus(doms,
caps,
- xmlconf,
+ xmlopt,
configDir,
entry->d_name,
expectedVirtTypes,
else
dom = virDomainObjListLoadConfig(doms,
caps,
- xmlconf,
+ xmlopt,
configDir,
autostartDir,
entry->d_name,
* snapshots). */
virDomainDefPtr
virDomainDefCopy(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
virDomainDefPtr src,
bool migratable)
{
if (!(xml = virDomainDefFormat(src, write_flags)))
return NULL;
- ret = virDomainDefParseString(caps, xmlconf, xml, -1, read_flags);
+ ret = virDomainDefParseString(caps, xmlopt, xml, -1, read_flags);
VIR_FREE(xml);
return ret;
virDomainDefPtr
virDomainObjCopyPersistentDef(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
virDomainObjPtr dom)
{
virDomainDefPtr cur;
- cur = virDomainObjGetPersistentDef(caps, xmlconf, dom);
- return virDomainDefCopy(caps, xmlconf, cur, false);
+ cur = virDomainObjGetPersistentDef(caps, xmlopt, dom);
+ return virDomainDefCopy(caps, xmlopt, cur, false);
}
/* This structure holds various callbacks and data needed
* while parsing and creating domain XMLs */
-typedef struct _virDomainXMLConf virDomainXMLConf;
-typedef virDomainXMLConf *virDomainXMLConfPtr;
+typedef struct _virDomainXMLOption virDomainXMLOption;
+typedef virDomainXMLOption *virDomainXMLOptionPtr;
typedef void *(*virDomainXMLPrivateDataAllocFunc)(void);
typedef void (*virDomainXMLPrivateDataFreeFunc)(void *);
virDomainXMLPrivateDataParseFunc parse;
};
-virDomainXMLConfPtr
-virDomainXMLConfNew(virDomainXMLPrivateDataCallbacksPtr priv,
+virDomainXMLOptionPtr
+virDomainXMLOptionNew(virDomainXMLPrivateDataCallbacksPtr priv,
virDomainXMLNamespacePtr xmlns);
virDomainXMLNamespacePtr
-virDomainXMLConfGetNamespace(virDomainXMLConfPtr xmlconf)
+virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt)
ATTRIBUTE_NONNULL(1);
static inline bool
return dom->def->id != -1;
}
-virDomainObjPtr virDomainObjNew(virDomainXMLConfPtr caps)
+virDomainObjPtr virDomainObjNew(virDomainXMLOptionPtr caps)
ATTRIBUTE_NONNULL(1);
virDomainObjListPtr virDomainObjListNew(void);
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE = (1 << 1),
};
virDomainObjPtr virDomainObjListAdd(virDomainObjListPtr doms,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const virDomainDefPtr def,
unsigned int flags,
virDomainDefPtr *oldDef);
bool live,
virDomainDefPtr *oldDef);
int virDomainObjSetDefTransient(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
virDomainObjPtr domain,
bool live);
virDomainDefPtr
virDomainObjGetPersistentDef(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
virDomainObjPtr domain);
int
virDomainLiveConfigHelperMethod(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
virDomainObjPtr dom,
unsigned int *flags,
virDomainDefPtr *persistentDef);
-virDomainDefPtr virDomainDefCopy(virCapsPtr caps, virDomainXMLConfPtr xmlconf,
+virDomainDefPtr virDomainDefCopy(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
virDomainDefPtr src, bool migratable);
virDomainDefPtr
-virDomainObjCopyPersistentDef(virCapsPtr caps, virDomainXMLConfPtr xmlconf,
+virDomainObjCopyPersistentDef(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
virDomainObjPtr dom);
void virDomainObjListRemove(virDomainObjListPtr doms,
const char *xmlStr,
unsigned int flags);
virDomainDefPtr virDomainDefParseString(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *xmlStr,
unsigned int expectedVirtTypes,
unsigned int flags);
virDomainDefPtr virDomainDefParseFile(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *filename,
unsigned int expectedVirtTypes,
unsigned int flags);
virDomainDefPtr virDomainDefParseNode(virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
xmlDocPtr doc,
xmlNodePtr root,
unsigned int expectedVirtTypes,
int virDomainSaveConfig(const char *configDir,
virDomainDefPtr def);
-int virDomainSaveStatus(virDomainXMLConfPtr xmlconf,
+int virDomainSaveStatus(virDomainXMLOptionPtr xmlopt,
const char *statusDir,
virDomainObjPtr obj) ATTRIBUTE_RETURN_CHECK;
int virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *configDir,
const char *autostartDir,
int liveStatus,
virDomainSnapshotDefPtr
virDomainSnapshotDefParseString(const char *xmlStr,
virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
unsigned int expectedVirtTypes,
unsigned int flags)
{
_("missing domain in snapshot"));
goto cleanup;
}
- def->dom = virDomainDefParseNode(caps, xmlconf, xml, domainNode,
+ def->dom = virDomainDefParseNode(caps, xmlopt, xml, domainNode,
expectedVirtTypes,
(VIR_DOMAIN_XML_INACTIVE |
VIR_DOMAIN_XML_SECURE));
virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr,
virCapsPtr caps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
unsigned int expectedVirtTypes,
unsigned int flags);
void virDomainSnapshotDefFree(virDomainSnapshotDefPtr def);
esxVI_Context_Free(&(*priv)->vCenter);
esxUtil_FreeParsedUri(&(*priv)->parsedUri);
virObjectUnref((*priv)->caps);
- virObjectUnref((*priv)->xmlconf);
+ virObjectUnref((*priv)->xmlopt);
VIR_FREE(*priv);
}
goto cleanup;
}
- if (!(priv->xmlconf = virDomainXMLConfNew(NULL, NULL)))
+ if (!(priv->xmlopt = virDomainXMLOptionNew(NULL, NULL)))
goto cleanup;
conn->privateData = priv;
return NULL;
}
- def = virDomainDefParseString(priv->caps, priv->xmlconf,
+ def = virDomainDefParseString(priv->caps, priv->xmlopt,
domainXml, 1 << VIR_DOMAIN_VIRT_VMWARE, 0);
if (def == NULL) {
}
/* Parse domain XML */
- def = virDomainDefParseString(priv->caps, priv->xmlconf,
+ def = virDomainDefParseString(priv->caps, priv->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_VMWARE,
VIR_DOMAIN_XML_INACTIVE);
}
def = virDomainSnapshotDefParseString(xmlDesc, priv->caps,
- priv->xmlconf, 0, 0);
+ priv->xmlopt, 0, 0);
if (def == NULL) {
return NULL;
esxVI_Context *vCenter;
esxUtil_ParsedUri *parsedUri;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
int32_t maxVcpus;
esxVI_Boolean supportsVMotion;
esxVI_Boolean supportsLongMode; /* aka x86_64 */
virDomainWatchdogActionTypeToString;
virDomainWatchdogModelTypeFromString;
virDomainWatchdogModelTypeToString;
-virDomainXMLConfGetNamespace;
-virDomainXMLConfNew;
+virDomainXMLOptionGetNamespace;
+virDomainXMLOptionNew;
virSecurityDeviceLabelDefFree;
virSecurityLabelDefFree;
struct _libxlDriverPrivate {
virMutex lock;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
unsigned int version;
FILE *logger_file;
goto error;
}
- if (!(def = virDomainDefParseString(driver->caps, driver->xmlconf,
+ if (!(def = virDomainDefParseString(driver->caps, driver->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE)))
goto error;
}
- if (virDomainSaveStatus(driver->xmlconf, driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, driver->stateDir, vm) < 0)
goto error;
if (!driver->nactive && driver->inhibitCallback)
libxlDriverLock(libxl_driver);
virObjectUnref(libxl_driver->caps);
- virObjectUnref(libxl_driver->xmlconf);
+ virObjectUnref(libxl_driver->xmlopt);
virObjectUnref(libxl_driver->domains);
libxl_ctx_free(libxl_driver->ctx);
xtl_logger_destroy(libxl_driver->logger);
goto error;
}
- if (!(libxl_driver->xmlconf = virDomainXMLConfNew(&libxlDomainXMLPrivateDataCallbacks,
+ if (!(libxl_driver->xmlopt = virDomainXMLOptionNew(&libxlDomainXMLPrivateDataCallbacks,
NULL)))
goto error;
/* Load running domains first. */
if (virDomainObjListLoadAllConfigs(libxl_driver->domains,
libxl_driver->caps,
- libxl_driver->xmlconf,
+ libxl_driver->xmlopt,
libxl_driver->stateDir,
libxl_driver->autostartDir,
1, 1 << VIR_DOMAIN_VIRT_XEN,
/* Then inactive persistent configs */
if (virDomainObjListLoadAllConfigs(libxl_driver->domains,
libxl_driver->caps,
- libxl_driver->xmlconf,
+ libxl_driver->xmlopt,
libxl_driver->configDir,
libxl_driver->autostartDir,
0, 1 << VIR_DOMAIN_VIRT_XEN,
libxlDriverLock(libxl_driver);
virDomainObjListLoadAllConfigs(libxl_driver->domains,
libxl_driver->caps,
- libxl_driver->xmlconf,
+ libxl_driver->xmlopt,
libxl_driver->configDir,
libxl_driver->autostartDir,
1, 1 << VIR_DOMAIN_VIRT_XEN,
virCheckFlags(VIR_DOMAIN_START_PAUSED, NULL);
libxlDriverLock(driver);
- if (!(def = virDomainDefParseString(driver->caps, driver->xmlconf,
+ if (!(def = virDomainDefParseString(driver->caps, driver->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
}
- if (virDomainSaveStatus(driver->xmlconf, driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, driver->stateDir, vm) < 0)
goto cleanup;
ret = 0;
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
}
- if (virDomainSaveStatus(driver->xmlconf, driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, driver->stateDir, vm) < 0)
goto cleanup;
ret = 0;
goto cleanup;
}
if (!(persistentDef = virDomainObjGetPersistentDef(driver->caps,
- driver->xmlconf,
+ driver->xmlopt,
vm)))
goto cleanup;
}
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
priv = vm->privateData;
- if (!(def = virDomainObjGetPersistentDef(driver->caps, driver->xmlconf, vm)))
+ if (!(def = virDomainObjGetPersistentDef(driver->caps, driver->xmlopt, vm)))
goto cleanup;
maplen = VIR_CPU_MAPLEN(nvcpus);
goto cleanup;
}
- if (virDomainSaveStatus(driver->xmlconf, driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, driver->stateDir, vm) < 0)
goto cleanup;
ret = 0;
goto cleanup;
}
- if (!(def = virDomainDefParseString(driver->caps, driver->xmlconf, domainXml,
+ if (!(def = virDomainDefParseString(driver->caps, driver->xmlopt, domainXml,
1 << VIR_DOMAIN_VIRT_XEN, 0)))
goto cleanup;
virDomainDefPtr oldDef = NULL;
libxlDriverLock(driver);
- if (!(def = virDomainDefParseString(driver->caps, driver->xmlconf, xml,
+ if (!(def = virDomainDefParseString(driver->caps, driver->xmlopt, xml,
1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
0,
&oldDef)))
/* Make a copy for updated domain. */
if (!(vmdef = virDomainObjCopyPersistentDef(driver->caps,
- driver->xmlconf, vm)))
+ driver->xmlopt, vm)))
goto cleanup;
switch (action) {
* update domain status forcibly because the domain status may be
* changed even if we attach the device failed.
*/
- if (virDomainSaveStatus(driver->xmlconf, driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, driver->stateDir, vm) < 0)
ret = -1;
}
}
-virDomainXMLConfPtr
+virDomainXMLOptionPtr
lxcDomainXMLConfInit(void)
{
- return virDomainXMLConfNew(&virLXCDriverPrivateDataCallbacks, NULL);
+ return virDomainXMLOptionNew(&virLXCDriverPrivateDataCallbacks, NULL);
}
int lxcLoadDriverConfig(virLXCDriverPtr driver)
virMutex lock;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
virCgroupPtr cgroup;
int lxcLoadDriverConfig(virLXCDriverPtr driver);
virCapsPtr lxcCapsInit(virLXCDriverPtr driver);
-virDomainXMLConfPtr lxcDomainXMLConfInit(void);
+virDomainXMLOptionPtr lxcDomainXMLConfInit(void);
static inline void lxcDriverLock(virLXCDriverPtr driver)
{
{
virLXCControllerPtr ctrl = NULL;
virCapsPtr caps = NULL;
- virDomainXMLConfPtr xmlconf = NULL;
+ virDomainXMLOptionPtr xmlopt = NULL;
char *configFile = NULL;
if (VIR_ALLOC(ctrl) < 0)
if ((caps = lxcCapsInit(NULL)) == NULL)
goto error;
- if (!(xmlconf = lxcDomainXMLConfInit()))
+ if (!(xmlopt = lxcDomainXMLConfInit()))
goto error;
if ((configFile = virDomainConfigFile(LXC_STATE_DIR,
ctrl->name)) == NULL)
goto error;
- if ((ctrl->def = virDomainDefParseFile(caps, xmlconf,
+ if ((ctrl->def = virDomainDefParseFile(caps, xmlopt,
configFile,
1 << VIR_DOMAIN_VIRT_LXC,
0)) == NULL)
cleanup:
VIR_FREE(configFile);
virObjectUnref(caps);
- virObjectUnref(xmlconf);
+ virObjectUnref(xmlopt);
return ctrl;
no_memory:
virDomainDefPtr oldDef = NULL;
lxcDriverLock(driver);
- if (!(def = virDomainDefParseString(driver->caps, driver->xmlconf, xml,
+ if (!(def = virDomainDefParseString(driver->caps, driver->xmlopt, xml,
1 << VIR_DOMAIN_VIRT_LXC,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
}
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
0,
&oldDef)))
virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, NULL);
lxcDriverLock(driver);
- if (!(def = virDomainDefParseString(driver->caps, driver->xmlconf, xml,
+ if (!(def = virDomainDefParseString(driver->caps, driver->xmlopt, xml,
1 << VIR_DOMAIN_VIRT_LXC,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
if ((lxc_driver->caps = lxcCapsInit(lxc_driver)) == NULL)
goto cleanup;
- if (!(lxc_driver->xmlconf = lxcDomainXMLConfInit()))
+ if (!(lxc_driver->xmlopt = lxcDomainXMLConfInit()))
goto cleanup;
if (virLXCProcessAutoDestroyInit(lxc_driver) < 0)
/* Get all the running persistent or transient configs first */
if (virDomainObjListLoadAllConfigs(lxc_driver->domains,
lxc_driver->caps,
- lxc_driver->xmlconf,
+ lxc_driver->xmlopt,
lxc_driver->stateDir,
NULL,
1, 1 << VIR_DOMAIN_VIRT_LXC,
/* Then inactive persistent configs */
if (virDomainObjListLoadAllConfigs(lxc_driver->domains,
lxc_driver->caps,
- lxc_driver->xmlconf,
+ lxc_driver->xmlopt,
lxc_driver->configDir,
lxc_driver->autostartDir,
0, 1 << VIR_DOMAIN_VIRT_LXC,
lxcDriverLock(lxc_driver);
virDomainObjListLoadAllConfigs(lxc_driver->domains,
lxc_driver->caps,
- lxc_driver->xmlconf,
+ lxc_driver->xmlopt,
lxc_driver->configDir,
lxc_driver->autostartDir,
0, 1 << VIR_DOMAIN_VIRT_LXC,
virObjectUnref(lxc_driver->activeUsbHostdevs);
virObjectUnref(lxc_driver->caps);
virObjectUnref(lxc_driver->securityManager);
- virObjectUnref(lxc_driver->xmlconf);
+ virObjectUnref(lxc_driver->xmlopt);
VIR_FREE(lxc_driver->configDir);
VIR_FREE(lxc_driver->autostartDir);
VIR_FREE(lxc_driver->stateDir);
goto cleanup;
}
- if (virDomainLiveConfigHelperMethod(driver->caps, driver->xmlconf,
+ if (virDomainLiveConfigHelperMethod(driver->caps, driver->xmlopt,
vm, &flags, &vmdef) < 0)
goto cleanup;
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
/* Make a copy for updated domain. */
- vmdef = virDomainObjCopyPersistentDef(driver->caps, driver->xmlconf, vm);
+ vmdef = virDomainObjCopyPersistentDef(driver->caps, driver->xmlopt, vm);
if (!vmdef)
goto cleanup;
}
}
}
- if (virDomainSaveStatus(driver->xmlconf, driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, driver->stateDir, vm) < 0)
goto cleanup;
goto cleanup;
}
- if (virDomainLiveConfigHelperMethod(driver->caps, driver->xmlconf,
+ if (virDomainLiveConfigHelperMethod(driver->caps, driver->xmlopt,
vm, &flags, &persistentDef) < 0)
goto cleanup;
goto cleanup;
}
- if (virDomainLiveConfigHelperMethod(driver->caps, driver->xmlconf,
+ if (virDomainLiveConfigHelperMethod(driver->caps, driver->xmlopt,
vm, &flags, &persistentDef) < 0)
goto cleanup;
goto cleanup;
}
- if (virDomainLiveConfigHelperMethod(driver->caps, driver->xmlconf,
+ if (virDomainLiveConfigHelperMethod(driver->caps, driver->xmlopt,
vm, &flags, &persistentDef) < 0)
goto cleanup;
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
}
- if (virDomainSaveStatus(driver->xmlconf, driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, driver->stateDir, vm) < 0)
goto cleanup;
ret = 0;
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
}
- if (virDomainSaveStatus(driver->xmlconf, driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, driver->stateDir, vm) < 0)
goto cleanup;
ret = 0;
goto cleanup;
/* Make a copy for updated domain. */
- vmdef = virDomainObjCopyPersistentDef(driver->caps, driver->xmlconf, vm);
+ vmdef = virDomainObjCopyPersistentDef(driver->caps, driver->xmlopt, vm);
if (!vmdef)
goto cleanup;
switch (action) {
* changed even if we failed to attach the device. For example,
* a new controller may be created.
*/
- if (virDomainSaveStatus(driver->xmlconf, driver->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, driver->stateDir, vm) < 0) {
ret = -1;
goto cleanup;
}
}
virDomainAuditInit(vm, initpid, inode);
- if (virDomainSaveStatus(lxc_driver->xmlconf, lxc_driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(lxc_driver->xmlopt, lxc_driver->stateDir, vm) < 0)
VIR_WARN("Cannot update XML with PID for LXC %s", vm->def->name);
virObjectUnlock(vm);
* report implicit runtime defaults in the XML, like vnc listen/socket
*/
VIR_DEBUG("Setting current domain def as transient");
- if (virDomainObjSetDefTransient(driver->caps, driver->xmlconf, vm, true) < 0)
+ if (virDomainObjSetDefTransient(driver->caps, driver->xmlopt, vm, true) < 0)
goto cleanup;
/* Run an early hook to set-up missing devices */
virLXCProcessAutoDestroyAdd(driver, vm, conn) < 0)
goto error;
- if (virDomainObjSetDefTransient(driver->caps, driver->xmlconf,
+ if (virDomainObjSetDefTransient(driver->caps, driver->xmlopt,
vm, false) < 0)
goto error;
* location for the benefit of libvirt_lxc. We're now overwriting
* it with the live status XML instead. This is a (currently
* harmless) inconsistency we should fix one day */
- if (virDomainSaveStatus(driver->xmlconf, driver->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, driver->stateDir, vm) < 0)
goto error;
/* finally we can call the 'started' hook script if any */
if (!driver)
return;
- virObjectUnref(driver->xmlconf);
+ virObjectUnref(driver->xmlopt);
virObjectUnref(driver->domains);
virObjectUnref(driver->caps);
VIR_FREE(driver);
flags |= VIR_DOMAIN_OBJ_LIST_ADD_LIVE;
if (!(dom = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
flags,
NULL)))
virMutex lock;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
virDomainObjListPtr domains;
int version;
};
virDomainPtr dom = NULL;
openvzDriverLock(driver);
- if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlconf,
+ if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_OPENVZ,
VIR_DOMAIN_XML_INACTIVE)) == NULL)
goto cleanup;
goto cleanup;
}
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
vmdef, 0, NULL)))
goto cleanup;
vmdef = NULL;
virCheckFlags(0, NULL);
openvzDriverLock(driver);
- if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlconf,
+ if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_OPENVZ,
VIR_DOMAIN_XML_INACTIVE)) == NULL)
goto cleanup;
goto cleanup;
}
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
vmdef,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
if (!(driver->caps = openvzCapsInit()))
goto cleanup;
- if (!(driver->xmlconf = virDomainXMLConfNew(NULL, NULL)))
+ if (!(driver->xmlopt = virDomainXMLOptionNew(NULL, NULL)))
goto cleanup;
if (openvzLoadDomains(driver) < 0)
}
if (virDomainLiveConfigHelperMethod(driver->caps,
- driver->xmlconf,
+ driver->xmlopt,
vm,
&flags,
&vmdef) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
- privconn->xmlconf,
+ privconn->xmlopt,
def, 0, NULL)))
goto cleanup;
/* dom is locked here */
if (!(privconn->caps = parallelsBuildCapabilities()))
goto error;
- if (!(privconn->xmlconf = virDomainXMLConfNew(NULL, NULL)))
+ if (!(privconn->xmlopt = virDomainXMLOptionNew(NULL, NULL)))
goto error;
if (!(privconn->domains = virDomainObjListNew()))
parallelsDriverLock(privconn);
virObjectUnref(privconn->caps);
- virObjectUnref(privconn->xmlconf);
+ virObjectUnref(privconn->xmlopt);
virObjectUnref(privconn->domains);
conn->privateData = NULL;
virDomainObjPtr dom = NULL, olddom = NULL;
parallelsDriverLock(privconn);
- if ((def = virDomainDefParseString(privconn->caps, privconn->xmlconf,
+ if ((def = virDomainDefParseString(privconn->caps, privconn->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_PARALLELS,
VIR_DOMAIN_XML_INACTIVE)) == NULL) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
virObjectUnlock(olddom);
if (!(dom = virDomainObjListAdd(privconn->domains,
- privconn->xmlconf,
+ privconn->xmlopt,
def, 0, NULL))) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Can't allocate domobj"));
virStoragePoolObjList pools;
virNetworkObjList networks;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
virDomainEventStatePtr domainEventState;
};
goto failure;
}
- if (!(phyp_driver->xmlconf = virDomainXMLConfNew(NULL, NULL)))
+ if (!(phyp_driver->xmlopt = virDomainXMLOptionNew(NULL, NULL)))
goto failure;
conn->privateData = phyp_driver;
libssh2_session_free(session);
virObjectUnref(phyp_driver->caps);
- virObjectUnref(phyp_driver->xmlconf);
+ virObjectUnref(phyp_driver->xmlopt);
phypUUIDTable_Free(phyp_driver->uuid_table);
VIR_FREE(phyp_driver->managed_system);
VIR_FREE(phyp_driver);
virCheckFlags(0, NULL);
- if (!(def = virDomainDefParseString(phyp_driver->caps, phyp_driver->xmlconf,
+ if (!(def = virDomainDefParseString(phyp_driver->caps, phyp_driver->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_PHYP,
VIR_DOMAIN_XML_SECURE)))
goto err;
struct _phyp_driver {
uuid_tablePtr uuid_table;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
int vios_id;
/* system_type:
* as is practical. This is not an exact science....
*/
virDomainDefPtr qemuParseCommandLine(virCapsPtr qemuCaps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char **progenv,
const char **progargv,
char **pidfile,
goto error;
if (cmd->num_args || cmd->num_env) {
- def->ns = *virDomainXMLConfGetNamespace(xmlconf);
+ def->ns = *virDomainXMLOptionGetNamespace(xmlopt);
def->namespaceData = cmd;
}
else
virDomainDefPtr qemuParseCommandLineString(virCapsPtr qemuCaps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *args,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
if (qemuStringToArgvEnv(args, &progenv, &progargv) < 0)
goto cleanup;
- def = qemuParseCommandLine(qemuCaps, xmlconf, progenv, progargv,
+ def = qemuParseCommandLine(qemuCaps, xmlopt, progenv, progargv,
pidfile, monConfig, monJSON);
cleanup:
}
virDomainDefPtr qemuParseCommandLinePid(virCapsPtr qemuCaps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
pid_t pid,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
qemuParseProcFileStrings(pid, "environ", &progenv) < 0)
goto cleanup;
- if (!(def = qemuParseCommandLine(qemuCaps, xmlconf, progenv, progargv,
+ if (!(def = qemuParseCommandLine(qemuCaps, xmlopt, progenv, progargv,
pidfile, monConfig, monJSON)))
goto cleanup;
* *must* decide how to fill in a name in this case
*/
virDomainDefPtr qemuParseCommandLine(virCapsPtr qemuCaps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char **progenv,
const char **progargv,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
bool *monJSON);
virDomainDefPtr qemuParseCommandLineString(virCapsPtr qemuCaps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
const char *args,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
bool *monJSON);
virDomainDefPtr qemuParseCommandLinePid(virCapsPtr qemuCaps,
- virDomainXMLConfPtr xmlconf,
+ virDomainXMLOptionPtr xmlopt,
pid_t pid,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
return conf;
}
-virDomainXMLConfPtr
+virDomainXMLOptionPtr
virQEMUDriverCreateXMLConf(void)
{
- return virDomainXMLConfNew(&virQEMUDriverPrivateDataCallbacks,
+ return virDomainXMLOptionNew(&virQEMUDriverPrivateDataCallbacks,
&virQEMUDriverDomainXMLNamespace);
}
virCapsPtr caps;
/* Immutable pointer, Immutable object */
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
/* Immutable pointer, self-locking APIs */
virQEMUCapsCachePtr qemuCapsCache;
ATTRIBUTE_NONNULL(1);
int qemuDriverAllocateID(virQEMUDriverPtr driver);
-virDomainXMLConfPtr virQEMUDriverCreateXMLConf(void);
+virDomainXMLOptionPtr virQEMUDriverCreateXMLConf(void);
#endif /* __QEMUD_CONF_H */
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
if (virDomainObjIsActive(obj)) {
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, obj) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, obj) < 0)
VIR_WARN("Failed to save status on vm %s", obj->def->name);
}
priv->fakeReboot = value;
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
VIR_WARN("Failed to save status on vm %s", vm->def->name);
cleanup:
}
def = virDomainSnapshotDefParseString(xmlStr, caps,
- qemu_driver->xmlconf,
+ qemu_driver->xmlopt,
QEMU_EXPECTED_VIRT_TYPES,
flags);
if (def == NULL) {
if ((qemu_driver->caps = virQEMUDriverCreateCapabilities(qemu_driver)) == NULL)
goto error;
- if (!(qemu_driver->xmlconf = virQEMUDriverCreateXMLConf()))
+ if (!(qemu_driver->xmlopt = virQEMUDriverCreateXMLConf()))
goto error;
/* If hugetlbfs is present, then we need to create a sub-directory within
/* Get all the running persistent or transient configs first */
if (virDomainObjListLoadAllConfigs(qemu_driver->domains,
qemu_driver->caps,
- qemu_driver->xmlconf,
+ qemu_driver->xmlopt,
cfg->stateDir,
NULL,
1, QEMU_EXPECTED_VIRT_TYPES,
/* Then inactive persistent configs */
if (virDomainObjListLoadAllConfigs(qemu_driver->domains,
qemu_driver->caps,
- qemu_driver->xmlconf,
+ qemu_driver->xmlopt,
cfg->configDir,
cfg->autostartDir,
0, QEMU_EXPECTED_VIRT_TYPES,
cfg = virQEMUDriverGetConfig(qemu_driver);
virDomainObjListLoadAllConfigs(qemu_driver->domains,
caps,
- qemu_driver->xmlconf,
+ qemu_driver->xmlopt,
cfg->configDir,
cfg->autostartDir,
0, QEMU_EXPECTED_VIRT_TYPES,
virObjectUnref(qemu_driver->domains);
virObjectUnref(qemu_driver->remotePorts);
- virObjectUnref(qemu_driver->xmlconf);
+ virObjectUnref(qemu_driver->xmlopt);
virSysinfoDefFree(qemu_driver->hostsysinfo);
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (!(def = virDomainDefParseString(caps, driver->xmlconf, xml,
+ if (!(def = virDomainDefParseString(caps, driver->xmlopt, xml,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
eventDetail);
}
}
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
goto endjob;
ret = 0;
}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto endjob;
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
goto endjob;
ret = 0;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto endjob;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto endjob;
if (xmlin) {
virDomainDefPtr def = NULL;
- if (!(def = virDomainDefParseString(caps, driver->xmlconf, xmlin,
+ if (!(def = virDomainDefParseString(caps, driver->xmlopt, xmlin,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE))) {
goto endjob;
maximum = (flags & VIR_DOMAIN_VCPU_MAXIMUM) != 0;
flags &= ~VIR_DOMAIN_VCPU_MAXIMUM;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto endjob;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
if (newVcpuPin)
virDomainVcpuPinDefArrayFree(newVcpuPin, newVcpuPinNum);
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
goto cleanup;
}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&targetDef) < 0)
goto cleanup;
goto cleanup;
}
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
goto cleanup;
}
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
goto cleanup;
}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt,
vm, &flags, &targetDef) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt,
vm, &flags, &def) < 0)
goto cleanup;
header.was_running = state;
/* Create a domain from this XML */
- if (!(def = virDomainDefParseString(caps, driver->xmlconf, xml,
+ if (!(def = virDomainDefParseString(caps, driver->xmlopt, xml,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE)))
goto error;
if (xmlin) {
virDomainDefPtr def2 = NULL;
- if (!(def2 = virDomainDefParseString(caps, driver->xmlconf, xmlin,
+ if (!(def2 = virDomainDefParseString(caps, driver->xmlopt, xmlin,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE)))
goto error;
"%s", _("failed to resume domain"));
goto cleanup;
}
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Failed to save status on vm %s", vm->def->name);
goto cleanup;
}
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- def = qemuParseCommandLineString(caps, driver->xmlconf, config,
+ def = qemuParseCommandLineString(caps, driver->xmlopt, config,
NULL, NULL, NULL);
if (!def)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- def = virDomainDefParseString(caps, driver->xmlconf, xmlData,
+ def = virDomainDefParseString(caps, driver->xmlopt, xmlData,
QEMU_EXPECTED_VIRT_TYPES, 0);
if (!def)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (!(def = virDomainDefParseString(caps, driver->xmlconf, xml,
+ if (!(def = virDomainDefParseString(caps, driver->xmlopt, xml,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
0,
&oldDef)))
goto endjob;
/* Make a copy for updated domain. */
- vmdef = virDomainObjCopyPersistentDef(caps, driver->xmlconf, vm);
+ vmdef = virDomainObjCopyPersistentDef(caps, driver->xmlopt, vm);
if (!vmdef)
goto endjob;
switch (action) {
* changed even if we failed to attach the device. For example,
* a new controller may be created.
*/
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
ret = -1;
goto endjob;
}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
goto cleanup;
}
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&vmdef) < 0)
goto cleanup;
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
/* Make a copy for updated domain. */
- vmdef = virDomainObjCopyPersistentDef(caps, driver->xmlconf, vm);
+ vmdef = virDomainObjCopyPersistentDef(caps, driver->xmlopt, vm);
if (!vmdef)
goto cleanup;
}
}
}
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
virCgroupFree(&cgroup);
if (ret == 0 || !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION)) {
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0 ||
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0 ||
(persist && virDomainSaveConfig(cfg->configDir, vm->newDef) < 0))
ret = -1;
}
!virDomainObjIsActive(vm))
parse_flags |= VIR_DOMAIN_SNAPSHOT_PARSE_OFFLINE;
- if (!(def = virDomainSnapshotDefParseString(xmlDesc, caps, driver->xmlconf,
+ if (!(def = virDomainSnapshotDefParseString(xmlDesc, caps, driver->xmlopt,
QEMU_EXPECTED_VIRT_TYPES,
parse_flags)))
goto cleanup;
/* Easiest way to clone inactive portion of vm->def is via
* conversion in and back out of xml. */
if (!(xml = qemuDomainDefFormatLive(driver, vm->def, true, true)) ||
- !(def->dom = virDomainDefParseString(caps, driver->xmlconf, xml,
+ !(def->dom = virDomainDefParseString(caps, driver->xmlopt, xml,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
* than inactive xml? */
snap->def->current = true;
if (snap->def->dom) {
- config = virDomainDefCopy(caps, driver->xmlconf, snap->def->dom, true);
+ config = virDomainDefCopy(caps, driver->xmlopt, snap->def->dom, true);
if (!config)
goto cleanup;
}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (!(def = qemuParseCommandLinePid(caps, driver->xmlconf, pid,
+ if (!(def = qemuParseCommandLinePid(caps, driver->xmlopt, pid,
&pidfile, &monConfig, &monJSON)))
goto cleanup;
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto endjob;
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto endjob;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags,
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags,
&persistentDef) < 0)
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (virDomainLiveConfigHelperMethod(caps, driver->xmlconf, vm, &flags, &def) < 0)
+ if (virDomainLiveConfigHelperMethod(caps, driver->xmlopt, vm, &flags, &def) < 0)
goto cleanup;
/* use correct domain definition according to flags */
n);
goto error;
}
- mig->persistent = virDomainDefParseNode(caps, driver->xmlconf,
+ mig->persistent = virDomainDefParseNode(caps, driver->xmlopt,
doc, nodes[0],
-1, VIR_DOMAIN_XML_INACTIVE);
if (!mig->persistent) {
}
if (xmlin) {
- if (!(def = virDomainDefParseString(caps, driver->xmlconf, xmlin,
+ if (!(def = virDomainDefParseString(caps, driver->xmlopt, xmlin,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
- if (!(def = virDomainDefParseString(caps, driver->xmlconf, dom_xml,
+ if (!(def = virDomainDefParseString(caps, driver->xmlopt, dom_xml,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
virDomainDefPtr newdef;
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
- newdef = virDomainDefParseString(caps, driver->xmlconf, xmlout,
+ newdef = virDomainDefParseString(caps, driver->xmlopt, xmlout,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE);
if (!newdef)
}
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
if (mig->persistent)
vm->newDef = vmdef = mig->persistent;
else
- vmdef = virDomainObjGetPersistentDef(caps, driver->xmlconf, vm);
+ vmdef = virDomainObjGetPersistentDef(caps, driver->xmlopt, vm);
if (!vmdef || virDomainSaveConfig(cfg->configDir, vmdef) < 0) {
/* Hmpf. Migration was successful, but making it persistent
* was not. If we report successful, then when this domain
}
if (virDomainObjIsActive(vm) &&
- virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Failed to save status on vm %s", vm->def->name);
goto endjob;
}
event = virDomainEventNewFromObj(vm,
VIR_DOMAIN_EVENT_RESUMED,
VIR_DOMAIN_EVENT_RESUMED_MIGRATED);
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Failed to save status on vm %s", vm->def->name);
goto cleanup;
}
VIR_DOMAIN_EVENT_SHUTDOWN,
VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED);
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Unable to save status on vm %s after state change",
vm->def->name);
}
VIR_WARN("Unable to release lease on %s", vm->def->name);
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Unable to save status on vm %s after state change",
vm->def->name);
}
}
VIR_FREE(priv->lockState);
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Unable to save status on vm %s after state change",
vm->def->name);
}
if (vm->def->clock.offset == VIR_DOMAIN_CLOCK_OFFSET_VARIABLE)
vm->def->clock.data.variable.adjustment = offset;
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
VIR_WARN("unable to save domain status with RTC change");
virObjectUnlock(vm);
VIR_WARN("Unable to release lease on %s", vm->def->name);
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Unable to save status on vm %s after watchdog event",
vm->def->name);
}
VIR_WARN("Unable to release lease on %s", vm->def->name);
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
VIR_WARN("Unable to save status on vm %s after IO error", vm->def->name);
}
virObjectUnlock(vm);
else if (reason == VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE)
disk->tray_status = VIR_DOMAIN_DISK_TRAY_CLOSED;
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Unable to save status on vm %s after tray moved event",
vm->def->name);
}
VIR_DOMAIN_EVENT_STARTED,
VIR_DOMAIN_EVENT_STARTED_WAKEUP);
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Unable to save status on vm %s after wakeup event",
vm->def->name);
}
VIR_DOMAIN_EVENT_PMSUSPENDED,
VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY);
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Unable to save status on vm %s after suspend event",
vm->def->name);
}
vm->def->mem.cur_balloon, actual);
vm->def->mem.cur_balloon = actual;
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
VIR_WARN("unable to save domain status with balloon change");
virObjectUnlock(vm);
VIR_DOMAIN_EVENT_PMSUSPENDED,
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK);
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
VIR_WARN("Unable to save status on vm %s after suspend event",
vm->def->name);
}
goto error;
/* update domain state XML with possibly updated state in virDomainObj */
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, obj) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, obj) < 0)
goto error;
/* Run an hook to allow admins to do some magic */
* report implicit runtime defaults in the XML, like vnc listen/socket
*/
VIR_DEBUG("Setting current domain def as transient");
- if (virDomainObjSetDefTransient(caps, driver->xmlconf, vm, true) < 0)
+ if (virDomainObjSetDefTransient(caps, driver->xmlopt, vm, true) < 0)
goto cleanup;
vm->def->id = qemuDriverAllocateID(driver);
}
VIR_DEBUG("Writing early domain status to disk");
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0) {
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
goto cleanup;
}
goto cleanup;
VIR_DEBUG("Writing domain status to disk");
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
goto cleanup;
/* finally we can call the 'started' hook script if any */
* report implicit runtime defaults in the XML, like vnc listen/socket
*/
VIR_DEBUG("Setting current domain def as transient");
- if (virDomainObjSetDefTransient(caps, driver->xmlconf, vm, true) < 0)
+ if (virDomainObjSetDefTransient(caps, driver->xmlopt, vm, true) < 0)
goto cleanup;
vm->def->id = qemuDriverAllocateID(driver);
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, reason);
VIR_DEBUG("Writing domain status to disk");
- if (virDomainSaveStatus(driver->xmlconf, cfg->stateDir, vm) < 0)
+ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
goto cleanup;
/* Run an hook to allow admins to do some magic */
char *files; /* list of files */
virDomainDefPtr def; /* VM definition */
virCapsPtr caps; /* VM capabilities */
- virDomainXMLConfPtr xmlconf;/* XML parser data */
+ virDomainXMLOptionPtr xmlopt;/* XML parser data */
char *hvm; /* type of hypervisor (eg hvm, xen) */
virArch arch; /* machine architecture */
char *newfile; /* newly added file */
VIR_FREE(ctl->def);
virObjectUnref(ctl->caps);
- virObjectUnref(ctl->xmlconf);
+ virObjectUnref(ctl->xmlopt);
VIR_FREE(ctl->files);
VIR_FREE(ctl->hvm);
VIR_FREE(ctl->newfile);
goto exit;
}
- if (!(ctl->xmlconf = virDomainXMLConfNew(NULL, NULL))) {
+ if (!(ctl->xmlopt = virDomainXMLOptionNew(NULL, NULL))) {
vah_error(ctl, 0, _("Failed to create XML config object"));
goto exit;
}
goto exit;
}
- ctl->def = virDomainDefParseString(ctl->caps, ctl->xmlconf,
+ ctl->def = virDomainDefParseString(ctl->caps, ctl->xmlopt,
xmlStr, -1,
VIR_DOMAIN_XML_INACTIVE);
if (ctl->def == NULL) {
char *path;
int nextDomID;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
virNodeInfo nodeInfo;
virDomainObjListPtr domains;
virNetworkObjList networks;
}
-static virDomainXMLConfPtr
+static virDomainXMLOptionPtr
testBuildXMLConfig(void)
{
virDomainXMLPrivateDataCallbacks priv = { .alloc = testDomainObjPrivateAlloc,
.free = testDomainObjPrivateFree };
- return virDomainXMLConfNew(&priv, NULL);
+ return virDomainXMLOptionNew(&priv, NULL);
}
dom->def->id = privconn->nextDomID++;
if (virDomainObjSetDefTransient(privconn->caps,
- privconn->xmlconf,
+ privconn->xmlopt,
dom, false) < 0) {
goto cleanup;
}
if (!(privconn->caps = testBuildCapabilities(conn)))
goto error;
- if (!(privconn->xmlconf = testBuildXMLConfig()))
+ if (!(privconn->xmlopt = testBuildXMLConfig()))
goto error;
privconn->nextDomID = 1;
if (!(domdef = virDomainDefParseString(privconn->caps,
- privconn->xmlconf,
+ privconn->xmlopt,
defaultDomainXML,
1 << VIR_DOMAIN_VIRT_TEST,
VIR_DOMAIN_XML_INACTIVE)))
if (testDomainGenerateIfnames(domdef) < 0)
goto error;
if (!(domobj = virDomainObjListAdd(privconn->domains,
- privconn->xmlconf,
+ privconn->xmlopt,
domdef, 0, NULL)))
goto error;
domdef = NULL;
if (!(privconn->caps = testBuildCapabilities(conn)))
goto error;
- if (!(privconn->xmlconf = testBuildXMLConfig()))
+ if (!(privconn->xmlopt = testBuildXMLConfig()))
goto error;
if (!(xml = virXMLParseFileCtxt(file, &ctxt))) {
goto error;
}
def = virDomainDefParseFile(privconn->caps,
- privconn->xmlconf, absFile,
+ privconn->xmlopt, absFile,
1 << VIR_DOMAIN_VIRT_TEST,
VIR_DOMAIN_XML_INACTIVE);
VIR_FREE(absFile);
if (!def)
goto error;
} else {
- if ((def = virDomainDefParseNode(privconn->caps, privconn->xmlconf,
+ if ((def = virDomainDefParseNode(privconn->caps, privconn->xmlopt,
xml, domains[i],
1 << VIR_DOMAIN_VIRT_TEST,
VIR_DOMAIN_XML_INACTIVE)) == NULL)
if (testDomainGenerateIfnames(def) < 0 ||
!(dom = virDomainObjListAdd(privconn->domains,
- privconn->xmlconf,
+ privconn->xmlopt,
def, 0, NULL))) {
virDomainDefFree(def);
goto error;
testConnPtr privconn = conn->privateData;
testDriverLock(privconn);
virObjectUnref(privconn->caps);
- virObjectUnref(privconn->xmlconf);
+ virObjectUnref(privconn->xmlopt);
virObjectUnref(privconn->domains);
virNodeDeviceObjListFree(&privconn->devs);
virNetworkObjListFree(&privconn->networks);
virCheckFlags(0, NULL);
testDriverLock(privconn);
- if ((def = virDomainDefParseString(privconn->caps, privconn->xmlconf,
+ if ((def = virDomainDefParseString(privconn->caps, privconn->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_TEST,
VIR_DOMAIN_XML_INACTIVE)) == NULL)
goto cleanup;
if (testDomainGenerateIfnames(def) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
- privconn->xmlconf,
+ privconn->xmlopt,
def,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
}
xml[len] = '\0';
- def = virDomainDefParseString(privconn->caps, privconn->xmlconf,
+ def = virDomainDefParseString(privconn->caps, privconn->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_TEST,
VIR_DOMAIN_XML_INACTIVE);
if (!def)
if (testDomainGenerateIfnames(def) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
- privconn->xmlconf,
+ privconn->xmlopt,
def,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
goto cleanup;
}
- if (virDomainLiveConfigHelperMethod(privconn->caps, privconn->xmlconf,
+ if (virDomainLiveConfigHelperMethod(privconn->caps, privconn->xmlopt,
vm, &flags, &def) < 0)
goto cleanup;
}
if (!(persistentDef = virDomainObjGetPersistentDef(privconn->caps,
- privconn->xmlconf,
+ privconn->xmlopt,
privdom)))
goto cleanup;
virDomainDefPtr oldDef = NULL;
testDriverLock(privconn);
- if ((def = virDomainDefParseString(privconn->caps, privconn->xmlconf,
+ if ((def = virDomainDefParseString(privconn->caps, privconn->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_TEST,
VIR_DOMAIN_XML_INACTIVE)) == NULL)
goto cleanup;
if (testDomainGenerateIfnames(def) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
- privconn->xmlconf,
+ privconn->xmlopt,
def,
0,
&oldDef)))
int inotifyWatch;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
/* Event handling */
virDomainEventStatePtr domainEventState;
if ((uml_driver->caps = umlCapsInit()) == NULL)
goto out_of_memory;
- if (!(uml_driver->xmlconf = virDomainXMLConfNew(&privcb,
+ if (!(uml_driver->xmlopt = virDomainXMLOptionNew(&privcb,
NULL)))
goto error;
if (virDomainObjListLoadAllConfigs(uml_driver->domains,
uml_driver->caps,
- uml_driver->xmlconf,
+ uml_driver->xmlopt,
uml_driver->configDir,
uml_driver->autostartDir,
0, 1 << VIR_DOMAIN_VIRT_UML,
umlDriverLock(uml_driver);
virDomainObjListLoadAllConfigs(uml_driver->domains,
uml_driver->caps,
- uml_driver->xmlconf,
+ uml_driver->xmlopt,
uml_driver->configDir,
uml_driver->autostartDir,
0, 1 << VIR_DOMAIN_VIRT_UML,
virEventRemoveHandle(uml_driver->inotifyWatch);
VIR_FORCE_CLOSE(uml_driver->inotifyFD);
virObjectUnref(uml_driver->caps);
- virObjectUnref(uml_driver->xmlconf);
+ virObjectUnref(uml_driver->xmlopt);
/* shutdown active VMs
* XXX allow them to stay around & reconnect */
* report implicit runtime defaults in the XML, like vnc listen/socket
*/
VIR_DEBUG("Setting current domain def as transient");
- if (virDomainObjSetDefTransient(driver->caps, driver->xmlconf,
+ if (virDomainObjSetDefTransient(driver->caps, driver->xmlopt,
vm, true) < 0) {
VIR_FORCE_CLOSE(logfd);
return -1;
(ret = umlProcessAutoDestroyAdd(driver, vm, conn)) < 0)
goto cleanup;
- ret = virDomainObjSetDefTransient(driver->caps, driver->xmlconf, vm, false);
+ ret = virDomainObjSetDefTransient(driver->caps, driver->xmlopt, vm, false);
cleanup:
VIR_FORCE_CLOSE(logfd);
virCommandFree(cmd);
virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, NULL);
umlDriverLock(driver);
- if (!(def = virDomainDefParseString(driver->caps, driver->xmlconf,
+ if (!(def = virDomainDefParseString(driver->caps, driver->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_UML,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
virDomainPtr dom = NULL;
umlDriverLock(driver);
- if (!(def = virDomainDefParseString(driver->caps, driver->xmlconf,
+ if (!(def = virDomainDefParseString(driver->caps, driver->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_UML,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
def,
0, NULL)))
goto cleanup;
unsigned long version;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
IVirtualBox *vboxObj;
ISession *vboxSession;
}
-static virDomainXMLConfPtr
+static virDomainXMLOptionPtr
vboxXMLConfInit(void)
{
- return virDomainXMLConfNew(NULL, NULL);
+ return virDomainXMLOptionNew(NULL, NULL);
}
data->pFuncs->pfnComUninitialize();
virObjectUnref(data->caps);
- virObjectUnref(data->xmlconf);
+ virObjectUnref(data->xmlopt);
#if VBOX_API_VERSION == 2002
/* No domainEventCallbacks in 2.2.* version */
#else /* !(VBOX_API_VERSION == 2002) */
if (!(data->caps = vboxCapsInit()) ||
vboxInitialize(data) < 0 ||
vboxExtractVersion(data) < 0 ||
- !(data->xmlconf = vboxXMLConfInit())) {
+ !(data->xmlopt = vboxXMLConfInit())) {
vboxUninitialize(data);
return VIR_DRV_OPEN_ERROR;
}
#endif
nsresult rc;
- if (!(def = virDomainDefParseString(data->caps, data->xmlconf,
+ if (!(def = virDomainDefParseString(data->caps, data->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_VBOX,
VIR_DOMAIN_XML_INACTIVE))) {
goto cleanup;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA, NULL);
if (!(def = virDomainSnapshotDefParseString(xmlDesc, data->caps,
- data->xmlconf, 0, 0)))
+ data->xmlopt, 0, 0)))
goto cleanup;
if (def->ndisks) {
virMutexDestroy(&driver->lock);
virObjectUnref(driver->domains);
virObjectUnref(driver->caps);
- virObjectUnref(driver->xmlconf);
+ virObjectUnref(driver->xmlopt);
VIR_FREE(driver);
}
}
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
vmdef, 0, NULL)))
goto cleanup;
struct vmware_driver {
virMutex lock;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
virDomainObjListPtr domains;
int version;
VIR_FREE(dom);
}
-static virDomainXMLConfPtr
+static virDomainXMLOptionPtr
vmwareDomainXMLConfigInit(void)
{
virDomainXMLPrivateDataCallbacks priv = { .alloc = vmwareDataAllocFunc,
.free = vmwareDataFreeFunc };
- return virDomainXMLConfNew(&priv, NULL);
+ return virDomainXMLOptionNew(&priv, NULL);
}
static virDrvOpenStatus
if (!(driver->caps = vmwareCapsInit()))
goto cleanup;
- if (!(driver->xmlconf = vmwareDomainXMLConfigInit()))
+ if (!(driver->xmlopt = vmwareDomainXMLConfigInit()))
goto cleanup;
if (vmwareLoadDomains(driver) < 0)
ctx.formatFileName = vmwareCopyVMXFileName;
vmwareDriverLock(driver);
- if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlconf,
+ if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_VMWARE,
VIR_DOMAIN_XML_INACTIVE)) == NULL)
goto cleanup;
/* assign def */
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
vmdef,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
vmwareDriverLock(driver);
- if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlconf,
+ if ((vmdef = virDomainDefParseString(driver->caps, driver->xmlopt,
xml, 1 << VIR_DOMAIN_VIRT_VMWARE,
VIR_DOMAIN_XML_INACTIVE)) == NULL)
goto cleanup;
/* assign def */
if (!(vm = virDomainObjListAdd(driver->domains,
- driver->xmlconf,
+ driver->xmlopt,
vmdef,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto fail;
}
- if (!(priv->xmlconf = virDomainXMLConfNew(NULL, NULL)))
+ if (!(priv->xmlopt = virDomainXMLOptionNew(NULL, NULL)))
goto fail;
#if WITH_XEN_INOTIFY
int i;
virObjectUnref(priv->caps);
- virObjectUnref(priv->xmlconf);
+ virObjectUnref(priv->xmlopt);
virDomainEventStateFree(priv->domainEvents);
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
goto cleanup;
}
- if (!(def = virDomainDefParseString(priv->caps, priv->xmlconf,
+ if (!(def = virDomainDefParseString(priv->caps, priv->xmlopt,
xmlData, 1 << VIR_DOMAIN_VIRT_XEN, 0)))
goto cleanup;
* holding the lock
*/
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
int handle; /* Xen hypervisor handle */
int xendConfigVersion; /* XenD config version */
virCheckFlags(0, NULL);
- if (!(def = virDomainDefParseString(priv->caps, priv->xmlconf,
+ if (!(def = virDomainDefParseString(priv->caps, priv->xmlopt,
xmlDesc, 1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE)))
return NULL;
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
return NULL;
- if (!(def = virDomainDefParseString(priv->caps, priv->xmlconf,
+ if (!(def = virDomainDefParseString(priv->caps, priv->xmlopt,
xmlDesc, 1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE))) {
virReportError(VIR_ERR_XML_ERROR,
return NULL;
}
- if (!(def = virDomainDefParseString(priv->caps, priv->xmlconf, xml,
+ if (!(def = virDomainDefParseString(priv->caps, priv->xmlopt, xml,
1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE))) {
xenUnifiedUnlock(priv);
goto error;
}
- if (!(privP->xmlconf = virDomainXMLConfNew(NULL, NULL))) {
+ if (!(privP->xmlopt = virDomainXMLOptionNew(NULL, NULL))) {
xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
_("Failed to create XML conf object"));
goto error;
if (privP != NULL) {
virObjectUnref(privP->caps);
- virObjectUnref(privP->xmlconf);
+ virObjectUnref(privP->xmlopt);
if (privP->session != NULL)
xenSessionFree(privP->session);
struct _xenapiPrivate *priv = conn->privateData;
virObjectUnref(priv->caps);
- virObjectUnref(priv->xmlconf);
+ virObjectUnref(priv->xmlopt);
if (priv->session != NULL) {
xen_session_logout(priv->session);
virCheckFlags(0, NULL);
- virDomainDefPtr defPtr = virDomainDefParseString(priv->caps, priv->xmlconf,
+ virDomainDefPtr defPtr = virDomainDefParseString(priv->caps, priv->xmlopt,
xmlDesc,
1 << VIR_DOMAIN_VIRT_XEN,
flags);
virDomainPtr domP=NULL;
if (!priv->caps)
return NULL;
- virDomainDefPtr defPtr = virDomainDefParseString(priv->caps, priv->xmlconf,
+ virDomainDefPtr defPtr = virDomainDefParseString(priv->caps, priv->xmlopt,
xml,
1 << VIR_DOMAIN_VIRT_XEN,
0);
char *url;
int noVerify;
virCapsPtr caps;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
};
#endif /* __VIR_XENAPI_H__ */
if (internal)
flags |= VIR_DOMAIN_SNAPSHOT_PARSE_INTERNAL;
if (!(def = virDomainSnapshotDefParseString(inXmlData, driver.caps,
- driver.xmlconf,
+ driver.xmlopt,
QEMU_EXPECTED_VIRT_TYPES,
flags)))
goto fail;
if ((driver.caps = testQemuCapsInit()) == NULL)
return EXIT_FAILURE;
- if (!(driver.xmlconf = virQEMUDriverCreateXMLConf()))
+ if (!(driver.xmlopt = virQEMUDriverCreateXMLConf()))
return EXIT_FAILURE;
# define DO_TEST(name, uuid, internal) \
DO_TEST("external_vm", "c7a5fdbd-edaf-9455-926a-d65c16db1809", 0);
virObjectUnref(driver.caps);
- virObjectUnref(driver.xmlconf);
+ virObjectUnref(driver.xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
# include "testutilslxc.h"
static virCapsPtr caps;
-static virDomainXMLConfPtr xmlconf;
+static virDomainXMLOptionPtr xmlopt;
static int
testCompareXMLToXMLFiles(const char *inxml, const char *outxml, bool live)
if (virtTestLoadFile(outxml, &outXmlData) < 0)
goto fail;
- if (!(def = virDomainDefParseString(caps, xmlconf, inXmlData,
+ if (!(def = virDomainDefParseString(caps, xmlopt, inXmlData,
1 << VIR_DOMAIN_VIRT_LXC,
live ? 0 : VIR_DOMAIN_XML_INACTIVE)))
goto fail;
if ((caps = testLXCCapsInit()) == NULL)
return EXIT_FAILURE;
- if (!(xmlconf = lxcDomainXMLConfInit()))
+ if (!(xmlopt = lxcDomainXMLConfInit()))
return EXIT_FAILURE;
# define DO_TEST_FULL(name, is_different, inactive) \
DO_TEST("hostdev");
virObjectUnref(caps);
- virObjectUnref(xmlconf);
+ virObjectUnref(xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
if (virtTestLoadFile(xml, &expectxml) < 0)
goto fail;
- if (!(vmdef = qemuParseCommandLineString(driver.caps, driver.xmlconf,
+ if (!(vmdef = qemuParseCommandLineString(driver.caps, driver.xmlopt,
cmd, NULL, NULL, NULL)))
goto fail;
if ((driver.caps = testQemuCapsInit()) == NULL)
return EXIT_FAILURE;
- if (!(driver.xmlconf = virQEMUDriverCreateXMLConf()))
+ if (!(driver.xmlopt = virQEMUDriverCreateXMLConf()))
return EXIT_FAILURE;
# define DO_TEST_FULL(name, extraFlags, migrateFrom) \
virObjectUnref(driver.config);
virObjectUnref(driver.caps);
- virObjectUnref(driver.xmlconf);
+ virObjectUnref(driver.xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
static int
testQemuMonitorJSONGetStatus(const void *data)
{
- virDomainXMLConfPtr xmlconf = (virDomainXMLConfPtr)data;
- qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlconf);
+ virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
+ qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlopt);
int ret = -1;
bool running = false;
virDomainPausedReason reason = 0;
static int
testQemuMonitorJSONGetVersion(const void *data)
{
- virDomainXMLConfPtr xmlconf = (virDomainXMLConfPtr)data;
- qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlconf);
+ virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
+ qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlopt);
int ret = -1;
int major;
int minor;
static int
testQemuMonitorJSONGetMachines(const void *data)
{
- virDomainXMLConfPtr xmlconf = (virDomainXMLConfPtr)data;
- qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlconf);
+ virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
+ qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlopt);
int ret = -1;
qemuMonitorMachineInfoPtr *info;
int ninfo = 0;
static int
testQemuMonitorJSONGetCPUDefinitions(const void *data)
{
- virDomainXMLConfPtr xmlconf = (virDomainXMLConfPtr)data;
- qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlconf);
+ virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
+ qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlopt);
int ret = -1;
char **cpus = NULL;
int ncpus = 0;
static int
testQemuMonitorJSONGetCommands(const void *data)
{
- virDomainXMLConfPtr xmlconf = (virDomainXMLConfPtr)data;
- qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlconf);
+ virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
+ qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlopt);
int ret = -1;
char **commands = NULL;
int ncommands = 0;
mymain(void)
{
int ret = 0;
- virDomainXMLConfPtr xmlconf;
+ virDomainXMLOptionPtr xmlopt;
#if !WITH_YAJL
fputs("libvirt not compiled with yajl, skipping this test\n", stderr);
#endif
if (virThreadInitialize() < 0 ||
- !(xmlconf = virQEMUDriverCreateXMLConf()))
+ !(xmlopt = virQEMUDriverCreateXMLConf()))
return EXIT_FAILURE;
virEventRegisterDefaultImpl();
#define DO_TEST(name) \
- if (virtTestRun(# name, 1, testQemuMonitorJSON ## name, xmlconf) < 0) \
+ if (virtTestRun(# name, 1, testQemuMonitorJSON ## name, xmlopt) < 0) \
ret = -1
DO_TEST(GetStatus);
DO_TEST(GetCPUDefinitions);
DO_TEST(GetCommands);
- virObjectUnref(xmlconf);
+ virObjectUnref(xmlopt);
return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
#define QEMU_TEXT_GREETING "QEMU 1.0,1 monitor - type 'help' for more information"
-qemuMonitorTestPtr qemuMonitorTestNew(bool json, virDomainXMLConfPtr xmlconf)
+qemuMonitorTestPtr qemuMonitorTestNew(bool json, virDomainXMLOptionPtr xmlopt)
{
qemuMonitorTestPtr test = NULL;
virDomainChrSourceDef src;
goto no_memory;
test->json = json;
- if (!(test->vm = virDomainObjNew(xmlconf)))
+ if (!(test->vm = virDomainObjNew(xmlopt)))
goto error;
if (virNetSocketNewListenUNIX(path,
const char *response);
qemuMonitorTestPtr qemuMonitorTestNew(bool json,
- virDomainXMLConfPtr xmlconf);
+ virDomainXMLOptionPtr xmlopt);
void qemuMonitorTestFree(qemuMonitorTestPtr test);
goto out;
conn->secretDriver = &fakeSecretDriver;
- if (!(vmdef = virDomainDefParseFile(driver.caps, driver.xmlconf, xml,
+ if (!(vmdef = virDomainDefParseFile(driver.caps, driver.xmlopt, xml,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE))) {
if (flags & FLAG_EXPECT_PARSE_ERROR)
if ((driver.caps = testQemuCapsInit()) == NULL)
return EXIT_FAILURE;
- if (!(driver.xmlconf = virQEMUDriverCreateXMLConf()))
+ if (!(driver.xmlopt = virQEMUDriverCreateXMLConf()))
return EXIT_FAILURE;
VIR_FREE(driver.config->stateDir);
if ((driver.config->stateDir = strdup("/nowhere")) == NULL)
virObjectUnref(driver.config);
virObjectUnref(driver.caps);
- virObjectUnref(driver.xmlconf);
+ virObjectUnref(driver.xmlopt);
VIR_FREE(map);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
if (virtTestLoadFile(outxml, &outXmlData) < 0)
goto fail;
- if (!(def = virDomainDefParseString(driver.caps, driver.xmlconf, inXmlData,
+ if (!(def = virDomainDefParseString(driver.caps, driver.xmlopt, inXmlData,
QEMU_EXPECTED_VIRT_TYPES,
live ? 0 : VIR_DOMAIN_XML_INACTIVE)))
goto fail;
if ((driver.caps = testQemuCapsInit()) == NULL)
return EXIT_FAILURE;
- if (!(driver.xmlconf = virQEMUDriverCreateXMLConf()))
+ if (!(driver.xmlopt = virQEMUDriverCreateXMLConf()))
return EXIT_FAILURE;
# define DO_TEST_FULL(name, is_different, when) \
DO_TEST_DIFFERENT("metadata");
virObjectUnref(driver.caps);
- virObjectUnref(driver.xmlconf);
+ virObjectUnref(driver.xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
if (len && expectargv[len - 1] == '\n')
expectargv[len - 1] = '\0';
- if (!(vmdef = virDomainDefParseFile(driver.caps, driver.xmlconf, xml,
+ if (!(vmdef = virDomainDefParseFile(driver.caps, driver.xmlopt, xml,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE)))
goto fail;
driver.config = virQEMUDriverConfigNew(false);
if ((driver.caps = testQemuCapsInit()) == NULL)
return EXIT_FAILURE;
- if (!(driver.xmlconf = virQEMUDriverCreateXMLConf()))
+ if (!(driver.xmlopt = virQEMUDriverCreateXMLConf()))
return EXIT_FAILURE;
if (virAsprintf(&map, "%s/src/cpu/cpu_map.xml", abs_top_srcdir) < 0 ||
cpuMapOverride(map) < 0) {
virObjectUnref(driver.config);
virObjectUnref(driver.caps);
- virObjectUnref(driver.xmlconf);
+ virObjectUnref(driver.xmlopt);
VIR_FREE(map);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
#define VIR_FROM_THIS VIR_FROM_NONE
static virCapsPtr caps;
-static virDomainXMLConfPtr xmlconf;
+static virDomainXMLOptionPtr xmlopt;
static virSecurityManagerPtr mgr;
goto cleanup;
}
- if (!(def = virDomainDefParseString(caps, xmlconf, xmlstr,
+ if (!(def = virDomainDefParseString(caps, xmlopt, xmlstr,
QEMU_EXPECTED_VIRT_TYPES,
0)))
goto cleanup;
if ((caps = testQemuCapsInit()) == NULL)
return EXIT_FAILURE;
- if (!(xmlconf = virQEMUDriverCreateXMLConf()))
+ if (!(xmlopt = virQEMUDriverCreateXMLConf()))
return EXIT_FAILURE;
#define DO_TEST_LABELING(name) \
#include "domain_conf.h"
virCapsPtr testQemuCapsInit(void);
-virDomainXMLConfPtr testQemuXMLConfInit(void);
+virDomainXMLOptionPtr testQemuXMLConfInit(void);
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
}
-virDomainXMLConfPtr
+virDomainXMLOptionPtr
testXenXMLConfInit(void)
{
- return virDomainXMLConfNew(NULL, NULL);
+ return virDomainXMLOptionNew(NULL, NULL);
}
virCapsPtr testXenCapsInit(void) {
#include "domain_conf.h"
virCapsPtr testXenCapsInit(void);
-virDomainXMLConfPtr testXenXMLConfInit(void);
+virDomainXMLOptionPtr testXenXMLConfInit(void);
#include "viralloc.h"
static virCapsPtr caps;
-static virDomainXMLConfPtr xmlconf;
+static virDomainXMLOptionPtr xmlopt;
static int
testCompareParseXML(const char *xmcfg, const char *xml, int xendConfigVersion)
priv.caps = caps;
conn->privateData = &priv;
- if (!(def = virDomainDefParseString(caps, xmlconf, xmlData,
+ if (!(def = virDomainDefParseString(caps, xmlopt, xmlData,
1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE)))
goto fail;
if (!(caps = testXenCapsInit()))
return EXIT_FAILURE;
- if (!(xmlconf = testXenXMLConfInit()))
+ if (!(xmlopt = testXenXMLConfInit()))
return EXIT_FAILURE;
#define DO_TEST(name, version) \
DO_TEST("pci-devs", 2);
virObjectUnref(caps);
- virObjectUnref(xmlconf);
+ virObjectUnref(xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
#include "testutilsxen.h"
static virCapsPtr caps;
-static virDomainXMLConfPtr xmlconf;
+static virDomainXMLOptionPtr xmlopt;
static int
testCompareFiles(const char *xml, const char *sexpr, int xendConfigVersion)
if (virtTestLoadFile(sexpr, &sexprData) < 0)
goto fail;
- if (!(def = virDomainDefParseString(caps, xmlconf, xmlData,
+ if (!(def = virDomainDefParseString(caps, xmlopt, xmlData,
1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_XML_INACTIVE)))
goto fail;
if (!(caps = testXenCapsInit()))
return EXIT_FAILURE;
- if (!(xmlconf = testXenXMLConfInit()))
+ if (!(xmlopt = testXenXMLConfInit()))
return EXIT_FAILURE;
DO_TEST("pv", "pv", "pvtest", 1);
DO_TEST("escape", "escape", "fvtest", 1);
virObjectUnref(caps);
- virObjectUnref(xmlconf);
+ virObjectUnref(xmlopt);
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
static virCapsPtr caps;
static virVMXContext ctx;
-static virDomainXMLConfPtr xmlconf;
+static virDomainXMLOptionPtr xmlopt;
static int testDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
virArch arch ATTRIBUTE_UNUSED)
failure:
virObjectUnref(caps);
- virObjectUnref(xmlconf);
+ virObjectUnref(xmlopt);
caps = NULL;
}
goto failure;
}
- def = virDomainDefParseString(caps, xmlconf, xmlData,
+ def = virDomainDefParseString(caps, xmlopt, xmlData,
1 << VIR_DOMAIN_VIRT_VMWARE,
VIR_DOMAIN_XML_INACTIVE);
return EXIT_FAILURE;
}
- if (!(xmlconf = virDomainXMLConfNew(NULL, NULL)))
+ if (!(xmlopt = virDomainXMLOptionNew(NULL, NULL)))
return EXIT_FAILURE;
ctx.opaque = NULL;