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

[libvirt] [PATCH 5/7] Fix PVFB device configuration for RHEL-5



PVFB configuration depends on the version.  The version number check
doesn't work for RHEL-5 because its PVFB device was backported from
later versions.  Special-case it.

Signed-off-by: Markus Armbruster <armbru redhat com>
---
 src/xend_internal.c |    6 ++++--
 src/xm_internal.c   |    4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/xend_internal.c b/src/xend_internal.c
index b502508..9b9f98d 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -61,8 +61,10 @@
 
 #ifdef WITH_RHEL5_API
 #define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 0
+#define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 2
 #else
 #define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 3
+#define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 3
 #endif
 
 /**
@@ -5406,7 +5408,7 @@ xenDaemonFormatSxpr(virConnectPtr conn,
 
 
         /* PV graphics for xen <= 3.0.4, or HVM graphics for xen <= 3.1.0 */
-        if ((!hvm && xendConfigVersion < 3) ||
+        if ((!hvm && xendConfigVersion < XEND_CONFIG_MIN_VERS_PVFB_NEWCONF) ||
             (hvm && xendConfigVersion < 4)) {
             if (def->graphics &&
                 xenDaemonFormatSxprGraphicsOld(conn, def->graphics, &buf, xendConfigVersion) < 0)
@@ -5428,7 +5430,7 @@ xenDaemonFormatSxpr(virConnectPtr conn,
 
     /* New style PV graphics config xen >= 3.0.4,
      * or HVM graphics config xen >= 3.0.5 */
-    if ((xendConfigVersion >= 3 && !hvm) ||
+    if ((xendConfigVersion >= XEND_CONFIG_MIN_VERS_PVFB_NEWCONF && !hvm) ||
         (xendConfigVersion >= 4 && hvm)) {
         if (def->graphics &&
             xenDaemonFormatSxprGraphicsNew(conn, def->graphics, &buf) < 0)
diff --git a/src/xm_internal.c b/src/xm_internal.c
index 36334c4..c29f68f 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -50,8 +50,10 @@
 
 #ifdef WITH_RHEL5_API
 #define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 0
+#define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 2
 #else
 #define XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU 3
+#define XEND_CONFIG_MIN_VERS_PVFB_NEWCONF 3
 #endif
 
 /* The true Xen limit varies but so far is always way
@@ -2055,7 +2057,7 @@ virConfPtr xenXMDomainConfigFormat(virConnectPtr conn,
     }
 
     if (def->graphics) {
-        if (priv->xendConfigVersion < (hvm ? 4 : 3)) {
+        if (priv->xendConfigVersion < (hvm ? 4 : XEND_CONFIG_MIN_VERS_PVFB_NEWCONF)) {
             if (def->graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {
                 if (xenXMConfigSetInt(conf, "sdl", 1) < 0)
                     goto no_memory;
-- 
1.5.4.3


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