[libvirt] [PATCH 1/2] xen: fix logic bug

Daniel Veillard veillard at redhat.com
Thu Jul 29 17:17:54 UTC 2010


On Wed, Jul 28, 2010 at 05:34:14PM -0600, Eric Blake wrote:
> The recent switch to enable -Wlogical-op paid off again.
> gcc 4.5.0 (rawhide) is smarter than 4.4.4 (Fedora 13).
> 
> * src/xen/xend_internal.c (xenDaemonAttachDeviceFlags)
> (xenDaemonUpdateDeviceFlags, xenDaemonDetachDeviceFlags): Use
> correct operator.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  src/xen/xend_internal.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
> index fad5ce8..311775a 100644
> --- a/src/xen/xend_internal.c
> +++ b/src/xen/xend_internal.c
> @@ -3888,7 +3888,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
>      } else {
>          /* Only live config can be changed if xendConfigVersion < 3 */
>          if (priv->xendConfigVersion < 3 &&
> -            (flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT ||
> +            (flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT &&
>               flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) {
>              virXendError(VIR_ERR_OPERATION_INVALID, "%s",
>                           _("Xend version does not support modifying "
> @@ -4027,7 +4027,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
>      } else {
>          /* Only live config can be changed if xendConfigVersion < 3 */
>          if (priv->xendConfigVersion < 3 &&
> -            (flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT ||
> +            (flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT &&
>               flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) {
>              virXendError(VIR_ERR_OPERATION_INVALID, "%s",
>                           _("Xend version does not support modifying "
> @@ -4138,7 +4138,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
>      } else {
>          /* Only live config can be changed if xendConfigVersion < 3 */
>          if (priv->xendConfigVersion < 3 &&
> -            (flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT ||
> +            (flags != VIR_DOMAIN_DEVICE_MODIFY_CURRENT &&
>               flags != VIR_DOMAIN_DEVICE_MODIFY_LIVE)) {
>              virXendError(VIR_ERR_OPERATION_INVALID, "%s",
>                           _("Xend version does not support modifying "

  ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list