* src/qemu_driver.c: patch from Guido Günther to make sure create

doesn't override an existing domain definition or UUID
Daniel
This commit is contained in:
Daniel Veillard 2008-07-28 12:52:37 +00:00
parent c5ecc66658
commit 387e06421f
2 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Mon Jul 28 14:50:55 CEST 2008 Daniel Veillard <veillard@redhat.com>
* src/qemu_driver.c: patch from Guido Günther to make sure create
doesn't override an existing domain definition or UUID
Fri Jul 25 17:21:27 BST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/domain_conf.c: Fix typos in comments, and the dummy

View File

@ -2013,13 +2013,24 @@ static virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml,
return NULL;
vm = virDomainFindByName(driver->domains, def->name);
if (vm && virDomainIsActive(vm)) {
if (vm) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
_("domain %s is already defined and running"),
_("domain '%s' is already defined and running"),
def->name);
virDomainDefFree(def);
return NULL;
}
vm = virDomainFindByUUID(driver->domains, def->uuid);
if (vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(def->uuid, uuidstr);
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
_("domain with uuid '%s' is already defined and running"),
uuidstr);
virDomainDefFree(def);
return NULL;
}
if (!(vm = virDomainAssignDef(conn,
&driver->domains,