[libvirt] [PATCH] openvz: Allow missing micro tag in the version

Osier Yang jyang at redhat.com
Sat Mar 31 01:11:04 UTC 2012


No reason to cause the openvz driver to fail on startup if
the micro tag in missed. This solves the problem:

https://www.redhat.com/archives/libvirt-users/2012-March/msg00202.html
---
 src/openvz/openvz_conf.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 28f86ff..da6869b 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -95,11 +95,13 @@ openvzExtractVersionInfo(const char *cmdstr, int *retversion)
 
     tmp = help;
 
-    /* expected format: vzctl version <major>.<minor>.<micro> */
+    /* expected format: vzctl version <major>.<minor>.<micro>,
+     * missing <micro> is allowed.
+     */
     if ((tmp = STRSKIP(tmp, "vzctl version ")) == NULL)
         goto cleanup;
 
-    if (virParseVersionString(tmp, &version, false) < 0)
+    if (virParseVersionString(tmp, &version, true) < 0)
         goto cleanup;
 
     if (retversion)
-- 
1.7.7.3




More information about the libvir-list mailing list