mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Check for already running QEmu domain on create
* src/qemu_driver.c: another patch from Guido Günther checking for an already running domain on create Daniel
This commit is contained in:
parent
d3bb1e4367
commit
27efc8bd0d
@ -1,3 +1,8 @@
|
||||
Thu Jul 24 09:26:51 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||
|
||||
* src/qemu_driver.c: another patch from Guido Günther checking
|
||||
for an already running domain on create
|
||||
|
||||
Thu Jul 24 09:08:32 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||
|
||||
* src/qemu_driver.c: patch from Guido Günther checking for
|
||||
|
@ -2006,6 +2006,15 @@ static virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml,
|
||||
if (!(def = virDomainDefParseString(conn, driver->caps, xml)))
|
||||
return NULL;
|
||||
|
||||
vm = virDomainFindByName(driver->domains, def->name);
|
||||
if (vm && virDomainIsActive(vm)) {
|
||||
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
||||
_("domain %s is already defined and running"),
|
||||
def->name);
|
||||
virDomainDefFree(def);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(vm = virDomainAssignDef(conn,
|
||||
&driver->domains,
|
||||
def))) {
|
||||
|
Loading…
Reference in New Issue
Block a user