[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] qemudDomainCreate check if domain is already active



On Thu, Jul 24, 2008 at 10:01:32AM +0100, Daniel P. Berrange wrote:
> > diff --git a/src/qemu_driver.c b/src/qemu_driver.c
> > index b84bdf4..0ad72ae 100644
> > --- a/src/qemu_driver.c
> > +++ b/src/qemu_driver.c
> > @@ -1978,6 +1978,15 @@ static virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml,
> >      if (!(def = virDomainDefParseString(conn, driver->caps, xml)))
> >          return NULL;
> >  
> > +    vm = virDomainFindByName(driver->domains, def->name);
> 
> You need to check for UUID clash too.
Indeed. But before fixing this I wonder what the exact semantics of
domainCreateLinux are. Is it correct that we don't call
virDomainSaveConfiguration? 
If so we probably don't even need to check if the domain is running. The
mere existance of a domain with the same name/uuid should probably throw
an error already since having another domain by the same name/uuid known
to libvirt already can be a source of confusion for the user.
 -- Guido


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]