[libvirt] [PATCH 2/4] xen: Fix logic bug in xenDaemon*DeviceFlags

Jiri Denemark jdenemar at redhat.com
Fri Oct 1 20:09:18 UTC 2010


---
 src/xen/xend_internal.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 1318bd4..4fba6af 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -3904,8 +3904,9 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
         /* Xen only supports modifying both live and persistent config if
          * xendConfigVersion >= 3
          */
-        if (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
-                      VIR_DOMAIN_DEVICE_MODIFY_CONFIG)) {
+        if (priv->xendConfigVersion >= 3 &&
+            (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
+                       VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
             virXendError(VIR_ERR_OPERATION_INVALID, "%s",
                          _("Xend only supports modifying both live and "
                            "persistent config"));
@@ -4043,8 +4044,9 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
         /* Xen only supports modifying both live and persistent config if
          * xendConfigVersion >= 3
          */
-        if (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
-                      VIR_DOMAIN_DEVICE_MODIFY_CONFIG)) {
+        if (priv->xendConfigVersion >= 3 &&
+            (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
+                       VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
             virXendError(VIR_ERR_OPERATION_INVALID, "%s",
                          _("Xend only supports modifying both live and "
                            "persistent config"));
@@ -4154,8 +4156,9 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
         /* Xen only supports modifying both live and persistent config if
          * xendConfigVersion >= 3
          */
-        if (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
-                      VIR_DOMAIN_DEVICE_MODIFY_CONFIG)) {
+        if (priv->xendConfigVersion >= 3 &&
+            (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
+                       VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
             virXendError(VIR_ERR_OPERATION_INVALID, "%s",
                          _("Xend only supports modifying both live and "
                            "persistent config"));
-- 
1.7.3.1




More information about the libvir-list mailing list