On Thu, May 07, 2009 at 11:19:01AM +0200, Pritesh Kothari wrote:
On Thursday 07 May 2009 10:50:54 Guido Günther wrote:
> Hi,
> virsh fails with:
>
> 10:47:37.104: debug : do_open:922 : no name, allowing driver auto-select
> 10:47:37.104: debug : do_open:930 : trying driver 0 (Test) ...
> 10:47:37.104: debug : do_open:936 : driver 0 Test returned DECLINED
> 10:47:37.104: debug : do_open:930 : trying driver 1 (OPENVZ) ...
> 10:47:37.105: debug : do_open:936 : driver 1 OPENVZ returned DECLINED
> 10:47:37.105: debug : do_open:930 : trying driver 2 (VBOX) ...
> 10:47:37.106: debug : do_open:936 : driver 2 VBOX returned ERROR
> 10:47:37.106: debug : virUnrefConnect:210 : unref connection 0x10032b10 1
> 10:47:37.106: debug : virReleaseConnect:171 : release connection 0x10032b10
> error: failed to connect to the hypervisor
>
> if one has built with vbox support but vbox is not installed. Attached
> patch calls VBoxCGlueInit() early so we can return 'declined' instead of
> 'error'. O.k. to apply?
the above patch leads to memory leaks as vboxUninitialize() needs to be called
if VBoxCGlueInit() is called, so modifying it as below solves both the
problems. (declined is right here cause the only error condition is while
conn->uri == NULL is already being handled, and thus the following patch)
Ok, thanks for checking this. ACK to this patch instead of Guido's.
Daniel
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 7297172..2416b30 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -350,7 +350,7 @@ static virDrvOpenStatus vboxOpen(virConnectPtr conn,
return VIR_DRV_OPEN_SUCCESS;
cleanup:
vboxUninitialize(data);
- return VIR_DRV_OPEN_ERROR;
+ return VIR_DRV_OPEN_DECLINED;
}
static int vboxClose(virConnectPtr conn) {
--
Libvir-list mailing list
Libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
--
|: Red Hat, Engineering, London -o-
http://people.redhat.com/berrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org -o-
http://ovirt.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|