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:
Daniel Veillard 2008-07-24 07:29:50 +00:00
parent d3bb1e4367
commit 27efc8bd0d
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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))) {