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

Re: [libvirt] QEMU/KVM auto-detection bug



On Tuesday 12 May 2009 11:55:17 Chris Lalancette wrote:
> Pritesh Kothari wrote:
> > On Tuesday 12 May 2009 11:36:50 Chris Lalancette wrote:
> >> All,
> >>      Even with Guido/Pritesh's recent changes to the vbox open routine,
> >> the auto-detection in libvirt is currently broken.  What happens is that
> >> in src/libvirt.c:do_open(), at the start of the loop to auto-detect
> >> drivers, ret->uri is NULL.  As each driver declines, it remains NULL. 
> >> However, the very first thing the vboxOpen() routine does is:
> >>
> >>     if (conn->uri == NULL) {
> >>         conn->uri = xmlParseURI(uid ? "vbox:///session" :
> >> "vbox:///system"); if (conn->uri == NULL) {
> >>             return VIR_DRV_OPEN_ERROR;
> >>         }
> >>
> >> So, any driver that is trying to auto-probe after vboxOpen sees a
> >> conn->uri with a scheme of vbox and a path of system/session, and they
> >> all fail (including Qemu, which is what I'm mostly concerned with at the
> >> moment).
> >
> > this seems to be common case in all other drivers also, for example uml,
> > openvz, etc does the same and not to mention that qemu driver does it
> > also, so i guess the fix should apply to all and not just vbox driver.
>
> Well, yes and no.  They all do it, but only *after* doing their probe
> routines. At least, I've never had a problem with auto-detection until I
> enabled vbox to build in my libvirt config.

You are right, the probe routines are before in other drivers, but in case of 
vbox it does initializations and not just probing and thus it can initialize 
only after all of uri conditions are satisfied. now this is a case where the 
driver needs to do more then just probing and vbox seems to be the very first
driver to do it, as you have mentioned it can be solved by resetting uri, i
think a more generic solution is needed here where if new drivers are added
later on and need to do initializations and not just probing then they should
not use the hack but the generic solution.

So any thought on it?

Regards,
Pritesh


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