From 27efc8bd0d80ae4ea7db102e9839135590db4cf1 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 24 Jul 2008 07:29:50 +0000 Subject: [PATCH] =?UTF-8?q?Check=20for=20already=20running=20QEmu=20domain?= =?UTF-8?q?=20on=20create=20*=20src/qemu=5Fdriver.c:=20another=20patch=20f?= =?UTF-8?q?rom=20Guido=20G=C3=BCnther=20checking=20=20=20for=20an=20alread?= =?UTF-8?q?y=20running=20domain=20on=20create=20Daniel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 5 +++++ src/qemu_driver.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 860bc93f06..4120cd68ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 24 09:26:51 CEST 2008 Daniel Veillard + + * 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 * src/qemu_driver.c: patch from Guido Günther checking for diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 01b4d18eb8..f706819547 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -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))) {