* src/libvirt.c src/xen_internal.[ch]: virConnectOpenReadOnly()

should not emit error when failing to open the hypervisor proc
  entry point.
Daniel
This commit is contained in:
Daniel Veillard 2006-02-27 21:42:32 +00:00
parent 87d338374a
commit 5548938d62
4 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,9 @@
Mon Feb 27 16:42:46 EST 2006 Daniel Veillard <veillard@redhat.com>
* 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 <veillard@redhat.com>
* include/virterror.h src/libvirt_sym.version: exported

View File

@ -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

View File

@ -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);
}

View File

@ -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,