diff --git a/ChangeLog b/ChangeLog index e97ae328d1..29dd83d4b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Feb 27 16:42:46 EST 2006 Daniel Veillard + + * src/libvirt.c src/xen_internal.[ch]: virConnectOpenReadOnly() + should not emit error when failing to open the hypervisor proc + entry point. + Mon Feb 27 16:32:55 EST 2006 Daniel Veillard * include/virterror.h src/libvirt_sym.version: exported diff --git a/src/libvirt.c b/src/libvirt.c index 102d18d8a7..0bda0b0e7d 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -140,7 +140,7 @@ virConnectOpen(const char *name) { return(NULL); } - handle = xenHypervisorOpen(); + handle = xenHypervisorOpen(0); if (handle == -1) { goto failed; } @@ -200,7 +200,7 @@ virConnectOpenReadOnly(const char *name) { return(NULL); } - handle = xenHypervisorOpen(); + handle = xenHypervisorOpen(1); if (handle >= 0) method++; else diff --git a/src/xen_internal.c b/src/xen_internal.c index f04c3674a5..98a6dbd7c3 100644 --- a/src/xen_internal.c +++ b/src/xen_internal.c @@ -59,17 +59,19 @@ virXenError(virErrorNumber error, const char *info, int value) { /** * xenHypervisorOpen: + * @quiet: don'r raise an error on failure if set * * Connects to the Xen hypervisor. * * Returns the handle or -1 in case of error. */ -int xenHypervisorOpen(void) { +int xenHypervisorOpen(int quiet) { int ret; ret = open(XEN_HYPERVISOR_SOCKET, O_RDWR); if (ret < 0) { - virXenError(VIR_ERR_NO_XEN, XEN_HYPERVISOR_SOCKET, 0); + if (!quiet) + virXenError(VIR_ERR_NO_XEN, XEN_HYPERVISOR_SOCKET, 0); return(-1); } diff --git a/src/xen_internal.h b/src/xen_internal.h index eb04814374..a819b44148 100644 --- a/src/xen_internal.h +++ b/src/xen_internal.h @@ -20,7 +20,7 @@ extern "C" { #endif -int xenHypervisorOpen (void); +int xenHypervisorOpen (int quiet); int xenHypervisorClose (int handle); unsigned long xenHypervisorGetVersion (int handle); int xenHypervisorDestroyDomain (int handle,