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

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

 



On Thu, Jul 24, 2008 at 10:41:31AM -0400, Guido G?nther wrote:
> 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? 

Yes, that is correct.

virDomainCreateLinux()  starts a virtual machine with no config file. All
trace of it will disappear when it shuts down - a so called 'transient'
VM. 

Alternatively you can define the config first with virDomainDefineXML()
and then start it based on this definition with virDomainCreate(). This
gives you a persistent VM.

Now, while a transient VM is running you can explicitly give it a config 
file by called virDomainDefineXML with the same uuid, thus turning it in
to a persistent VM.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]