xen: Fix logic bug in xenDaemon*DeviceFlags

This commit is contained in:
Jiri Denemark 2010-10-01 16:31:04 +02:00
parent 28160e2264
commit 6ab99b8a43

View File

@ -3904,8 +3904,9 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
/* Xen only supports modifying both live and persistent config if /* Xen only supports modifying both live and persistent config if
* xendConfigVersion >= 3 * xendConfigVersion >= 3
*/ */
if (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE | if (priv->xendConfigVersion >= 3 &&
VIR_DOMAIN_DEVICE_MODIFY_CONFIG)) { (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
_("Xend only supports modifying both live and " _("Xend only supports modifying both live and "
"persistent config")); "persistent config"));
@ -4043,8 +4044,9 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
/* Xen only supports modifying both live and persistent config if /* Xen only supports modifying both live and persistent config if
* xendConfigVersion >= 3 * xendConfigVersion >= 3
*/ */
if (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE | if (priv->xendConfigVersion >= 3 &&
VIR_DOMAIN_DEVICE_MODIFY_CONFIG)) { (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
_("Xend only supports modifying both live and " _("Xend only supports modifying both live and "
"persistent config")); "persistent config"));
@ -4154,8 +4156,9 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
/* Xen only supports modifying both live and persistent config if /* Xen only supports modifying both live and persistent config if
* xendConfigVersion >= 3 * xendConfigVersion >= 3
*/ */
if (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE | if (priv->xendConfigVersion >= 3 &&
VIR_DOMAIN_DEVICE_MODIFY_CONFIG)) { (flags != (VIR_DOMAIN_DEVICE_MODIFY_LIVE |
VIR_DOMAIN_DEVICE_MODIFY_CONFIG))) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s", virXendError(VIR_ERR_OPERATION_INVALID, "%s",
_("Xend only supports modifying both live and " _("Xend only supports modifying both live and "
"persistent config")); "persistent config"));