[libvirt] [PATCH 01/10] libxl: update dom->id in libxlDomainCreateWithFlags

Marek Marczykowski-Górecki marmarek at invisiblethingslab.com
Fri Feb 6 00:04:52 UTC 2015


On Thu, Feb 05, 2015 at 02:25:41PM -0700, Jim Fehlig wrote:
> Marek Marczykowski-Górecki wrote:
> > Otherwise domainCreateWithFlags via remote returns -1 as domid.
> >
> > Signed-off-by: Marek Marczykowski-Górecki <marmarek at invisiblethingslab.com>
> > ---
> >  src/libxl/libxl_driver.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> > index c95b387..ce3a99b 100644
> > --- a/src/libxl/libxl_driver.c
> > +++ b/src/libxl/libxl_driver.c
> > @@ -2375,6 +2375,9 @@ libxlDomainCreateWithFlags(virDomainPtr dom,
> >      }
> >  
> >      ret = libxlDomainStart(driver, vm, (flags & VIR_DOMAIN_START_PAUSED) != 0, -1);
> > +    if (ret < 0)
> > +        goto cleanup;
> > +    dom->id = vm->def->id;
> >   
> 
> It looks at though this is the only callsite of libxlDomainStart that
> needs this change.  Have you noticed this with other APIs that call
> libxlDomainStart?

Not directly. But there is a problem if domain gets restarted by some other
client - the first one will still use old domid. IIUC for now the only
workaround is to listen to lifecycle events for every domain.

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150206/758ec673/attachment-0001.sig>


More information about the libvir-list mailing list