summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/libvir.c')
-rw-r--r--src/libvir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libvir.c b/src/libvir.c
index e268acc44..23ec2587b 100644
--- a/src/libvir.c
+++ b/src/libvir.c
@@ -147,6 +147,9 @@ virConnectOpenReadOnly(const char *name) {
handle = xenHypervisorOpen();
if (handle >= 0)
method++;
+ else
+ handle = -1;
+
xshandle = xs_daemon_open_readonly();
if (xshandle != NULL)
method++;
@@ -155,7 +158,7 @@ virConnectOpenReadOnly(const char *name) {
if (ret == NULL)
goto failed;
ret->magic = VIR_CONNECT_MAGIC;
- ret->handle = -1;
+ ret->handle = handle;
ret->xshandle = xshandle;
if (xend_setup(ret) == 0)
method++;