Skip to contentSkip to conversation

qdev: fix thinko leading to guest crashes

PATCH Applied Michael S. Tsirkin 2 participants 2 messages Jan 12, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qdev: fix thinko leading to guest crashes

Without this fix, guest crashes with drive=virtio.

---

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(-)
hw/qdev-properties.c +1 -1
index 9e123ae..277ff9e 100644
@@ -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;
 }
Signature · 1 line
1.6.6.rc1.43.gf55cc
#1 lore raw
Quoted 4 lines · Michael S. Tsirkin

Without this fix, guest crashes with drive=virtio.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 23 lines

---

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(-)
hw/qdev-properties.c +1 -1
index 9e123ae..277ff9e 100644
@@ -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;
  }