[libvirt] [PATCH] esx: Reduce code duplication in generator
by Matthias Bolte
---
src/esx/esx_vi_generator.py | 430 ++++++++++++-------------------------------
1 file changed, 118 insertions(+), 312 deletions(-)
diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py
index 7130624..547eef6 100755
--- a/src/esx/esx_vi_generator.py
+++ b/src/esx/esx_vi_generator.py
@@ -440,8 +440,7 @@ class Type:
return string
-
-class Object(Type):
+class GenericObject(Type):
FEATURE__DYNAMIC_CAST = (1 << 1)
FEATURE__LIST = (1 << 2)
FEATURE__DEEP_COPY = (1 << 3)
@@ -450,16 +449,36 @@ class Object(Type):
FEATURE__DESERIALIZE = (1 << 6)
- def __init__(self, name, extends, properties, features=0, extended_by=None):
+ def __init__(self, name, category, managed, generic_objects_by_name):
Type.__init__(self, "struct", name)
- self.extends = extends
- self.features = features
- self.properties = properties
- self.extended_by = extended_by
- self.candidate_for_dynamic_cast = False
+ self.category = category
+ self.managed = managed
+ self.generic_objects_by_name = generic_objects_by_name
+
+
+ def generate_comment(self):
+ comment = separator
+ comment += " * %s: %s\n" % (self.category, self.name)
+
+ if self.extends is not None:
+ comment += " * %s extends %s\n" \
+ % (' ' * len(self.category), self.extends)
+
+ first = True
if self.extended_by is not None:
- self.extended_by.sort()
+ for extended_by in self.extended_by:
+ if first:
+ comment += " * %s extended by %s\n" \
+ % (' ' * len(self.category), extended_by)
+ first = False
+ else:
+ comment += " * %s %s\n" \
+ % (' ' * len(self.category), extended_by)
+
+ comment += " */\n\n"
+
+ return comment
def generate_struct_members(self, add_banner=False, struct_gap=False):
@@ -469,7 +488,7 @@ class Object(Type):
members += "\n"
if self.extends is not None:
- members += objects_by_name[self.extends] \
+ members += self.generic_objects_by_name[self.extends] \
.generate_struct_members(add_banner=True,
struct_gap=False) + "\n"
@@ -499,7 +518,7 @@ class Object(Type):
% (suffix, extended_by)
for extended_by in self.extended_by:
- source += objects_by_name[extended_by] \
+ source += self.generic_objects_by_name[extended_by] \
.generate_dispatch(suffix, False)
return source
@@ -509,7 +528,7 @@ class Object(Type):
source = ""
if self.extends is not None:
- source += objects_by_name[self.extends] \
+ source += self.generic_objects_by_name[self.extends] \
.generate_free_code(add_banner=True) + "\n"
if self.extends is not None or add_banner:
@@ -535,7 +554,7 @@ class Object(Type):
source = ""
if self.extends is not None:
- source += objects_by_name[self.extends] \
+ source += self.generic_objects_by_name[self.extends] \
.generate_validate_code(add_banner=True) + "\n"
if self.extends is not None or add_banner:
@@ -547,7 +566,7 @@ class Object(Type):
string = ""
for property in self.properties:
- string += property.generate_validate_code()
+ string += property.generate_validate_code(self.managed)
if len(string) < 1:
source += " /* no required properties */\n"
@@ -557,6 +576,20 @@ class Object(Type):
return source
+
+class Object(GenericObject):
+ def __init__(self, name, extends, properties, features=0, extended_by=None):
+ GenericObject.__init__(self, name, 'VI Object', False, objects_by_name)
+ self.extends = extends
+ self.features = features
+ self.properties = properties
+ self.extended_by = extended_by
+ self.candidate_for_dynamic_cast = False
+
+ if self.extended_by is not None:
+ self.extended_by.sort()
+
+
def generate_dynamic_cast_code(self, is_first=True):
source = ""
@@ -642,23 +675,7 @@ class Object(Type):
def generate_header(self):
- header = separator
- header += " * VI Object: %s\n" % self.name
-
- if self.extends is not None:
- header += " * extends %s\n" % self.extends
-
- first = True
-
- if self.extended_by is not None:
- for extended_by in self.extended_by:
- if first:
- header += " * extended by %s\n" % extended_by
- first = False
- else:
- header += " * %s\n" % extended_by
-
- header += " */\n\n"
+ header = self.generate_comment()
# struct
header += "struct _esxVI_%s {\n" % self.name
@@ -762,57 +779,37 @@ class Object(Type):
source += "ESX_VI__TEMPLATE__ALLOC(%s)\n\n" % self.name
# free
+ source += "/* esxVI_%s_Free */\n" % self.name
+
if self.extended_by is None:
- source += "/* esxVI_%s_Free */\n" % self.name
source += "ESX_VI__TEMPLATE__FREE(%s,\n" % self.name
- source += "{\n"
-
- if self.features & Object.FEATURE__LIST:
- if self.extends is not None:
- # avoid "dereferencing type-punned pointer will break
- # strict-aliasing rules" warnings
- source += " esxVI_%s *next = (esxVI_%s *)item->_next;\n\n" \
- % (self.extends, self.extends)
- source += " esxVI_%s_Free(&next);\n" % self.extends
- source += " item->_next = (esxVI_%s *)next;\n\n" % self.name
- else:
- source += " esxVI_%s_Free(&item->_next);\n\n" % self.name
-
- source += self.generate_free_code()
-
- source += "})\n\n"
else:
- source += "/* esxVI_%s_Free */\n" % self.name
source += "ESX_VI__TEMPLATE__DYNAMIC_FREE(%s,\n" % self.name
source += "{\n"
-
source += self.generate_dispatch('FREE')
-
source += "},\n"
- source += "{\n"
- if self.features & Object.FEATURE__LIST:
- if self.extends is not None:
- # avoid "dereferencing type-punned pointer will break
- # strict-aliasing rules" warnings
- source += " esxVI_%s *next = (esxVI_%s *)item->_next;\n\n" \
- % (self.extends, self.extends)
- source += " esxVI_%s_Free(&next);\n" % self.extends
- source += " item->_next = (esxVI_%s *)next;\n\n" % self.name
- else:
- source += " esxVI_%s_Free(&item->_next);\n\n" % self.name
+ source += "{\n"
- source += self.generate_free_code()
+ if self.features & Object.FEATURE__LIST:
+ if self.extends is not None:
+ # avoid "dereferencing type-punned pointer will break
+ # strict-aliasing rules" warnings
+ source += " esxVI_%s *next = (esxVI_%s *)item->_next;\n\n" \
+ % (self.extends, self.extends)
+ source += " esxVI_%s_Free(&next);\n" % self.extends
+ source += " item->_next = (esxVI_%s *)next;\n\n" % self.name
+ else:
+ source += " esxVI_%s_Free(&item->_next);\n\n" % self.name
- source += "})\n\n"
+ source += self.generate_free_code()
+ source += "})\n\n"
# validate
source += "/* esxVI_%s_Validate */\n" % self.name
source += "ESX_VI__TEMPLATE__VALIDATE(%s,\n" % self.name
source += "{\n"
-
source += self.generate_validate_code()
-
source += "})\n\n"
# dynamic cast
@@ -821,9 +818,7 @@ class Object(Type):
source += "/* esxVI_%s_DynamicCast */\n" % self.name
source += "ESX_VI__TEMPLATE__DYNAMIC_CAST(%s,\n" % self.name
source += "{\n"
-
source += self.generate_dynamic_cast_code()
-
source += "})\n\n"
else:
report_error("cannot add dynamic cast support for an untyped object")
@@ -834,39 +829,25 @@ class Object(Type):
source += "ESX_VI__TEMPLATE__LIST__APPEND(%s)\n\n" % self.name
# deep copy
- if self.extended_by is None:
- if self.features & Object.FEATURE__DEEP_COPY:
- source += "/* esxVI_%s_DeepCopy */\n" % self.name
- source += "ESX_VI__TEMPLATE__DEEP_COPY(%s,\n" % self.name
- source += "{\n"
-
- source += self.generate_deep_copy_code()
-
- source += "})\n\n"
+ if self.features & Object.FEATURE__DEEP_COPY:
+ source += "/* esxVI_%s_DeepCopy */\n" % self.name
- if self.features & Object.FEATURE__LIST:
- source += "/* esxVI_%s_DeepCopyList */\n" % self.name
- source += "ESX_VI__TEMPLATE__LIST__DEEP_COPY(%s)\n\n" \
- % self.name
- else:
- if self.features & Object.FEATURE__DEEP_COPY:
- source += "/* esxVI_%s_DeepCopy */\n" % self.name
+ if self.extended_by is None:
+ source += "ESX_VI__TEMPLATE__DEEP_COPY(%s,\n" % self.name
+ else:
source += "ESX_VI__TEMPLATE__DYNAMIC_DEEP_COPY(%s,\n" % self.name
source += "{\n"
-
source += self.generate_dispatch('DEEP_COPY')
-
source += "},\n"
- source += "{\n"
-
- source += self.generate_deep_copy_code()
- source += "})\n\n"
+ source += "{\n"
+ source += self.generate_deep_copy_code()
+ source += "})\n\n"
- if self.features & Object.FEATURE__LIST:
- source += "/* esxVI_%s_DeepCopyList */\n" % self.name
- source += "ESX_VI__TEMPLATE__LIST__DEEP_COPY(%s)\n\n" \
- % self.name
+ if self.features & Object.FEATURE__LIST:
+ source += "/* esxVI_%s_DeepCopyList */\n" % self.name
+ source += "ESX_VI__TEMPLATE__LIST__DEEP_COPY(%s)\n\n" \
+ % self.name
# cast from any type
if self.features & Object.FEATURE__ANY_TYPE:
@@ -879,9 +860,7 @@ class Object(Type):
source += "ESX_VI__TEMPLATE__DYNAMIC_CAST_FROM_ANY_TYPE(%s,\n" \
% self.name
source += "{\n"
-
source += self.generate_dispatch('CAST_FROM_ANY_TYPE')
-
source += "})\n\n"
if self.features & Object.FEATURE__LIST:
@@ -890,75 +869,47 @@ class Object(Type):
% self.name
# serialize
- if self.extended_by is None:
- if self.features & Object.FEATURE__SERIALIZE:
- source += "/* esxVI_%s_Serialize */\n" % self.name
- source += "ESX_VI__TEMPLATE__SERIALIZE(%s,\n" % self.name
- source += "{\n"
-
- source += self.generate_serialize_code()
-
- source += "})\n\n"
+ if self.features & Object.FEATURE__SERIALIZE:
+ source += "/* esxVI_%s_Serialize */\n" % self.name
- if self.features & Object.FEATURE__LIST:
- source += "/* esxVI_%s_SerializeList */\n" % self.name
- source += "ESX_VI__TEMPLATE__LIST__SERIALIZE(%s)\n\n" \
- % self.name
- else:
- if self.features & Object.FEATURE__SERIALIZE:
- source += "/* esxVI_%s_Serialize */\n" % self.name
+ if self.extended_by is None:
+ source += "ESX_VI__TEMPLATE__SERIALIZE(%s,\n" % self.name
+ else:
source += "ESX_VI__TEMPLATE__DYNAMIC_SERIALIZE(%s,\n" % self.name
source += "{\n"
-
source += self.generate_dispatch('SERIALIZE')
-
source += "},\n"
- source += "{\n"
-
- source += self.generate_serialize_code()
- source += "})\n\n"
+ source += "{\n"
+ source += self.generate_serialize_code()
+ source += "})\n\n"
- if self.features & Object.FEATURE__LIST:
- source += "/* esxVI_%s_SerializeList */\n" % self.name
- source += "ESX_VI__TEMPLATE__LIST__SERIALIZE(%s)\n\n" \
- % self.name
+ if self.features & Object.FEATURE__LIST:
+ source += "/* esxVI_%s_SerializeList */\n" % self.name
+ source += "ESX_VI__TEMPLATE__LIST__SERIALIZE(%s)\n\n" \
+ % self.name
# deserialize
- if self.extended_by is None:
- if self.features & Object.FEATURE__DESERIALIZE:
- source += "/* esxVI_%s_Deserialize */\n" % self.name
- source += "ESX_VI__TEMPLATE__DESERIALIZE(%s,\n" % self.name
- source += "{\n"
-
- source += self.generate_deserialize_code()
-
- source += "})\n\n"
+ if self.features & Object.FEATURE__DESERIALIZE:
+ source += "/* esxVI_%s_Deserialize */\n" % self.name
- if self.features & Object.FEATURE__LIST:
- source += "/* esxVI_%s_DeserializeList */\n" % self.name
- source += "ESX_VI__TEMPLATE__LIST__DESERIALIZE(%s)\n\n" \
- % self.name
- else:
- if self.features & Object.FEATURE__DESERIALIZE:
- source += "/* esxVI_%s_Deserialize */\n" % self.name
+ if self.extended_by is None:
+ source += "ESX_VI__TEMPLATE__DESERIALIZE(%s,\n" % self.name
+ else:
source += "ESX_VI__TEMPLATE__DYNAMIC_DESERIALIZE(%s,\n" \
% self.name
source += "{\n"
-
source += self.generate_dispatch('DESERIALIZE')
-
source += "},\n"
- source += "{\n"
-
- source += self.generate_deserialize_code()
- source += "})\n\n"
+ source += "{\n"
+ source += self.generate_deserialize_code()
+ source += "})\n\n"
- if self.features & Object.FEATURE__LIST:
- source += "/* esxVI_%s_DeserializeList */\n" % self.name
- source += "ESX_VI__TEMPLATE__LIST__DESERIALIZE(%s)\n\n" \
- % self.name
+ if self.features & Object.FEATURE__LIST:
+ source += "/* esxVI_%s_DeserializeList */\n" % self.name
+ source += "ESX_VI__TEMPLATE__LIST__DESERIALIZE(%s)\n\n" \
+ % self.name
source += "\n\n"
@@ -966,12 +917,10 @@ class Object(Type):
-class ManagedObject(Type):
- FEATURE__LIST = (1 << 2)
-
-
+class ManagedObject(GenericObject):
def __init__(self, name, extends, properties, features=0, extended_by=None):
- Type.__init__(self, "struct", name)
+ GenericObject.__init__(self, name, 'VI Managed Object', True,
+ managed_objects_by_name)
self.extends = extends
self.features = features
self.properties = properties
@@ -981,100 +930,6 @@ class ManagedObject(Type):
self.extended_by.sort()
- def generate_struct_members(self, add_banner=False, struct_gap=False):
- members = ""
-
- if struct_gap:
- members += "\n"
-
- if self.extends is not None:
- members += managed_objects_by_name[self.extends] \
- .generate_struct_members(add_banner=True) + "\n"
-
- if self.extends is not None or add_banner:
- members += " /* %s */\n" % self.name
-
- for property in self.properties:
- members += property.generate_struct_member()
-
- if len(self.properties) < 1:
- members += " /* no properties */\n"
-
- return members
-
-
- def generate_dispatch(self, suffix, is_first=True):
- source = ""
-
- if self.extended_by is not None:
- if not is_first:
- source += "\n"
-
- source += " /* %s */\n" % self.name
-
- for extended_by in self.extended_by:
- source += " ESX_VI__TEMPLATE__DISPATCH__%s(%s)\n" \
- % (suffix, extended_by)
-
- for extended_by in self.extended_by:
- source += managed_objects_by_name[extended_by] \
- .generate_dispatch(suffix, False)
-
- return source
-
-
- def generate_free_code(self, add_banner=False):
- source = ""
-
- if self.extends is not None:
- source += managed_objects_by_name[self.extends] \
- .generate_free_code(add_banner=True) + "\n"
-
- if self.extends is not None or add_banner:
- source += " /* %s */\n" % self.name
-
- if len(self.properties) < 1:
- source += " /* no properties */\n"
- else:
- string = ""
-
- for property in self.properties:
- string += property.generate_free_code()
-
- if len(string) < 1:
- source += " /* no properties to be freed */\n"
- else:
- source += string
-
- return source
-
-
- def generate_validate_code(self, add_banner=False):
- source = ""
-
- if self.extends is not None:
- source += managed_objects_by_name[self.extends] \
- .generate_validate_code(add_banner=True) + "\n"
-
- if self.extends is not None or add_banner:
- source += " /* %s */\n" % self.name
-
- if len(self.properties) < 1:
- source += " /* no properties */\n"
- else:
- string = ""
-
- for property in self.properties:
- string += property.generate_validate_code(managed=True)
-
- if len(string) < 1:
- source += " /* no required properties */\n"
- else:
- source += string
-
- return source
-
-
def generate_lookup_code1(self, add_banner=False):
source = ""
@@ -1127,30 +982,6 @@ class ManagedObject(Type):
return source
- def generate_comment(self):
- comment = separator
- comment += " * VI Managed Object: %s\n" % self.name
-
- if self.extends is not None:
- comment += " * extends %s\n" % self.extends
-
- first = True
-
- if self.extended_by is not None:
- for extended_by in self.extended_by:
- if first:
- comment += " * extended by %s\n" \
- % extended_by
- first = False
- else:
- comment += " * %s\n" \
- % extended_by
-
- comment += " */\n\n"
-
- return comment
-
-
def generate_header(self):
header = self.generate_comment()
@@ -1169,7 +1000,6 @@ class ManagedObject(Type):
"/* required */\n")
header += "\n"
header += self.generate_struct_members()
-
header += "};\n\n"
# functions
@@ -1213,53 +1043,32 @@ class ManagedObject(Type):
source += "ESX_VI__TEMPLATE__ALLOC(%s)\n\n" % self.name
# free
+ source += "/* esxVI_%s_Free */\n" % self.name
+
if self.extended_by is None:
- source += "/* esxVI_%s_Free */\n" % self.name
source += "ESX_VI__TEMPLATE__FREE(%s,\n" % self.name
- source += "{\n"
-
- if self.features & ManagedObject.FEATURE__LIST:
- if self.extends is not None:
- # avoid "dereferencing type-punned pointer will break
- # strict-aliasing rules" warnings
- source += " esxVI_%s *next = (esxVI_%s *)item->_next;\n\n" \
- % (self.extends, self.extends)
- source += " esxVI_%s_Free(&next);\n" % self.extends
- source += " item->_next = (esxVI_%s *)next;\n\n" % self.name
- else:
- source += " esxVI_%s_Free(&item->_next);\n" % self.name
-
- source += " esxVI_ManagedObjectReference_Free(&item->_reference);\n\n"
-
- source += self.generate_free_code()
-
- source += "})\n\n"
else:
- source += "/* esxVI_%s_Free */\n" % self.name
source += "ESX_VI__TEMPLATE__DYNAMIC_FREE(%s,\n" % self.name
source += "{\n"
-
source += self.generate_dispatch('FREE')
-
source += "},\n"
- source += "{\n"
-
- if self.features & ManagedObject.FEATURE__LIST:
- if self.extends is not None:
- # avoid "dereferencing type-punned pointer will break
- # strict-aliasing rules" warnings
- source += " esxVI_%s *next = (esxVI_%s *)item->_next;\n\n" \
- % (self.extends, self.extends)
- source += " esxVI_%s_Free(&next);\n" % self.extends
- source += " item->_next = (esxVI_%s *)next;\n\n" % self.name
- else:
- source += " esxVI_%s_Free(&item->_next);\n" % self.name
- source += " esxVI_ManagedObjectReference_Free(&item->_reference);\n\n"
+ source += "{\n"
- source += self.generate_free_code()
+ if self.features & ManagedObject.FEATURE__LIST:
+ if self.extends is not None:
+ # avoid "dereferencing type-punned pointer will break
+ # strict-aliasing rules" warnings
+ source += " esxVI_%s *next = (esxVI_%s *)item->_next;\n\n" \
+ % (self.extends, self.extends)
+ source += " esxVI_%s_Free(&next);\n" % self.extends
+ source += " item->_next = (esxVI_%s *)next;\n\n" % self.name
+ else:
+ source += " esxVI_%s_Free(&item->_next);\n" % self.name
- source += "})\n\n"
+ source += " esxVI_ManagedObjectReference_Free(&item->_reference);\n\n"
+ source += self.generate_free_code()
+ source += "})\n\n"
# validate
source += "/* esxVI_%s_Validate */\n" % self.name
@@ -1319,8 +1128,6 @@ class Enum(Type):
header = separator
header += " * VI Enum: %s\n" % self.name
header += " */\n\n"
-
- # enum
header += "enum _esxVI_%s {\n" % self.name
header += " esxVI_%s_Undefined = 0,\n" % self.name
@@ -1354,7 +1161,6 @@ class Enum(Type):
source = separator
source += " * VI Enum: %s\n" % self.name
source += " */\n\n"
-
source += "static const esxVI_Enumeration _esxVI_%s_Enumeration = {\n" \
% self.name
source += " esxVI_Type_%s, {\n" % self.name
--
1.7.9.5
11 years, 6 months
[libvirt] [PATCH] build: Fix build when WITH_HAL is defined
by Jim Fehlig
Commit 7c9a2d88 missed inclusion of virstring.h in a few places
when WITH_HAL is defined, causing build failures.
---
Pushing under build-breaker rule.
src/node_device/node_device_driver.c | 1 +
src/node_device/node_device_hal.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 95df2e5..05dc49c 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -33,6 +33,7 @@
#include "datatypes.h"
#include "viralloc.h"
#include "virlog.h"
+#include "virstring.h"
#include "node_device_conf.h"
#include "node_device_hal.h"
#include "node_device_driver.h"
diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index 63245a9..8c77cc3 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -39,6 +39,7 @@
#include "virlog.h"
#include "node_device_driver.h"
#include "virdbus.h"
+#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_NODEDEV
--
1.8.0.1
11 years, 6 months
[libvirt] [PATCH] build: fix mingw build of virprocess.c
by Eric Blake
Commit 776d49f4 added a static function that is only called
conditionally; leading to this compile error on mingw:
CC libvirt_util_la-virprocess.lo
../../src/util/virprocess.c:624:26: error: 'struct rlimit' declared inside parameter list [-Werror]
../../src/util/virprocess.c:624:26: error: its scope is only this definition or declaration, which is probably not what you want [-Werror]
../../src/util/virprocess.c:622:1: error: 'virProcessPrLimit' defined but not used [-Werror=unused-function]
* src/util/virprocess.c (virProcessPrLimit): Only declare
virProcessPrLimit when used.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule. (Hmm, this one existed
pre-release, which means 1.0.5 doesn't compile on mingw.
Oh well).
src/util/virprocess.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 73f5123..ac93c4a 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -617,7 +617,7 @@ virProcessPrLimit(pid_t pid, int resource, struct rlimit *rlim)
{
return prlimit(pid, resource, rlim, NULL);
}
-#else /* ! HAVE_PRLIMIT */
+#elif HAVE_SETRLIMIT
static int
virProcessPrLimit(pid_t pid ATTRIBUTE_UNUSED,
int resource ATTRIBUTE_UNUSED,
@@ -626,7 +626,7 @@ virProcessPrLimit(pid_t pid ATTRIBUTE_UNUSED,
errno = ENOSYS;
return -1;
}
-#endif /* ! HAVE_PRLIMIT */
+#endif
#if HAVE_SETRLIMIT && defined(RLIMIT_MEMLOCK)
int
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH] build: fix FreeBSD build
by Eric Blake
Commit 7c9a2d88 cleaned up too many headers; FreeBSD builds
failed due to:
util/virutil.c:556: warning: implicit declaration of function 'canonicalize_file_name'
(Not sure which Linux header leaked this declaration, but gnulib
only guarantees it in stdlib.h)
libvirt.c:956: warning: implicit declaration of function 'virGetUserConfigDirectory'
(Here, a build on Linux was picking up virutil.h indirectly via
one of the conditional driver headers, where that driver was not
being built on my FreeBSD setup)
* src/util/virutil.c (includes): Need <stdlib.h> for
canonicalize_file_name.
* src/libvirt.c (includes): Use "virutil.h" unconditionally,
rather than relying on conditional indirect inclusion.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
src/libvirt.c | 1 +
src/util/virutil.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/libvirt.c b/src/libvirt.c
index 15b37a3..467f6dd 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -63,6 +63,7 @@
#include "viruri.h"
#include "virthread.h"
#include "virstring.h"
+#include "virutil.h"
#ifdef WITH_TEST
# include "test/test_driver.h"
diff --git a/src/util/virutil.c b/src/util/virutil.c
index dc14c15..982d4a3 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -29,6 +29,7 @@
#include <dirent.h>
#include <stdio.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH] build: avoid useless virAsprintf
by Eric Blake
virAsprintf(&foo, "%s", bar) is wasteful compared to
foo = strdup(bar) (or eventually, VIR_STRDUP(foo, bar),
but one thing at a time...).
Noticed while reviewing Laine's attempt to clean up broken
qemu:///session.
* cfg.mk (sc_prohibit_asprintf): Enhance rule.
* src/esx/esx_storage_backend_vmfs.c
(esxStorageBackendVMFSVolumeLookupByKey): Fix offender.
* src/network/bridge_driver.c (networkStateInitialize): Likewise.
* src/nwfilter/nwfilter_dhcpsnoop.c (virNWFilterSnoopDHCPOpen):
Likewise.
* src/storage/storage_backend_sheepdog.c
(virStorageBackendSheepdogRefreshVol): Likewise.
* src/util/vircgroup.c (virCgroupAddTaskStrController): Likewise.
* src/util/virdnsmasq.c (addnhostsAdd): Likewise.
* src/xen/block_stats.c (xenLinuxDomainDeviceID): Likewise.
* src/xen/xen_driver.c (xenUnifiedConnectOpen): Likewise.
* tools/virsh.c (vshGetTypedParamValue): Likewise.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
cfg.mk | 4 ++++
src/esx/esx_storage_backend_vmfs.c | 5 ++---
src/network/bridge_driver.c | 9 +++------
src/nwfilter/nwfilter_dhcpsnoop.c | 4 ++--
src/storage/storage_backend_sheepdog.c | 3 ++-
src/util/vircgroup.c | 2 +-
src/util/virdnsmasq.c | 7 ++++---
src/xen/block_stats.c | 8 ++++----
src/xen/xen_driver.c | 2 +-
tools/virsh.c | 2 +-
10 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index d499ded..1d63bbd 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -378,10 +378,14 @@ sc_prohibit_strtol:
$(_sc_search_regexp)
# Use virAsprintf rather than as'printf since *strp is undefined on error.
+# But for plain %s, virAsprintf is overkill compared to strdup.
sc_prohibit_asprintf:
@prohibit='\<v?a[s]printf\>' \
halt='use virAsprintf, not as'printf \
$(_sc_search_regexp)
+ @prohibit='virAsprintf.*, *"%s",' \
+ halt='use strdup instead of virAsprintf with "%s"' \
+ $(_sc_search_regexp)
# Prefer virSetUIDGID.
sc_prohibit_setuid:
diff --git a/src/esx/esx_storage_backend_vmfs.c b/src/esx/esx_storage_backend_vmfs.c
index dea6716..5d6f183 100644
--- a/src/esx/esx_storage_backend_vmfs.c
+++ b/src/esx/esx_storage_backend_vmfs.c
@@ -3,7 +3,7 @@
* esx_storage_backend_vmfs.c: ESX storage driver backend for
* managing VMFS datastores
*
- * Copyright (C) 2010-2011 Red Hat, Inc.
+ * Copyright (C) 2010-2011, 2013 Red Hat, Inc.
* Copyright (C) 2010-2012 Matthias Bolte <matthias.bolte(a)googlemail.com>
* Copyright (C) 2012 Ata E Husain Bohra <ata.husain(a)hotmail.com>
*
@@ -791,8 +791,7 @@ esxStorageBackendVMFSVolumeLookupByKey(virConnectPtr conn, const char *key)
VIR_FREE(datastorePath);
if (length < 1) {
- if (virAsprintf(&volumeName, "%s",
- fileInfo->path) < 0) {
+ if (!(volumeName = strdup(fileInfo->path))) {
virReportOOMError();
goto cleanup;
}
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 35202f1..3ddea18 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -393,12 +393,9 @@ networkStateInitialize(bool privileged,
}
VIR_FREE(userdir);
- userdir = virGetUserConfigDirectory();
- if (virAsprintf(&base, "%s", userdir) == -1) {
- VIR_FREE(userdir);
- goto out_of_memory;
- }
- VIR_FREE(userdir);
+ base = virGetUserConfigDirectory();
+ if (!base)
+ goto error;
}
/* Configuration paths are either ~/.libvirt/qemu/... (session) or
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index df11e89..50042df 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -2,7 +2,7 @@
* nwfilter_dhcpsnoop.c: support for DHCP snooping used by a VM
* on an interface
*
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright (C) 2012-2013 Red Hat, Inc.
* Copyright (C) 2011,2012 IBM Corp.
*
* Authors:
@@ -1110,7 +1110,7 @@ virNWFilterSnoopDHCPOpen(const char *ifname, virMacAddr *mac,
* generate much more traffic than if we filtered by VM and
* braodcast MAC as well
*/
- if (virAsprintf(&ext_filter, "%s", filter) < 0) {
+ if (!(ext_filter = strdup(filter))) {
virReportOOMError();
return NULL;
}
diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c
index a9ee7d3..2e62e6d 100644
--- a/src/storage/storage_backend_sheepdog.c
+++ b/src/storage/storage_backend_sheepdog.c
@@ -1,6 +1,7 @@
/*
* storage_backend_sheepdog.c: storage backend for Sheepdog handling
*
+ * Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2012 Wido den Hollander
* Copyright (C) 2012 Frank Spijkerman
* Copyright (C) 2012 Sebastian Wiedenroth
@@ -268,7 +269,7 @@ virStorageBackendSheepdogRefreshVol(virConnectPtr conn ATTRIBUTE_UNUSED,
}
VIR_FREE(vol->target.path);
- if (virAsprintf(&vol->target.path, "%s", vol->name) == -1) {
+ if (!(vol->target.path = strdup(vol->name))) {
virReportOOMError();
goto cleanup;
}
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index b05fc45..473d2fc 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1027,7 +1027,7 @@ static int virCgroupAddTaskStrController(virCgroupPtr group,
int rc = 0;
char *endp;
- if (virAsprintf(&str, "%s", pidstr) < 0)
+ if (!(str = strdup(pidstr)))
return -1;
cur = str;
diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index 4f05633..36f31d2 100644
--- a/src/util/virdnsmasq.c
+++ b/src/util/virdnsmasq.c
@@ -1,7 +1,7 @@
/*
* virdnsmasq.c: Helper APIs for managing dnsmasq
*
- * Copyright (C) 2007-2012 Red Hat, Inc.
+ * Copyright (C) 2007-2013 Red Hat, Inc.
* Copyright (C) 2010 Satoru SATOH <satoru.satoh(a)gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -118,7 +118,7 @@ addnhostsAdd(dnsmasqAddnHostsfile *addnhostsfile,
if (VIR_ALLOC(addnhostsfile->hosts[idx].hostnames) < 0)
goto alloc_error;
- if (virAsprintf(&addnhostsfile->hosts[idx].ip, "%s", ipstr) < 0)
+ if (!(addnhostsfile->hosts[idx].ip = strdup(ipstr)))
goto alloc_error;
addnhostsfile->hosts[idx].nhostnames = 0;
@@ -128,7 +128,8 @@ addnhostsAdd(dnsmasqAddnHostsfile *addnhostsfile,
if (VIR_REALLOC_N(addnhostsfile->hosts[idx].hostnames, addnhostsfile->hosts[idx].nhostnames + 1) < 0)
goto alloc_error;
- if (virAsprintf(&addnhostsfile->hosts[idx].hostnames[addnhostsfile->hosts[idx].nhostnames], "%s", name) < 0)
+ if (!(addnhostsfile->hosts[idx].hostnames[addnhostsfile->hosts[idx].nhostnames]
+ = strdup(name)))
goto alloc_error;
VIR_FREE(ipstr);
diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c
index 8c18ed5..ded8d7f 100644
--- a/src/xen/block_stats.c
+++ b/src/xen/block_stats.c
@@ -1,7 +1,7 @@
/*
* Linux block and network stats.
*
- * Copyright (C) 2007-2009 Red Hat, Inc.
+ * Copyright (C) 2007-2009, 2013 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
@@ -293,11 +293,11 @@ xenLinuxDomainDeviceID(int domid, const char *path)
*/
if (strlen(path) >= 5 && STRPREFIX(path, "/dev/"))
- retval = virAsprintf(&mod_path, "%s", path);
+ mod_path = strdup(path);
else
- retval = virAsprintf(&mod_path, "/dev/%s", path);
+ ignore_value(virAsprintf(&mod_path, "/dev/%s", path));
- if (retval < 0) {
+ if (!mod_path) {
virReportOOMError();
return -1;
}
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 938205e..6ad050c 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -443,7 +443,7 @@ xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int f
}
#endif
- if (virAsprintf(&priv->saveDir, "%s", XEN_SAVE_DIR) == -1) {
+ if (!(priv->saveDir = strdup(XEN_SAVE_DIR))) {
virReportOOMError();
goto fail;
}
diff --git a/tools/virsh.c b/tools/virsh.c
index 22bcec2..7ef0bda 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2181,7 +2181,7 @@ vshGetTypedParamValue(vshControl *ctl, virTypedParameterPtr item)
break;
case VIR_TYPED_PARAM_BOOLEAN:
- ret = virAsprintf(&str, "%s", item->value.b ? _("yes") : _("no"));
+ str = vshStrdup(ctl, item->value.b ? _("yes") : _("no"));
break;
case VIR_TYPED_PARAM_STRING:
--
1.8.1.4
11 years, 6 months
[libvirt] libvirt quietly dies (on keep-alive error handling?)
by Igor Lukyanov
Hi all,
we detected a floating bug of 1.0.2 version.
Libvirtd mysteriously and quietly dies (without core dumps or entries in dmesg/syslog) with the following log messages.
If you have any ideas of what it might be and how to deal with it - please give a hint. Many thanks.
Here is the tail of libvirtd.log:
2013-04-30 11:47:46.020+000053093: info : qemuDomainUndefineFlags:5784 : Undefining domain 'vm010-002-048-002'
2013-04-30 11:47:46.195+000053087: debug : qemuDomObjFromDomainDriver:213 : Domain not found: no domain with matching uuid '52ab57f1-e198-9bd7-6ef8-74b9d34e7b03'
2013-05-01 21:00:30.997+000053085: warning : qemuDomainObjTaint:1376 : Domain id=170 name='vm010-002-060-007' uuid=41acb52e-96c0-0fe6-4d63-39d6560bc882 is tainted: custom-monitor
2013-05-02 18:37:10.430+000053084: warning : virKeepAliveTimerInternal:141 : No response from client 0x88d200 after 5 keepalive messages in 30 seconds
2013-05-02 18:37:14.251+000053084: warning : virKeepAliveTimerInternal:141 : No response from client 0x8858e0 after 5 keepalive messages in 31 seconds
2013-05-02 18:37:14.251+000053084: warning : virKeepAliveTimerInternal:141 : No response from client 0x88e940 after 5 keepalive messages in 32 seconds
2013-05-02 18:37:14.251+000053084: warning : virKeepAliveTimerInternal:141 : No response from client 0x897410 after 5 keepalive messages in 32 seconds
2013-05-02 18:37:14.251+000053084: warning : virKeepAliveTimerInternal:141 : No response from client 0x8901c0 after 5 keepalive messages in 32 seconds
2013-05-02 18:37:14.251+000053084: warning : virKeepAliveTimerInternal:141 : No response from client 0x894c50 after 5 keepalive messages in 33 seconds
2013-05-02 18:37:14.251+000053084: warning : virKeepAliveTimerInternal:141 : No response from client 0x884ef0 after 5 keepalive messages in 32 seconds
2013-05-02 18:37:14.251+000053084: warning : virKeepAliveTimerInternal:141 : No response from client 0x87df20 after 5 keepalive messages in 31 seconds
2013-05-02 18:37:14.251+000053084: warning : virKeepAliveTimerInternal:141 : No response from client 0x8832e0 after 5 keepalive messages in 32 seconds
2013-05-02 18:37:14.251+000053084: warning : virKeepAliveTimerInternal:141 : No response from client 0x87dc40 after 5 keepalive messages in 32 seconds
2013-05-02 18:37:14.251+000053084: error : virFDStreamRemoveCallback:83 : internal error stream is not open
2013-05-02 18:37:14.681+000053091: error : virFDStreamRemoveCallback:83 : internal error stream is not open
====== end of log =====
2013-05-02 18:47:28.464+0000: 97308: info : libvirt version: 1.0.2
--
wbr, Igor Lukyanov
11 years, 6 months
[libvirt] [PATCH] network: fix network driver startup for qemu:///session
by Laine Stump
This should resolve https://bugzilla.redhat.com/show_bug.cgi?id=958907
Recent new addition of code to read/write active network state to the
NETWORK_STATE_DIR in the network driver broke startup for
qemu:///session. The network driver had several state file paths
hardcoded to /var, which could never possibly work in session mode.
This patch modifies *all* state files to use a variable string that is
set differently according to whether or not we're running privileged.
There are very definitely other problems preventing dnsmasq and radvd
from running in non-privileged mode, but it's more consistent to have
the directories used by them be determined in the same fashion.
---
src/network/bridge_driver.c | 155 ++++++++++++++++++++++++++++----------------
1 file changed, 100 insertions(+), 55 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 35202f1..fb00645 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -1,4 +1,3 @@
-
/*
* bridge_driver.c: core driver methods for managing network
*
@@ -67,11 +66,11 @@
#include "virfile.h"
#include "virstring.h"
-#define NETWORK_PID_DIR LOCALSTATEDIR "/run/libvirt/network"
-#define NETWORK_STATE_DIR LOCALSTATEDIR "/lib/libvirt/network"
+#define NETWORK_PID_DIR "/run/libvirt/network"
+#define NETWORK_STATE_DIR "/lib/libvirt/network"
-#define DNSMASQ_STATE_DIR LOCALSTATEDIR "/lib/libvirt/dnsmasq"
-#define RADVD_STATE_DIR LOCALSTATEDIR "/lib/libvirt/radvd"
+#define DNSMASQ_STATE_DIR "/lib/libvirt/dnsmasq"
+#define RADVD_STATE_DIR "/lib/libvirt/radvd"
#define VIR_FROM_THIS VIR_FROM_NETWORK
@@ -84,6 +83,10 @@ struct network_driver {
iptablesContext *iptables;
char *networkConfigDir;
char *networkAutostartDir;
+ char *stateDir;
+ char *pidDir;
+ char *dnsmasqStateDir;
+ char *radvdStateDir;
char *logDir;
dnsmasqCapsPtr dnsmasqCaps;
};
@@ -133,8 +136,8 @@ networkDnsmasqLeaseFileNameDefault(const char *netname)
{
char *leasefile;
- ignore_value(virAsprintf(&leasefile, DNSMASQ_STATE_DIR "/%s.leases",
- netname));
+ ignore_value(virAsprintf(&leasefile, "%s/%s.leases",
+ driverState->dnsmasqStateDir, netname));
return leasefile;
}
@@ -146,8 +149,8 @@ networkDnsmasqConfigFileName(const char *netname)
{
char *conffile;
- ignore_value(virAsprintf(&conffile, DNSMASQ_STATE_DIR "/%s.conf",
- netname));
+ ignore_value(virAsprintf(&conffile, "%s/%s.conf",
+ driverState->dnsmasqStateDir, netname));
return conffile;
}
@@ -166,8 +169,8 @@ networkRadvdConfigFileName(const char *netname)
{
char *configfile;
- ignore_value(virAsprintf(&configfile, RADVD_STATE_DIR "/%s-radvd.conf",
- netname));
+ ignore_value(virAsprintf(&configfile, "%s/%s-radvd.conf",
+ driverState->radvdStateDir, netname));
return configfile;
}
@@ -187,8 +190,10 @@ networkRemoveInactive(struct network_driver *driver,
int ret = -1;
/* remove the (possibly) existing dnsmasq and radvd files */
- if (!(dctx = dnsmasqContextNew(def->name, DNSMASQ_STATE_DIR)))
+ if (!(dctx = dnsmasqContextNew(def->name,
+ driverState->dnsmasqStateDir))) {
goto cleanup;
+ }
if (!(leasefile = networkDnsmasqLeaseFileName(def->name)))
goto cleanup;
@@ -202,7 +207,8 @@ networkRemoveInactive(struct network_driver *driver,
if (!(configfile = networkDnsmasqConfigFileName(def->name)))
goto no_memory;
- if (!(statusfile = virNetworkConfigFile(NETWORK_STATE_DIR, def->name)))
+ if (!(statusfile
+ = virNetworkConfigFile(driverState->stateDir, def->name)))
goto no_memory;
/* dnsmasq */
@@ -212,7 +218,7 @@ networkRemoveInactive(struct network_driver *driver,
/* radvd */
unlink(radvdconfigfile);
- virPidFileDelete(NETWORK_PID_DIR, radvdpidbase);
+ virPidFileDelete(driverState->pidDir, radvdpidbase);
/* remove status file */
unlink(statusfile);
@@ -279,7 +285,7 @@ networkFindActiveConfigs(struct network_driver *driver)
if (obj->def->ips && (obj->def->nips > 0)) {
char *radvdpidbase;
- ignore_value(virPidFileReadIfAlive(NETWORK_PID_DIR, obj->def->name,
+ ignore_value(virPidFileReadIfAlive(driverState->pidDir, obj->def->name,
&obj->dnsmasqPid,
dnsmasqCapsGetBinaryPath(driver->dnsmasqCaps)));
@@ -287,7 +293,7 @@ networkFindActiveConfigs(struct network_driver *driver)
virReportOOMError();
goto cleanup;
}
- ignore_value(virPidFileReadIfAlive(NETWORK_PID_DIR, radvdpidbase,
+ ignore_value(virPidFileReadIfAlive(driverState->pidDir, radvdpidbase,
&obj->radvdPid, RADVD));
VIR_FREE(radvdpidbase);
}
@@ -374,27 +380,59 @@ networkStateInitialize(bool privileged,
networkDriverLock(driverState);
if (privileged) {
- if (virAsprintf(&driverState->logDir,
- "%s/log/libvirt/qemu", LOCALSTATEDIR) == -1)
- goto out_of_memory;
-
- if ((base = strdup(SYSCONFDIR "/libvirt")) == NULL)
+ if (((base = strdup(SYSCONFDIR "/libvirt")) == NULL) ||
+ ((driverState->logDir
+ = strdup(LOCALSTATEDIR "/log/libvirt/qemu")) == NULL) ||
+ ((driverState->stateDir
+ = strdup(LOCALSTATEDIR NETWORK_STATE_DIR)) == NULL) ||
+ ((driverState->pidDir
+ = strdup(LOCALSTATEDIR NETWORK_PID_DIR)) == NULL) ||
+ ((driverState->dnsmasqStateDir
+ = strdup(LOCALSTATEDIR DNSMASQ_STATE_DIR)) == NULL) ||
+ ((driverState->radvdStateDir
+ = strdup(LOCALSTATEDIR RADVD_STATE_DIR)) == NULL)) {
goto out_of_memory;
+ }
} else {
char *userdir = virGetUserCacheDirectory();
if (!userdir)
goto error;
+ userdir = virGetUserConfigDirectory();
+ if (virAsprintf(&base, "%s", userdir) < 0) {
+ VIR_FREE(userdir);
+ goto out_of_memory;
+ }
+ VIR_FREE(userdir);
+
if (virAsprintf(&driverState->logDir,
- "%s/qemu/log", userdir) == -1) {
+ "%s/qemu/log", userdir) < 0) {
VIR_FREE(userdir);
goto out_of_memory;
}
VIR_FREE(userdir);
- userdir = virGetUserConfigDirectory();
- if (virAsprintf(&base, "%s", userdir) == -1) {
+ if (!(userdir = virGetUserRuntimeDirectory()))
+ goto error;
+
+ if (virAsprintf(&driverState->stateDir,
+ "%s" NETWORK_STATE_DIR, userdir) < 0) {
+ VIR_FREE(userdir);
+ goto out_of_memory;
+ }
+ if (virAsprintf(&driverState->pidDir,
+ "%s" NETWORK_PID_DIR, userdir) < 0) {
+ VIR_FREE(userdir);
+ goto out_of_memory;
+ }
+ if (virAsprintf(&driverState->dnsmasqStateDir,
+ "%s" DNSMASQ_STATE_DIR, userdir) < 0) {
+ VIR_FREE(userdir);
+ goto out_of_memory;
+ }
+ if (virAsprintf(&driverState->radvdStateDir,
+ "%s" RADVD_STATE_DIR, userdir) < 0) {
VIR_FREE(userdir);
goto out_of_memory;
}
@@ -404,12 +442,12 @@ networkStateInitialize(bool privileged,
/* Configuration paths are either ~/.libvirt/qemu/... (session) or
* /etc/libvirt/qemu/... (system).
*/
- if (virAsprintf(&driverState->networkConfigDir, "%s/qemu/networks", base) == -1)
- goto out_of_memory;
-
- if (virAsprintf(&driverState->networkAutostartDir, "%s/qemu/networks/autostart",
- base) == -1)
+ if ((virAsprintf(&driverState->networkConfigDir,
+ "%s/qemu/networks", base) < 0) ||
+ (virAsprintf(&driverState->networkAutostartDir,
+ "%s/qemu/networks/autostart", base) < 0)) {
goto out_of_memory;
+ }
VIR_FREE(base);
@@ -421,7 +459,7 @@ networkStateInitialize(bool privileged,
driverState->dnsmasqCaps = dnsmasqCapsNewFromBinary(DNSMASQ);
if (virNetworkLoadAllState(&driverState->networks,
- NETWORK_STATE_DIR) < 0)
+ driverState->stateDir) < 0)
goto error;
if (virNetworkLoadAllConfigs(&driverState->networks,
@@ -489,7 +527,7 @@ networkStateReload(void) {
networkDriverLock(driverState);
virNetworkLoadAllState(&driverState->networks,
- NETWORK_STATE_DIR);
+ driverState->stateDir);
virNetworkLoadAllConfigs(&driverState->networks,
driverState->networkConfigDir,
driverState->networkAutostartDir);
@@ -1060,32 +1098,33 @@ networkStartDhcpDaemon(struct network_driver *driver,
goto cleanup;
}
- if (virFileMakePath(NETWORK_PID_DIR) < 0) {
+ if (virFileMakePath(driverState->pidDir) < 0) {
virReportSystemError(errno,
_("cannot create directory %s"),
- NETWORK_PID_DIR);
+ driverState->pidDir);
goto cleanup;
}
- if (virFileMakePath(NETWORK_STATE_DIR) < 0) {
+ if (virFileMakePath(driverState->stateDir) < 0) {
virReportSystemError(errno,
_("cannot create directory %s"),
- NETWORK_STATE_DIR);
+ driverState->stateDir);
goto cleanup;
}
- if (!(pidfile = virPidFileBuildPath(NETWORK_PID_DIR, network->def->name))) {
+ if (!(pidfile = virPidFileBuildPath(driverState->pidDir,
+ network->def->name))) {
virReportOOMError();
goto cleanup;
}
- if (virFileMakePath(DNSMASQ_STATE_DIR) < 0) {
+ if (virFileMakePath(driverState->dnsmasqStateDir) < 0) {
virReportSystemError(errno,
_("cannot create directory %s"),
- DNSMASQ_STATE_DIR);
+ driverState->dnsmasqStateDir);
goto cleanup;
}
- dctx = dnsmasqContextNew(network->def->name, DNSMASQ_STATE_DIR);
+ dctx = dnsmasqContextNew(network->def->name, driverState->dnsmasqStateDir);
if (dctx == NULL)
goto cleanup;
@@ -1113,7 +1152,7 @@ networkStartDhcpDaemon(struct network_driver *driver,
* pid
*/
- ret = virPidFileRead(NETWORK_PID_DIR, network->def->name,
+ ret = virPidFileRead(driverState->pidDir, network->def->name,
&network->dnsmasqPid);
if (ret < 0)
goto cleanup;
@@ -1150,8 +1189,10 @@ networkRefreshDhcpDaemon(struct network_driver *driver,
return networkStartDhcpDaemon(driver, network);
VIR_INFO("Refreshing dnsmasq for network %s", network->def->bridge);
- if (!(dctx = dnsmasqContextNew(network->def->name, DNSMASQ_STATE_DIR)))
+ if (!(dctx = dnsmasqContextNew(network->def->name,
+ driverState->dnsmasqStateDir))) {
goto cleanup;
+ }
/* Look for first IPv4 address that has dhcp defined.
* We only support dhcp-host config on one IPv4 subnetwork
@@ -1375,16 +1416,16 @@ networkStartRadvd(struct network_driver *driver ATTRIBUTE_UNUSED,
goto cleanup;
}
- if (virFileMakePath(NETWORK_PID_DIR) < 0) {
+ if (virFileMakePath(driverState->pidDir) < 0) {
virReportSystemError(errno,
_("cannot create directory %s"),
- NETWORK_PID_DIR);
+ driverState->pidDir);
goto cleanup;
}
- if (virFileMakePath(RADVD_STATE_DIR) < 0) {
+ if (virFileMakePath(driverState->radvdStateDir) < 0) {
virReportSystemError(errno,
_("cannot create directory %s"),
- RADVD_STATE_DIR);
+ driverState->radvdStateDir);
goto cleanup;
}
@@ -1393,7 +1434,7 @@ networkStartRadvd(struct network_driver *driver ATTRIBUTE_UNUSED,
virReportOOMError();
goto cleanup;
}
- if (!(pidfile = virPidFileBuildPath(NETWORK_PID_DIR, radvdpidbase))) {
+ if (!(pidfile = virPidFileBuildPath(driverState->pidDir, radvdpidbase))) {
virReportOOMError();
goto cleanup;
}
@@ -1421,7 +1462,7 @@ networkStartRadvd(struct network_driver *driver ATTRIBUTE_UNUSED,
if (virCommandRun(cmd, NULL) < 0)
goto cleanup;
- if (virPidFileRead(NETWORK_PID_DIR, radvdpidbase, &network->radvdPid) < 0)
+ if (virPidFileRead(driverState->pidDir, radvdpidbase, &network->radvdPid) < 0)
goto cleanup;
ret = 0;
@@ -1448,7 +1489,7 @@ networkRefreshRadvd(struct network_driver *driver ATTRIBUTE_UNUSED,
network->def->name) >= 0) &&
((radvdpidbase = networkRadvdPidfileBasename(network->def->name))
!= NULL)) {
- virPidFileDelete(NETWORK_PID_DIR, radvdpidbase);
+ virPidFileDelete(driverState->pidDir, radvdpidbase);
VIR_FREE(radvdpidbase);
}
network->radvdPid = -1;
@@ -1488,7 +1529,7 @@ networkRestartRadvd(struct network_driver *driver,
network->def->name) >= 0) &&
((radvdpidbase = networkRadvdPidfileBasename(network->def->name))
!= NULL)) {
- virPidFileDelete(NETWORK_PID_DIR, radvdpidbase);
+ virPidFileDelete(driverState->pidDir, radvdpidbase);
VIR_FREE(radvdpidbase);
}
network->radvdPid = -1;
@@ -2572,7 +2613,7 @@ static int networkShutdownNetworkVirtual(struct network_driver *driver,
if (!(radvdpidbase = networkRadvdPidfileBasename(network->def->name))) {
virReportOOMError();
} else {
- virPidFileDelete(NETWORK_PID_DIR, radvdpidbase);
+ virPidFileDelete(driverState->pidDir, radvdpidbase);
VIR_FREE(radvdpidbase);
}
}
@@ -2673,7 +2714,8 @@ networkStartNetwork(struct network_driver *driver,
/* Persist the live configuration now that anything autogenerated
* is setup.
*/
- if ((ret = virNetworkSaveStatus(NETWORK_STATE_DIR, network)) < 0) {
+ if ((ret = virNetworkSaveStatus(driverState->stateDir,
+ network)) < 0) {
goto error;
}
@@ -2703,7 +2745,8 @@ static int networkShutdownNetwork(struct network_driver *driver,
if (!virNetworkObjIsActive(network))
return 0;
- stateFile = virNetworkConfigFile(NETWORK_STATE_DIR, network->def->name);
+ stateFile = virNetworkConfigFile(driverState->stateDir,
+ network->def->name);
if (!stateFile)
return -1;
@@ -3368,8 +3411,10 @@ networkUpdate(virNetworkPtr net,
}
/* save current network state to disk */
- if ((ret = virNetworkSaveStatus(NETWORK_STATE_DIR, network)) < 0)
+ if ((ret = virNetworkSaveStatus(driverState->stateDir,
+ network)) < 0) {
goto cleanup;
+ }
}
ret = 0;
cleanup:
@@ -4702,7 +4747,7 @@ networkPlugBandwidth(virNetworkObjPtr net,
/* update sum of 'floor'-s of attached NICs */
net->floor_sum += ifaceBand->in->floor;
/* update status file */
- if (virNetworkSaveStatus(NETWORK_STATE_DIR, net) < 0) {
+ if (virNetworkSaveStatus(driverState->stateDir, net) < 0) {
ignore_value(virBitmapClearBit(net->class_id, class_id));
net->floor_sum -= ifaceBand->in->floor;
iface->data.network.actual->class_id = 0;
@@ -4748,7 +4793,7 @@ networkUnplugBandwidth(virNetworkObjPtr net,
ignore_value(virBitmapClearBit(net->class_id,
iface->data.network.actual->class_id));
/* update status file */
- if (virNetworkSaveStatus(NETWORK_STATE_DIR, net) < 0) {
+ if (virNetworkSaveStatus(driverState->stateDir, net) < 0) {
net->floor_sum += ifaceBand->in->floor;
ignore_value(virBitmapSetBit(net->class_id,
iface->data.network.actual->class_id));
--
1.7.11.7
11 years, 6 months
[libvirt] [PATCH v2 0/2] qemu: support new HyperV-related features
by Ján Tomko
1/2 prevents memory leaks and hair loss in qemuParseCommandLineCPU
2/2 adds support for the new cpu flags
v1:
https://www.redhat.com/archives/libvir-list/2013-May/msg00173.html
v2:
uses virStringSplit instead of strsep
added a missing break to virDomainDefParseXML
Ján Tomko (2):
qemu: simplify CPU command line parsing
qemu: add hv_vapic and hv_spinlocks support
docs/formatdomain.html.in | 17 ++-
docs/schemas/domaincommon.rng | 12 ++
src/conf/domain_conf.c | 40 +++++-
src/conf/domain_conf.h | 3 +
src/qemu/qemu_command.c | 168 +++++++++++++-----------
tests/qemuxml2argvdata/qemuxml2argv-hyperv.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-hyperv.xml | 2 +
7 files changed, 164 insertions(+), 80 deletions(-)
--
1.8.1.5
11 years, 6 months
[libvirt] Release of libvirt-1.0.5
by Daniel Veillard
I forgot to make the rc2 release on tuesday, but looking at the
git state it was looking like the problem reported on rc1 had been
fixed, so I decided to go ahead and roll the release as scheduled
today. It is tagged in git and the tarball is available as usual at:
ftp://libvirt.org/libvirt/
along with rpms. This release contains an homogenous set of features, bug
fixes and improvements with some refactoring done in various places.
It also includes more localization updates now coming from the Fedora
localization project, with around 6 languages fully localized and 3 more
over the 70% threshold:
Features:
- Add NVRAM device (Li Zhang)
- Add XML config for resource partitions (Daniel P. Berrange)
- Add support for TPM (Stefan Berger)
- NPIV storage migration support (Osier Yang)
Documentation:
- Fix closing tag in snapshot documentation (Christophe Fergeau)
- Fix typo in augeas comment (Martin Kletzander)
- Fix VIR_DOMAIN_EVENT_ID_PMSUSPEND capitalization in API doc (Christophe Fergeau)
- Improve /domainsnapshot/disks/disk@snapshot doc (Christophe Fergeau)
- fix memballoon examples (Ján Tomko)
- Clarify usage of SELinux baselabel (Peter Krempa)
- fix usage of 'onto' (Eric Blake)
- Update HACKING (Osier Yang)
- conf: fix comment about parsing graphics listen address (Ján Tomko)
- lib: Fix docs about return value of virDomainGetVcpusFlags() (Peter Krempa)
- virsh: Document that using incomplete XML files may have unexpected results (Peter Krempa)
- fix typo when using Kerberos principals (Eric Blake)
- use MiB/s instead of Mbps for migration speed (Ján Tomko)
- Add the missed <pre> tag (Osier Yang)
- virsh: Fix typo in docs (Peter Krempa)
- manual: Fix copy-paste errors (Martin Kletzander)
- manual: Add info about migrateuri in virsh manual (Martin Kletzander)
Portability:
- virInitctlRequest: Don't hardcode 384 bytes size (Guido Günther)
- S390: Do not generate a default USB controller (Viktor Mihajlovski)
- S390: Mention changed USB behavior (Viktor Mihajlovski)
- build: fix cygwin build in virnetdev (Eric Blake)
- portability: handle ifreq differences in virnetdev (Roman Bogorodskiy)
- qemu: fix build error with older platforms (Eric Blake)
- Fix compilation error in util/vircgroup.c (Stefan Berger)
- Conditionally compile storagevolxml2argvtest (Daniel P. Berrange)
- Fix signature of dummy virNetlinkCommand stub (Daniel P. Berrange)
- Add empty stub for virThreadCancel on Win32 (Daniel P. Berrange)
- Don't enable -fPIE on Win32 platforms (Daniel P. Berrange)
- spec: Require pod2man when running autoreconf (Jiri Denemark)
- Avoid cast alignment warnings in port allocator test (Daniel P. Berrange)
Bug Fixes:
- pci: autolearn name of stub driver, remove from arglist (Laine Stump)
- ESX: Fix DISPATCH_FREE generation code to free all extended objects (Ata E Husain Bohra)
- qemu: fix failure to start with spice graphics and no tls (Laine Stump)
- Need to call virFreeError after virSaveLastError (John Ferlan)
- libvirt-guests: status: return non-zero when stopped (Ján Tomko)
- security driver: eliminate memory leaks in failure paths (Laine Stump)
- libxl: Fix double-dispose of libxl domain config (Jim Fehlig)
- virsh: fix incorrect argument errors for long options (Ján Tomko)
- network: Don't remove transient network if creating of config file fails (Peter Krempa)
- qemu: prevent invalid reads in qemuAssignDevicePCISlots (Ján Tomko)
- qemu: don't assign a PCI address to 'none' USB controller (Ján Tomko)
- fix segfault during virsh save in pv guest (Bamvor Jian Zhang)
- conf: reject controllers with duplicate indexes (Ján Tomko)
- fix typo introduced by 90430791 (Bamvor Jian Zhang)
- Fix usb master startport parsing (Martin Kletzander)
- qemu_conf: Don't discard strdup OOM error (Michal Privoznik)
- util: Error out if the numa nodeset is out of range (Osier Yang)
- selinux: Don't mask errors of virSecuritySELinuxGenNewContext (Peter Krempa)
- qemu: Fix the wrong expression (Osier Yang)
- audit: properly encode device path in cgroup audit (Eric Blake)
- network: bridge_driver: don't lose transient networks on daemon restart (Peter Krempa)
- qemu: fix default spice password setting (Ján Tomko)
- Fix build breaker with ATTRIBUTE_NONNULL defs (John Ferlan)
- Resolve valgrind error (John Ferlan)
- Do more complete initialization of libgcrypt (Daniel P. Berrange)
- qemu: Set correct migrate host in client_migrate_info (Michal Privoznik)
- qemu: fix crash in qemuOpen (Ján Tomko)
- conf: fix error for parallel port mismatch (Ján Tomko)
- conf: fix a memory leak when parsing nat port XML nodes (Guannan Ren)
- conf: Fix race between looking up a domain object and freeing it (Peter Krempa)
- Fix crash in virNetDevGetVirtualFunctions (Laine Stump)
- schemas: Move PortNumber and sourceinfoadapter to basictypes.rng (Han Cheng)
- virsh: Unregister the connection close notifier upon termination (Viktor Mihajlovski)
- libvirt: Increase connection reference count for callbacks (Viktor Mihajlovski)
- storage: Fix volume cloning for logical volume. (Atsushi Kumagai)
- security_manager: fix comparison (Guido Günther)
- qemu: fix memory leak on -machine usage error (Eric Blake)
- qemu-blockjob: Fix limit of bandwidth for block jobs to supported value (Peter Krempa)
- sec_manager: Refuse to start domain with unsupported seclabel (Michal Privoznik)
- qemu: Fix crash when updating media with shared device (Peter Krempa)
- virsh: Call virDomainFree in cmdDomFSTrim (Michal Privoznik)
- smartcard: spell ccid-card-emulated qemu property correctly (Eric Blake)
- Resolve valgrind failure (John Ferlan)
Improvements:
- spec: collect all BuildRequires into one area (Eric Blake)
- Resolve valgrind error (John Ferlan)
- esx: Support virtualHW version 9 (Martin Kletzander)
- build: mark conditionally unused variables (Eric Blake)
- virsh: clarify vol-{down,up}load description (Ján Tomko)
- qemu: report an error if memballoon has wrong address type (Ján Tomko)
- qemu: assign addresses when converting xml to native (Ján Tomko)
- qemu: Error out if spice port autoallocation is requested, but disabled (Peter Krempa)
- qemu: put usb cgroup setup in common function (Laine Stump)
- qemu: add vfio devices to cgroup ACL when appropriate (Laine Stump)
- qemu: honor allowDiskFormatProbing when parsing command line (Ján Tomko)
- conf: add missing error on OOM (Ján Tomko)
- qemu: don't always reserve PCI addresses for implicit controllers (Ján Tomko)
- conf: remove extraneous _TYPE from driver backend enums (Laine Stump)
- network: support <driver name='vfio'/> in network definitions (Laine Stump)
- qemu: launch bridge helper from libvirtd (Paolo Bonzini)
- virnetdevtap: add virNetDevTapGetName (Paolo Bonzini)
- qemu: set qemu process' RLIMIT_MEMLOCK when VFIO is used (Laine Stump)
- qemu: use new virCommandSetMax(Processes|Files) (Laine Stump)
- util: new virCommandSetMax(MemLock|Processes|Files) (Laine Stump)
- Do proper escaping of cgroup resource partitions (Daniel P. Berrange)
- Ensure all cgroup partitions have a suffix of ".partition" (Daniel P. Berrange)
- Change VM cgroup suffix from '{lxc,qemu}.libvirt' to 'libvirt-{lxc,qemu}' (Daniel P. Berrange)
- test: Add JSON test for query-tpm-types (Stefan Berger)
- virsh: suppress aliases in group help (Eric Blake)
- security: update hostdev labelling functions for VFIO (Laine Stump)
- util: new function virPCIDeviceGetVFIOGroupDev (Laine Stump)
- virsh: use new virNodeDeviceDetachFlags (Laine Stump)
- xen: implement virNodeDeviceDetachFlags backend (Laine Stump)
- qemu: implement virNodeDeviceDetachFlags backend (Laine Stump)
- hypervisor api: implement RPC calls for virNodeDeviceDetachFlags (Laine Stump)
- hypervisor api: new virNodeDeviceDetachFlags (Laine Stump)
- qemu: bind/unbind stub driver according to config <driver name='x'/> (Laine Stump)
- pci: keep a stubDriver in each virPCIDevice (Laine Stump)
- qemu: use vfio-pci on commandline when appropriate (Laine Stump)
- conf: formatter/parser/RNG/docs for hostdev <driver name='kvm|vfio'/> (Laine Stump)
- conf: put hostdev pci address in a struct (Laine Stump)
- qemu: detect vfio-pci device and its bootindex parameter (Laine Stump)
- build: avoid unsafe functions in libgen.h (Eric Blake)
- qemu: auto-add pci-root to 'pc-i440*' machines too (Ján Tomko)
- qemu: auto-add bridges and allow using them (Ján Tomko)
- qemu: auto-add pci-root controller for pc machine types (Ján Tomko)
- qemu: build command line for pci-bridge device (liguang)
- conf: add PCI controllers (Ján Tomko)
- qemu: call post-parse callbacks when parsing command line too (Ján Tomko)
- qemu: Add command line builder and parser for NVRAM. (Li Zhang)
- qemuBuildCommandLine: Don't overwrite errors with NWFilter's one (Michal Privoznik)
- Introduce a sub-element <driver> for controller (Osier Yang)
- qemu: Don't require a block or file when looking for an alias (Wido den Hollander)
- Change the tag name "num_queues" into "queues" (Osier Yang)
- qemu: Improve handling of channels when generating SPICE command line (Peter Krempa)
- qemu: Do sensible auto allocation of SPICE port numbers (Peter Krempa)
- Make driver method names consistent with public APIs (Daniel P. Berrange)
- Dedicated name for sub-driver open/close methods (Daniel P. Berrange)
- Rename 'DeviceMonitor' to 'NodeDeviceDriver' (Daniel P. Berrange)
- Extend previous check to validate driver struct field names (Daniel P. Berrange)
- Ensure driver method names match public API names (Daniel P. Berrange)
- Make naming of remote procedures match API names exactly (Daniel P. Berrange)
- Cleanup command line options in gendispatch.pl (Daniel P. Berrange)
- qemu: Split out SPICE port allocation into a separate function (Peter Krempa)
- qemu: Use switch instead of ifs in qemuBuildGraphicsCommandLine (Peter Krempa)
- qemu: Split out code to generate VNC command line (Peter Krempa)
- qemu: Split out code to generate SPICE command line (Peter Krempa)
- qemu: Use -machine accel=tcg|kvm when available (Jiri Denemark)
- qemu: Move -enable-kvm and friends earlier in the command line (Jiri Denemark)
- Switch to a more extensible annotation system for RPC protocols (Daniel P. Berrange)
- qemu: Fix setting of memory tunables (Peter Krempa)
- logging: Make log regexp more compact (and readable) (Jiri Denemark)
- qemu: Ignore libvirt logs when reading QEMU error output (Jiri Denemark)
- qemu: Move QEMU log reading into a separate function (Jiri Denemark)
- update input ip processing (Gene Czarcinski)
- create virSocketAddrGetIpPrefix utility function (Gene Czarcinski)
- Replace more cases of /system with /machine (Daniel P. Berrange)
- Change default resource partition to /machine (Daniel P. Berrange)
- qemu: rename CheckSlot to SlotInUse (Ján Tomko)
- qemu: switch PCI address set from hash table to an array (Ján Tomko)
- conf: add model attribute to virDomainDefMaybeAddController (Ján Tomko)
- qemu: move PCI address check out of qemuPCIAddressAsString (Ján Tomko)
- qemu: QEMU_PCI constant consistency (Ján Tomko)
- qemu: print PCI address hexadecimally in errors (Ján Tomko)
- qemu: make qemuComparePCIDevice aware of multiple buses (Ján Tomko)
- conf: Reword error message to be more universal (Peter Krempa)
- cpu: Rename PowerPCUpdate and PowerPCDataFree functions (Jiri Denemark)
- cpu: Remove hardcoded list of PowerPC models (Jiri Denemark)
- cpu: Reimplement PowerPCDecode (Jiri Denemark)
- cpu: Reimplement PowerPCBaseline (Jiri Denemark)
- cpu: Fix loading PowerPC vendor from cpu_map.xml (Jiri Denemark)
- cpu: Fix PowerPCNodeData (Jiri Denemark)
- cpu: Make comparing PowerPC CPUs easier to read (Jiri Denemark)
- cpu: Introduce cpuModelIsAllowed internal API (Jiri Denemark)
- virsh-domain: Refactor cmdVcpucount and fix output on inactive domains (Peter Krempa)
- Set legacy USB option with default for ppc64. (Li Zhang)
- qemu_conf: add new configuration key bridge_helper (Paolo Bonzini)
- util: allow using virCommandAllowCap with setuid helpers (Paolo Bonzini)
- util: simplify virSetUIDGIDWithCaps (Paolo Bonzini)
- virsh-domain: Report errors on invalid --holdtime value for cmdSendKey (Peter Krempa)
- virsh-domain: Clean up cmdSendKey (Peter Krempa)
- qemu: simplify use of virArchFromHost (Tal Kain)
- rng: tighten up domain <controller> schema (Laine Stump)
- network: remove autostart flag from network when undefining it (Peter Krempa)
- syntax-check: Only allows to include public headers in external tools (Osier Yang)
- syntax-check: Don't include public headers in internal source (Osier Yang)
- syntax-check: Don't include duplicate header (Osier Yang)
- qemu: Allow the disk wwn to have "0x" prefix (Osier Yang)
- cleanup: Don't include libvirt/virterror.h (Osier Yang)
- cleanup: Don't include libvirt/libvirt.h (Osier Yang)
- cleanup: Remove the duplicate header (Osier Yang)
- cleanup: Only include testutils.h once (Osier Yang)
- Check for unsupported QMP command (Stefan Berger)
- qemu_agent: Add support for appending arrays to commands (Peter Krempa)
- Add support for perf_event and net_cls cgroup controllers (Daniel P. Berrange)
- Replace LXC cgroup mount code with call to virCgroupIsolateMount (Daniel P. Berrange)
- Add an API for re-mounting cgroups, to isolate the process location (Daniel P. Berrange)
- Track symlinks for co-mounted cgroup controllers (Daniel P. Berrange)
- Remove non-functional code for setting up non-root cgroups (Daniel P. Berrange)
- Change default cgroup layout for QEMU/LXC and honour XML config (Daniel P. Berrange)
- Add a new virCgroupNewPartition for setting up resource partitions (Daniel P. Berrange)
- Cleanup if creating cgroup directories fails (Daniel P. Berrange)
- Add misc extra debugging into cgroups code (Daniel P. Berrange)
- Refactor cgroups internal data structures (Daniel P. Berrange)
- Add a test suite for cgroups functionality (Daniel P. Berrange)
- Rename virCgroupForXXX to virCgroupNewXXX (Daniel P. Berrange)
- Pull definition of structs out of vircgroup.c to vircgrouppriv.h (Daniel P. Berrange)
- Store a virCgroupPtr instance in virLXCDomainObjPrivatePtr (Daniel P. Berrange)
- Store a virCgroupPtr instance in qemuDomainObjPrivatePtr (Daniel P. Berrange)
- Add missing param to virCgroupForDriver stub (Daniel P. Berrange)
- Introduce a virFileDeleteTree method (Daniel P. Berrange)
- Conditionalize use of symlink() function in test suite (Daniel P. Berrange)
- maint: update to latest gnulib (Eric Blake)
- Use unsigned int instead of unsigned (Osier Yang)
- qemu: Report also domain name in error message when domain object wasn't found (Peter Krempa)
- qemu: Refactor lookup of domain object (Peter Krempa)
- cleanup: Change datatype of net->stp to boolean (Osier Yang)
- cleanup: Change datatype of usbdev->allow to boolean (Osier Yang)
- cleanup: Change datatype of graphic's members to boolean (Osier Yang)
- cleanup: Change datatype of accel's members to boolean (Osier Yang)
- Add test case for TPM passthrough (Stefan Berger)
- TPM support for QEMU command line (Stefan Berger)
- QEMU Cgroup support for TPM passthrough (Stefan Berger)
- Audit the starting of a guest using TPM passthrough (Stefan Berger)
- Add SELinux and DAC labeling support for TPM passthrough (Stefan Berger)
- Convert QMP strings into QEMU capability bits (Stefan Berger)
- Parse TPM passthrough XML in the domain XML (Stefan Berger)
- Helper functions for host TPM support (Stefan Berger)
- Add documentation and schema for TPM passthrough (Stefan Berger)
- Add function to find a needle in a string array (Stefan Berger)
- Add QMP probing for TPM (Stefan Berger)
- conf: Allow for non-contiguous device boot orders (Peter Krempa)
- Tweak EOF handling of streams (Daniel P. Berrange)
- Add USB option capability (Li Zhang)
- Add error handling to optional arguments in cmdCPUStats (John Ferlan)
- qemu: Do not report unsafe migration for local files (Jiri Denemark)
- qemu: Try to use QMP for send-key if supported (Peter Krempa)
- virsh: Update list of shutdown/reboot modes (Michal Privoznik)
- cleanup: Change datatype of secret->private to boolean (Osier Yang)
- cleanup: Change datatype of secret->ephemeral to boolean (Osier Yang)
- cleanup: Change datatype of fs->readonly to boolean (Osier Yang)
- cleanup: Change datatype of disk->readonly to boolean (Osier Yang)
- cleanup: Change datatype of disk->transient to boolean (Osier Yang)
- cleanup: Change datatype of disk->shared to boolean (Osier Yang)
- cleanup: Change datatype of auth->expires to boolean (Osier Yang)
- cleanup: Change datatype of hostdev->missing to boolean (Osier Yang)
- Cleanup: Change datatype of origstate's members to boolean (Osier Yang)
- Cleanup: Change datatype of hostdev->managed to boolean (Osier Yang)
- conf: Change help function (Han Cheng)
- qemu: Remove now obsolete assignment of default network card model for s390 hosts (Peter Krempa)
- qemu: Clean up network device CLI generator (Peter Krempa)
- qemu: Use correct default model on s390 (Viktor Mihajlovski)
- sanlock: add missing test command in virt-sanlock-cleanup.in (Alex Jia)
- Generate RFC4122 compliant UUIDs (Milos Vyletel)
- Unmount existing filesystems under user specified mounts in LXC (Daniel P. Berrange)
- Move lxcContainerUnmountSubtree further up in file (Daniel P. Berrange)
- Implement support for <hostdev caps=net> (Bogdan Purcareata)
- Update structure & XML definitions to support <hostdev caps=net> (Bogdan Purcareata)
- Rename virCgroupMounted to virCgroupHasController & make it more robust (Daniel P. Berrange)
- qemu: Allow volume type disk for device 'lun' (Osier Yang)
- qemu: Support sgio setting for volume type disk (Osier Yang)
- qemu: Support shareable volume type disk (Osier Yang)
- qemu: Translate the pool disk source earlier (Osier Yang)
- Support seclabels for volume type disk (Osier Yang)
- Support startupPolicy for 'volume' disk (Osier Yang)
- qemu: Translate the pool disk source when building drive string (Osier Yang)
- Introduce new XMLs to specify disk source using libvirt storage (Osier Yang)
- conf: New helper virDomainDiskSourceDefFormat to format the disk source (Osier Yang)
- storage: Guess the parent if it's not specified for vHBA (Osier Yang)
- storage: Add startPool and stopPool for scsi backend (Osier Yang)
- util: Add helper to get the scsi host name by iterating over sysfs (Osier Yang)
- phyp: Prohibit fc_host adapter for phyp driver (Osier Yang)
- storage: Move virStorageBackendSCSIGetHostNumber into iscsi backend (Osier Yang)
- storage: Make the adapter name be consistent with node device driver (Osier Yang)
- New XML attributes for storage pool source adapter (Osier Yang)
- Disable cast-align warnings in various places (Daniel P. Berrange)
- Copy struct inotify_event entries to avoid alignment problems (Daniel P. Berrange)
- Use VIR_ALLOC_VAR instead of VIR_ALLOC_N for creating virObject (Daniel P. Berrange)
- Avoid casts between unsigned char * and struct nlmsghdr (Daniel P. Berrange)
- Rewrite keycode map to avoid a struct (Daniel P. Berrange)
- Add a test suite for keycode mapping functions (Daniel P. Berrange)
- qemu: Error out if the bitmap for pinning is all clear (Osier Yang)
- util: Add a helper to check if all bits of a bitmap are clear (Osier Yang)
- qemu: Support multiple queue virtio-scsi (Osier Yang)
- build: check correct protocol.o file (Eric Blake)
- build: use proper pod for nested bulleted VIRSH_DEBUG list (Eric Blake)
- qemu: Remove maximum cpu limit when setting processor count using the API (Peter Krempa)
- Don't create dirs in cgroup controllers we don't want to use (Daniel P. Berrange)
- Rename virCgroupGetAppRoot to virCgroupForSelf (Daniel P. Berrange)
- Ensure LD_PRELOAD exists before running test case (Daniel P. Berrange)
- Refactor RNG schema for resource tuning (Daniel P. Berrange)
- rpc: Fix connection close callback race condition and memory corruption/crash (Peter Krempa)
- virsh: Register and unregister the close callback also in cmdConnect (Peter Krempa)
- virsh: Move cmdConnect from virsh-host.c to virsh.c (Peter Krempa)
- virCaps: get rid of defaultConsoleTargetType callback (Peter Krempa)
- virCaps: get rid of macPrefix field (Peter Krempa)
- virCaps: get rid of hasWideScsiBus (Peter Krempa)
- virCaps: get rid of defaultDiskDriverType (Peter Krempa)
- virCaps: get rid of emulatorRequired (Peter Krempa)
- virCaps: get rid of defaultDiskDriverName (Peter Krempa)
- virCaps: get rid of "defaultInitPath" value in the virCaps struct (Peter Krempa)
- qemu: Record the default NIC model in the domain XML (Peter Krempa)
- conf callback: Rearrange function parameters (Peter Krempa)
- conf: Add post XML parse callbacks and prepare for cleaning of virCaps (Peter Krempa)
- maint: Rename xmlconf to xmlopt and virDomainXMLConfig to virDomainXMLOption (Peter Krempa)
- Create fake NUMA info if libnuma isn't available (Daniel P. Berrange)
- Cope with missing /sys/devices/system/cpu/cpu0/topology files (Daniel P. Berrange)
- Add armv6l architecture to list of valid arches (Daniel P. Berrange)
- Implement minimal sysinfo for ARM platforms (Daniel P. Berrange)
- Disable of unused sysinfotest functions (Daniel P. Berrange)
- Wire up sysinfo for LXC driver (Daniel P. Berrange)
- Add support for SD cards in nodedev driver (Daniel P. Berrange)
- Auto-add a root <filesystem> element to LXC containers on startup (Daniel P. Berrange)
- Remove support for old kernels lacking private devpts (Daniel P. Berrange)
- Enable full RELRO mode (Daniel P. Berrange)
- Build all binaries with PIE (Daniel P. Berrange)
- rng: Add definition for network disk source (Osier Yang)
- Disable static libraries by default (Daniel P. Berrange)
- Allow multiple parameters for schedinfo (Martin Kletzander)
- virsh-domain: Add --live, --config, --current logic to cmdDetachDisk (Peter Krempa)
- virsh-domain: Add --live, --config, --current logic to cmdDetachDevice (Peter Krempa)
- virsh-domain: Add --live, --config, --current logic to cmdDetachInterface (Peter Krempa)
- virsh: Fix semantics of --config for "update-device" command (Peter Krempa)
- virsh-domain: Fix declarations of flag variables in cmdChangeMedia (Peter Krempa)
- virsh-domain: Simplify usage of --current, --live and --config flags (Peter Krempa)
- virsh-domain-monitor: Refactor cmdDomIfGetLink (Peter Krempa)
- Use virMacAddrFormat instead of manual mac address formatting (Peter Krempa)
- util: Change virMacAddrFormat to lowercase hex characters (Peter Krempa)
- Optimize machine option to set more options with it (Li Zhang)
- conf: Enforce ranges on cputune variables (Peter Krempa)
- test: Return Libvirt logo as domain screenshot (Michal Privoznik)
- qemu: Allow migration over IPv6 (Ján Tomko)
- virsh: Add a helper to parse cpulist (Osier Yang)
Cleanups:
- qemu_command.c: Fix whitespacing within for() (Michal Privoznik)
- qemu: Fix the indention (Osier Yang)
- Sanitize whitespace in driver.h (Daniel P. Berrange)
- sheepdog: Omit braces with a single-line body (Harry Wei)
- storage: Fix the indention (Osier Yang)
- Remove extraneous comma in info_cpu_stats and opts_cpu_stats (John Ferlan)
Thanks to everybody who helped one way or another in producing this
release !
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
11 years, 6 months
[libvirt] [PATCH] util: fix compile errors caused by moving string functions
by Laine Stump
commit 7c9a2d8 missed adding in a few #include "virstring.h"s, causing
builds to fail.
---
Pushed under the build-breaker rule.
src/locking/lock_driver_sanlock.c | 1 +
src/storage/storage_backend_rbd.c | 1 +
src/storage/storage_backend_sheepdog.c | 1 +
tests/storagebackendsheepdogtest.c | 1 +
4 files changed, 4 insertions(+)
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index 48c6d56..4b48868 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
@@ -43,6 +43,7 @@
#include "virfile.h"
#include "md5.h"
#include "virconf.h"
+#include "virstring.h"
#include "configmake.h"
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index ca23d4b..99024e3 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -30,6 +30,7 @@
#include "virlog.h"
#include "base64.h"
#include "viruuid.h"
+#include "virstring.h"
#include "rados/librados.h"
#include "rbd/librbd.h"
diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c
index dfa5673..a9ee7d3 100644
--- a/src/storage/storage_backend_sheepdog.c
+++ b/src/storage/storage_backend_sheepdog.c
@@ -32,6 +32,7 @@
#include "vircommand.h"
#include "viralloc.h"
#include "virlog.h"
+#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/tests/storagebackendsheepdogtest.c b/tests/storagebackendsheepdogtest.c
index 8800acb..9b43a6d 100644
--- a/tests/storagebackendsheepdogtest.c
+++ b/tests/storagebackendsheepdogtest.c
@@ -32,6 +32,7 @@
#include "internal.h"
#include "testutils.h"
#include "storage/storage_backend_sheepdog.h"
+#include "virstring.h"
typedef struct {
--
1.7.11.7
11 years, 6 months