[libvirt] [PATCH 2/3] Increase size of driver table to make UML work again

Eric Blake eblake at redhat.com
Tue Jan 18 17:45:03 UTC 2011


On 01/18/2011 10:31 AM, Daniel P. Berrange wrote:
> The driver table only has 10 slots, but there are potentially
> 11 drivers that need activating. Improve the error message
> when driver registration fails
> 
> * src/libvirt.c: Increase driver table size & improve errors
> ---
>  src/libvirt.c |   34 +++++++++++++++++++++++++---------
>  1 files changed, 25 insertions(+), 9 deletions(-)
> 
> diff --git a/src/libvirt.c b/src/libvirt.c
> index d47afbe..f09e229 100644
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> @@ -79,7 +79,7 @@
>   * - use reference counting to guarantee coherent pointer state ?
>   */
>  
> -#define MAX_DRIVERS 10
> +#define MAX_DRIVERS 20
>  
>  static virDriverPtr virDriverTab[MAX_DRIVERS];
>  static int virDriverTabCount = 0;
> @@ -523,7 +523,9 @@ virRegisterNetworkDriver(virNetworkDriverPtr driver)
>      }
>  
>      if (virNetworkDriverTabCount >= MAX_DRIVERS) {
> -        virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
> +        virLibConnError(VIR_ERR_INTERNAL_ERROR,
> +                        _("Too many drivers, cannot register %s"),
> +                        driver->name);

ACK.  I guess we may someday want to consider dynamically allocating the
table, rather than a hard-coded size, but drivers aren't added all that
frequently, and this patch is definitely an improvement.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110118/eef1e39e/attachment-0001.sig>


More information about the libvir-list mailing list