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

Re: [libvirt] [PATCH] Improve error message for disabled client-side drivers



2010/6/11 Daniel P. Berrange <berrange redhat com>:
> On Fri, Jun 11, 2010 at 06:25:29PM +0200, Matthias Bolte wrote:
>> 2010/6/11 Daniel P. Berrange <berrange redhat com>:
>> > On Thu, Jun 10, 2010 at 01:28:29AM +0200, Matthias Bolte wrote:
>> >> Report that libvirt was built without that driver instead of
>> >> trying to connect to a libvirtd, when we know that this is
>> >> going to fail.
>> >> ---
>> >>

>> >
>> > ACK, this looks fine to me.  One day I'd like to change the way we pick
>> > the drivers during the open method, but that's faar too invasive for
>> > now.
>> >
>> > Regards,
>> > Daniel
>> >
>>
>> Maybe something like having a scheme-to-driver mapping table would be
>> nice, instead of asking each driver.
>
> Yes, that's exactly what I'd think. In addition when compiling out drivers
> instead of not adding anything to the driver table, we could add a no-op
> driver that simply reports that the driver isn't available.
>
>
> Daniel
>

I started this patch like that. I added a minimal driver that does
exactly that and I edited virInitialize like this:

# ifdef WITH_ESX
    if (esxRegister() == -1) return -1;
# else
    if (disabledRegister("esx") == -1) return -1;
    if (disabledRegister("gsx") == -1) return -1;
# endif

But I dropped it after I thought that I could not make this work with
driver modules. But as I think of it now again: I could just have
called disabledRegister in virDriverLoadModule when the requested
driver wasn't found. Damn, I should have give it a second thought
before pushing this patch. :(

My first approach wouldn't have touched the way do_open picks the
drivers, so it's not that invasive. It would just have put those
"disabled" entries in to the driver table.

Maybe I should recreate that disabled driver, just to see if I can
make it really working properly.

Any interest in that approach?

Matthias


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