--- src/vz/vz_driver.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 39f58a4..31dfb6a 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -979,6 +979,38 @@ vzDomainUndefine(virDomainPtr domain) return vzDomainUndefineFlags(domain, 0); } +static virDomainPtr +vzDomainCreateXML(virConnectPtr conn, + const char *xml, + unsigned int flags) +{ + virDomainPtr domain; + int ret; + + virCheckFlags(VIR_DOMAIN_START_PAUSED, NULL); + + domain = vzDomainDefineXMLFlags(conn, xml, 0); + if (domain == NULL) + return domain; + + ret = vzDomainCreate(domain); + if (ret != 0) { + vzDomainUndefine(domain); + return NULL; + } + + if (flags & VIR_DOMAIN_START_PAUSED) { + ret = vzDomainSuspend(domain); + if (ret != 0) { + vzDomainDestroy(domain); + vzDomainUndefine(domain); + return NULL; + } + } + + return domain; +} + static int vzDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags) { @@ -1493,6 +1525,7 @@ static virHypervisorDriver vzDriver = { .domainShutdown = vzDomainShutdown, /* 0.10.0 */ .domainCreate = vzDomainCreate, /* 0.10.0 */ .domainCreateWithFlags = vzDomainCreateWithFlags, /* 1.2.10 */ + .domainCreateXML = vzDomainCreateXML, /* 1.2.22 */ .domainReboot = vzDomainReboot, /* 1.2.22 */ .domainDefineXML = vzDomainDefineXML, /* 0.10.0 */ .domainDefineXMLFlags = vzDomainDefineXMLFlags, /* 1.2.12 */ -- 1.8.3.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list