[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libvir] [PATCH] Remove VIR_DRV_OPEN_QUIET



VIR_DRV_OPEN_QUIET causes important diagnostic error messages to be thrown away. This patch removes this.

Rich.

--
Emerging Technologies, Red Hat  http://et.redhat.com/~rjones/
64 Baker Street, London, W1U 7DF     Mobile: +44 7866 314 421

Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.
Registered in England and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David
Owens (Ireland)
diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-cvs/proxy/libvirt_proxy.c libvirt-open-noisy/proxy/libvirt_proxy.c
--- libvirt-cvs/proxy/libvirt_proxy.c	2007-04-04 15:39:43.000000000 +0100
+++ libvirt-open-noisy/proxy/libvirt_proxy.c	2007-04-30 12:19:18.000000000 +0100
@@ -77,7 +77,7 @@
     priv->xshandle = NULL;
     priv->proxy = -1;
 
-    ret = xenHypervisorOpen(conn, NULL, VIR_DRV_OPEN_QUIET);
+    ret = xenHypervisorOpen(conn, NULL, 0);
     if (ret < 0) {
         fprintf(stderr, "Failed to open Xen hypervisor\n");
         return(-1);
@@ -93,7 +93,7 @@
         fprintf(stderr, "Failed to connect to Xen daemon\n");
         return(-1);
     }
