Patchwork qdev: fix thinko leading to guest crashes

login
register
mail settings
Submitter Michael S. Tsirkin
Date Jan. 12, 2010, 7:16 p.m.
Message ID <20100112191659.GA3258@redhat.com>
Download mbox | patch
Permalink /patch/42743/
State New
Headers show

Comments

Michael S. Tsirkin - Jan. 12, 2010, 7:16 p.m.
Without this fix, guest crashes with drive=virtio.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

Anthony, could you please apply this patch quickly?
It's an obvious one and it fixes guest crashes.
Also, sorry about missing this in my testing.

 hw/qdev-properties.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Anthony Liguori - Jan. 12, 2010, 7:35 p.m.
On 01/12/2010 01:16 PM, Michael S. Tsirkin wrote:
> Without this fix, guest crashes with drive=virtio.
>
> Signed-off-by: Michael S. Tsirkin<mst@redhat.com>
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> ---
>
> Anthony, could you please apply this patch quickly?
> It's an obvious one and it fixes guest crashes.
> Also, sorry about missing this in my testing.
>
>   hw/qdev-properties.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
> index 9e123ae..277ff9e 100644
> --- a/hw/qdev-properties.c
> +++ b/hw/qdev-properties.c
> @@ -20,7 +20,7 @@ static void bit_prop_set(DeviceState *dev, Property *props, bool val)
>       uint32_t *p = qdev_get_prop_ptr(dev, props);
>       uint32_t mask = qdev_get_prop_mask(props);
>       if (val)
> -        *p |= ~mask;
> +        *p |= mask;
>       else
>           *p&= ~mask;
>   }
>

Patch

diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 9e123ae..277ff9e 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -20,7 +20,7 @@  static void bit_prop_set(DeviceState *dev, Property *props, bool val)
     uint32_t *p = qdev_get_prop_ptr(dev, props);
     uint32_t mask = qdev_get_prop_mask(props);
     if (val)
-        *p |= ~mask;
+        *p |= mask;
     else
         *p &= ~mask;
 }