mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
* 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:
parent
c5ecc66658
commit
387e06421f
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user