-    ret = xenStoreOpen(conn, NULL, VIR_DRV_OPEN_QUIET | VIR_DRV_OPEN_RO);
+    ret = xenStoreOpen(conn, NULL, VIR_DRV_OPEN_RO);
     if (ret < 0) {
         fprintf(stderr, "Failed to open XenStore connection");
         return (-1);
diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-cvs/src/driver.h libvirt-open-noisy/src/driver.h
--- libvirt-cvs/src/driver.h	2007-04-04 15:39:43.000000000 +0100
+++ libvirt-open-noisy/src/driver.h	2007-04-27 19:00:49.000000000 +0100
@@ -24,7 +24,7 @@
 
 
 typedef enum {
-    VIR_DRV_OPEN_QUIET = 1,
+    /* VIR_DRV_OPEN_QUIET = 1 - removed by RWMJ */
     VIR_DRV_OPEN_RO = 2
 } virDrvOpenFlag;
 
diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-cvs/src/libvirt.c libvirt-open-noisy/src/libvirt.c
--- libvirt-cvs/src/libvirt.c	2007-04-26 11:23:39.000000000 +0100
+++ libvirt-open-noisy/src/libvirt.c	2007-04-27 19:01:11.000000000 +0100
@@ -326,7 +326,7 @@
 virConnectPtr
 virConnectOpen (const char *name)
 {
-    return do_open (name, VIR_DRV_OPEN_QUIET);
+    return do_open (name, 0);
 }
 
 /**
@@ -342,7 +342,7 @@
 virConnectPtr
 virConnectOpenReadOnly(const char *name)
 {
-    return do_open (name, VIR_DRV_OPEN_QUIET | VIR_DRV_OPEN_RO);
+    return do_open (name, VIR_DRV_OPEN_RO);
 }
 
 /**
diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-cvs/src/proxy_internal.c libvirt-open-noisy/src/proxy_internal.c
--- libvirt-cvs/src/proxy_internal.c	2007-04-04 15:39:43.000000000 +0100
+++ libvirt-open-noisy/src/proxy_internal.c	2007-04-30 12:21:28.000000000 +0100
@@ -543,7 +544,6 @@
 
     fd = virProxyOpenClientSocket(PROXY_SOCKET_PATH);
     if (fd < 0) {
-        if (!(flags & VIR_DRV_OPEN_QUIET))
 	    virProxyError(conn, VIR_ERR_NO_XEN, PROXY_SOCKET_PATH);
         return(-1);
     }
@@ -554,7 +554,6 @@
     req.len = sizeof(req);
     ret = xenProxyCommand(conn, &req, NULL, 1);
     if ((ret < 0) || (req.command != VIR_PROXY_NONE)) {
-        if (!(flags & VIR_DRV_OPEN_QUIET))
 	    virProxyError(conn, VIR_ERR_OPERATION_FAILED, __FUNCTION__);
         xenProxyClose(conn);
 	return(-1);
diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-cvs/src/qemu_internal.c libvirt-open-noisy/src/qemu_internal.c
--- libvirt-cvs/src/qemu_internal.c	2007-04-17 19:49:32.000000000 +0100
+++ libvirt-open-noisy/src/qemu_internal.c	2007-04-27 19:01:34.000000000 +0100
@@ -395,8 +395,7 @@
 
     uri = xmlParseURI(name);
     if (uri == NULL) {
-        if (!(flags & VIR_DRV_OPEN_QUIET))
-            qemuError(conn, NULL, VIR_ERR_NO_SUPPORT, name);
+        qemuError(conn, NULL, VIR_ERR_NO_SUPPORT, name);
         return VIR_DRV_OPEN_DECLINED;
     }
 
diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-cvs/src/test.c libvirt-open-noisy/src/test.c
--- libvirt-cvs/src/test.c	2007-04-26 11:23:39.000000000 +0100
+++ libvirt-open-noisy/src/test.c	2007-04-30 12:00:21.000000000 +0100
@@ -706,7 +706,7 @@
 
 int testOpen(virConnectPtr conn,
              const char *name,
-             int flags)
+             int flags ATTRIBUTE_UNUSED)
 {
     xmlURIPtr uri;
     int ret, connid;
@@ -717,8 +717,7 @@
 
     uri = xmlParseURI(name);
     if (uri == NULL) {
-        if (!(flags & VIR_DRV_OPEN_QUIET))
-            testError(conn, NULL, VIR_ERR_NO_SUPPORT, name);
+        testError(conn, NULL, VIR_ERR_NO_SUPPORT, name);
         return VIR_DRV_OPEN_DECLINED;
     }
 
diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-cvs/src/xend_internal.c libvirt-open-noisy/src/xend_internal.c
--- libvirt-cvs/src/xend_internal.c	2007-04-26 11:23:39.000000000 +0100
+++ libvirt-open-noisy/src/xend_internal.c	2007-04-30 12:03:25.000000000 +0100
@@ -1923,7 +1923,8 @@
  * Returns 0 in case of success, -1 in case of error.
  */
 int
-xenDaemonOpen(virConnectPtr conn, const char *name, int flags)
+xenDaemonOpen(virConnectPtr conn, const char *name,
+              int flags ATTRIBUTE_UNUSED)
 {
     xmlURIPtr uri = NULL;
     int ret;
@@ -1959,16 +1960,14 @@
          */
         uri = xmlParseURI(name);
         if (uri == NULL) {
-            if (!(flags & VIR_DRV_OPEN_QUIET))
-                virXendError(conn, VIR_ERR_NO_SUPPORT, name);
+            virXendError(conn, VIR_ERR_NO_SUPPORT, name);
             goto failed;
         }
 
         if (uri->scheme == NULL) {
             /* It should be a file access */
             if (uri->path == NULL) {
-                if (!(flags & VIR_DRV_OPEN_QUIET))
-                    virXendError(conn, VIR_ERR_NO_SUPPORT, name);
+                virXendError(conn, VIR_ERR_NO_SUPPORT, name);
                 goto failed;
             }
             ret = xenDaemonOpen_unix(conn, uri->path);
@@ -1986,8 +1985,7 @@
             if (ret == -1)
                 goto failed;
         } else {
-            if (!(flags & VIR_DRV_OPEN_QUIET))
-                virXendError(conn, VIR_ERR_NO_SUPPORT, name);
+            virXendError(conn, VIR_ERR_NO_SUPPORT, name);
             goto failed;
         }
     }
diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-cvs/src/xen_internal.c libvirt-open-noisy/src/xen_internal.c
--- libvirt-cvs/src/xen_internal.c	2007-04-17 19:49:32.000000000 +0100
+++ libvirt-open-noisy/src/xen_internal.c	2007-04-30 12:03:05.000000000 +0100
@@ -1516,8 +1516,9 @@
  * Returns 0 or -1 in case of error.
  */
 int
-xenHypervisorOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
-                  const char *name ATTRIBUTE_UNUSED, int flags)
+xenHypervisorOpen(virConnectPtr conn,
+                  const char *name ATTRIBUTE_UNUSED,
+                  int flags ATTRIBUTE_UNUSED)
 {
     int ret;
     xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
@@ -1530,8 +1531,7 @@
 
     ret = open(XEN_HYPERVISOR_SOCKET, O_RDWR);
     if (ret < 0) {
-        if (!(flags & VIR_DRV_OPEN_QUIET))
-            virXenError(VIR_ERR_NO_XEN, XEN_HYPERVISOR_SOCKET, 0);
+        virXenError(VIR_ERR_NO_XEN, XEN_HYPERVISOR_SOCKET, 0);
         return (-1);
     }
 
diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-cvs/src/xs_internal.c libvirt-open-noisy/src/xs_internal.c
--- libvirt-cvs/src/xs_internal.c	2007-04-17 19:49:32.000000000 +0100
+++ libvirt-open-noisy/src/xs_internal.c	2007-04-30 12:04:54.000000000 +0100
@@ -325,7 +325,8 @@
  */
 int
 xenStoreOpen(virConnectPtr conn,
-             const char *name ATTRIBUTE_UNUSED, int flags)
+             const char *name ATTRIBUTE_UNUSED,
+             int flags ATTRIBUTE_UNUSED)
 {
     xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
 
@@ -339,8 +340,7 @@
 #endif /* ! PROXY */
 
     if (priv->xshandle == NULL) {
-        if (!(flags & VIR_DRV_OPEN_QUIET))
-            virXenStoreError(conn, VIR_ERR_NO_XEN, 
+        virXenStoreError(conn, VIR_ERR_NO_XEN, 
 	                     _("failed to connect to Xen Store"));
         return (-1);
     }

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]