Re: [PATCH] vz: implementation of domainCreateXML callback

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

 



On Tue, Nov 24, 2015 at 05:24:48PM +0300, Dmitry Guryanov wrote:
> On Fri, 2015-11-20 at 16:52 +0300, Mikhail Feoktistov wrote:
> > ---
> >  src/vz/vz_driver.c | 33 +++++++++++++++++++++++++++++++++
> >  1 file changed, 33 insertions(+)
> > 
> > diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
> > index 39f58a4..31dfb6a 100644
> > --- a/src/vz/vz_driver.c
> > +++ b/src/vz/vz_driver.c
> > @@ -979,6 +979,38 @@ vzDomainUndefine(virDomainPtr domain)
> >      return vzDomainUndefineFlags(domain, 0);
> >  }
> >  
> > +static virDomainPtr
> > +vzDomainCreateXML(virConnectPtr conn,
> > +                  const char *xml,
> > +                  unsigned int flags)
> > +{
> > +    virDomainPtr domain;
> > +    int ret;
> > +
> > +    virCheckFlags(VIR_DOMAIN_START_PAUSED, NULL);
> > +
> > +    domain = vzDomainDefineXMLFlags(conn, xml, 0);
> > +    if (domain == NULL)
> > +        return domain;
> > +
> > +    ret = vzDomainCreate(domain);
> > +    if (ret != 0) {
> > +        vzDomainUndefine(domain);
> > +        return NULL;
> > +    }
> > +
> > +    if (flags & VIR_DOMAIN_START_PAUSED) {
> > +        ret = vzDomainSuspend(domain);
> > +        if (ret != 0) {
> > +            vzDomainDestroy(domain);
> > +            vzDomainUndefine(domain);
> > +            return NULL;
> > +        }
> 
> I think we shouldn't allow this start paused operation. Because it means that
> domain shouldn't run any code before being paused, and with this implementation
> we start a domain, it does some work and only that you suspend it. Also suspend
> and paused states are different and we only support paused state for VMs.

Yeah, VIR_DOMAIN_START_PAUSED really needs to guarantee that the
guest OS does not execute any code at all, not even a tiny bit.

If a driver can't do that, apps can still fallback to manually pausing
the guest after starting it, if they are ok with those semantics, so
no need for drivers todo that fallback approach themselves.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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