[libvirt] [PATCH 2/4] VirtualBox support
Pritesh Kothari
Pritesh.Kothari at Sun.COM
Thu Apr 16 16:09:55 UTC 2009
Hi Daniel,
> > I have attached a patch which when applied on the HEAD as of today would
> > allow virtualbox support in libvirt. It takes cares of all the stuff
> > mentioned on the list earlier. Still if I have missed anything, please do
> > tell me.
>
> I actually just tried out your previous patch from 2 days ago and it
> worked without trouble, so I reckon we can plan to get this driver
> in the forthcoming release next week.
That's great news :)
> > + if ((guest = virCapabilitiesAddGuest(caps,
> > + "hvm",
> > + utsname.machine,
> > + sizeof(int) == 4 ? 32 : 64,
>
> I was wondering why the capabilities said '32' as wordsize
> even on x86_64, and of course this is because 'int' is still
> 32 bits on x86_64. I'd switch to 'sizeof(size_t)' instead
> unless someone has better suggestions for determining the
> native arch wordsize in a portable manner.
fixed this. used (sizeof(void *) * CHAR_BIT) instead of (sizeof(int) == 4 ?
32 : 64)
> > +static const char *vboxGetType(virConnectPtr conn ATTRIBUTE_UNUSED) {
> > + DEBUG("%s: in vboxGetType",conn->driver->name);
> > + return strdup("VBox");
> > +}
>
> This shouldn't strdup the type - the returned string is const,
> not to be free'd by caller.
> Even better just remove this method entirely. I don't know why
> we have this as a driver method at all. The default impl in
> src/libvirt.c already does the correct thing, returning the
> conn->driver->name string.
>
> We should remove getType from all our driver impls.
removed this method from the driver. Thanks
Regards,
Pritesh
More information about the libvir-list
mailing list