提交 59173c3d 编写于 作者: P Peter Krempa

conf: Add XML parser flag that will allow us to do incompatible updates

Add a new parser flag that will mark code paths that parse XML files
wich will not be used with existing VM state so that post parse
callbacks can possibly do ABI incompatible changes if needed.
上级 24e3b0ed
......@@ -2652,6 +2652,8 @@ typedef enum {
/* don't validate os.type and arch against capabilities. Prevents
* VMs from disappearing when qemu is removed and libvirtd is restarted */
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS = 1 << 8,
/* allow updates in post parse callback that would break ABI otherwise */
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 9,
} virDomainDefParseFlags;
typedef enum {
......
......@@ -1705,7 +1705,8 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
unsigned int start_flags = VIR_QEMU_PROCESS_START_COLD;
virQEMUCapsPtr qemuCaps = NULL;
virCapsPtr caps = NULL;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE;
virCheckFlags(VIR_DOMAIN_START_PAUSED |
VIR_DOMAIN_START_AUTODESTROY |
......@@ -7146,7 +7147,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
goto cleanup;
def = virDomainDefParseString(xmlData, caps, driver->xmlopt,
VIR_DOMAIN_DEF_PARSE_INACTIVE);
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE);
if (!def)
goto cleanup;
......@@ -7460,7 +7462,8 @@ static virDomainPtr qemuDomainDefineXMLFlags(virConnectPtr conn, const char *xml
virQEMUCapsPtr qemuCaps = NULL;
virQEMUDriverConfigPtr cfg;
virCapsPtr caps = NULL;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE;
virCheckFlags(VIR_DOMAIN_DEFINE_VALIDATE, NULL);
......@@ -8430,7 +8433,8 @@ static int qemuDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
virDomainDefPtr vmdef = NULL;
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
int ret = -1;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE;
virQEMUCapsPtr qemuCaps = NULL;
qemuDomainObjPrivatePtr priv;
virQEMUDriverConfigPtr cfg = NULL;
......
......@@ -1270,7 +1270,8 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
}
mig->persistent = virDomainDefParseNode(doc, nodes[0],
caps, driver->xmlopt,
VIR_DOMAIN_DEF_PARSE_INACTIVE);
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE);
if (!mig->persistent) {
/* virDomainDefParseNode already reported
* an error for us */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册