[Libvir] [PATCH] stats_linux.c: Only include xs.h if WITH_XEN.

Fixes compile error when building --without-xen on a host that has no Xen headers installed. --- src/stats_linux.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/stats_linux.c b/src/stats_linux.c index 5e6d06c..125af45 100644 --- a/src/stats_linux.c +++ b/src/stats_linux.c @@ -19,7 +19,9 @@ #include <string.h> #include <unistd.h> +#ifdef WITH_XEN #include <xs.h> +#endif #include "internal.h" #include "xen_unified.h" -- 1.5.3.4

Signed one-bit bitfields are odd (values are 0 and -1?). The code doesn't test for == 1, so it's not currently broken, but it's fragile. (Noticed by Sparse). --- src/qemu_conf.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu_conf.h b/src/qemu_conf.h index 72e582d..6a59744 100644 --- a/src/qemu_conf.h +++ b/src/qemu_conf.h @@ -305,8 +305,8 @@ struct qemud_driver { char *networkConfigDir; char *networkAutostartDir; char logDir[PATH_MAX]; - int vncTLS : 1; - int vncTLSx509verify : 1; + unsigned int vncTLS : 1; + unsigned int vncTLSx509verify : 1; char *vncTLSx509certdir; char vncListen[BR_INET_ADDR_MAXLEN]; }; -- 1.5.3.4

On Thu, Nov 15, 2007 at 03:32:21AM -0500, Jim Paris wrote:
Signed one-bit bitfields are odd (values are 0 and -1?). The code doesn't test for == 1, so it's not currently broken, but it's fragile. (Noticed by Sparse).
Okay both changes makes sense, thanks for raising those and sending patches ! Applied and commited to CVS, thanks ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Jim Paris wrote:
Fixes compile error when building --without-xen on a host that has no Xen headers installed. --- src/stats_linux.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/stats_linux.c b/src/stats_linux.c index 5e6d06c..125af45 100644 --- a/src/stats_linux.c +++ b/src/stats_linux.c @@ -19,7 +19,9 @@ #include <string.h> #include <unistd.h>
+#ifdef WITH_XEN #include <xs.h> +#endif
#include "internal.h" #include "xen_unified.h"
Yes, well spotted, thanks. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ 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. 03798903
participants (3)
-
Daniel Veillard
-
Jim Paris
-
Richard W.M. Jones