[libvirt] [PATCHv2 23/27] conf: prefer unsigned flags

Eric Blake eblake at redhat.com
Fri Jul 8 19:26:05 UTC 2011


* src/conf/cpu_conf.h (virCPUDefFormat, virCPUDefFormatBuf):
Change flags type.
* src/conf/cpu_conf.c (virCPUDefFormat, virCPUDefFormatBuf):
Likewise.
* src/conf/storage_conf.c (_virStoragePoolOptions): Likewise.
* src/datatypes.h (_virConnect, _virStream): Likewise.
---

v2: new patch

 src/conf/cpu_conf.c     |    6 +++---
 src/conf/cpu_conf.h     |    6 +++---
 src/conf/storage_conf.c |    4 ++--
 src/datatypes.h         |    4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 14e93db..5cecda2 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -1,7 +1,7 @@
 /*
  * cpu_conf.h: CPU XML handling
  *
- * Copyright (C) 2009, 2010 Red Hat, Inc.
+ * Copyright (C) 2009-2011 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -307,7 +307,7 @@ error:
 char *
 virCPUDefFormat(virCPUDefPtr def,
                 const char *indent,
-                int flags)
+                unsigned int flags)
 {
     virBuffer buf = VIR_BUFFER_INITIALIZER;

@@ -331,7 +331,7 @@ int
 virCPUDefFormatBuf(virBufferPtr buf,
                    virCPUDefPtr def,
                    const char *indent,
-                   int flags)
+                   unsigned int flags)
 {
     unsigned int i;

diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
index ecd4e10..57b85e1 100644
--- a/src/conf/cpu_conf.h
+++ b/src/conf/cpu_conf.h
@@ -1,7 +1,7 @@
 /*
  * cpu_conf.h: CPU XML handling
  *
- * Copyright (C) 2009, 2010 Red Hat, Inc.
+ * Copyright (C) 2009-2011 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -107,13 +107,13 @@ virCPUDefIsEqual(virCPUDefPtr src,
 char *
 virCPUDefFormat(virCPUDefPtr def,
                 const char *indent,
-                int flags);
+                unsigned int flags);

 int
 virCPUDefFormatBuf(virBufferPtr buf,
                    virCPUDefPtr def,
                    const char *indent,
-                   int flags);
+                   unsigned int flags);

 int
 virCPUDefAddFeature(virCPUDefPtr cpu,
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index f6f8be1..cc55b80 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -1,7 +1,7 @@
 /*
  * storage_conf.c: config handling for storage driver
  *
- * Copyright (C) 2006-2010 Red Hat, Inc.
+ * Copyright (C) 2006-2011 Red Hat, Inc.
  * Copyright (C) 2006-2008 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -117,7 +117,7 @@ enum {
 typedef struct _virStoragePoolOptions virStoragePoolOptions;
 typedef virStoragePoolOptions *virStoragePoolOptionsPtr;
 struct _virStoragePoolOptions {
-    int flags;
+    unsigned int flags;
     int defaultFormat;
     virStoragePoolFormatToString formatToString;
     virStoragePoolFormatFromString formatFromString;
diff --git a/src/datatypes.h b/src/datatypes.h
index f114360..91b1bfd 100644
--- a/src/datatypes.h
+++ b/src/datatypes.h
@@ -150,7 +150,7 @@ struct _virConnect {
      * since. Thus no need to lock when accessing them
      */
     unsigned int magic;     /* specific value to check */
-    int flags;              /* a set of connection flags */
+    unsigned int flags;     /* a set of connection flags */
     xmlURIPtr uri;          /* connection URI */

     /* The underlying hypervisor driver and network driver. */
@@ -297,7 +297,7 @@ struct _virStream {
     unsigned int magic;
     virConnectPtr conn;
     int refs;
-    int flags;
+    unsigned int flags;

     virStreamDriverPtr driver;
     void *privateData;
-- 
1.7.4.4




More information about the libvir-list mailing list