qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.4] qdev: fix 64 bit properties


From: Christian Borntraeger
Subject: Re: [Qemu-devel] [PATCH for-2.4] qdev: fix 64 bit properties
Date: Thu, 09 Jul 2015 13:22:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Am 09.07.2015 um 13:01 schrieb Cornelia Huck:
> 64 bit props used 32 bit callbacks in two places, leading to broken
> feature bits on virtio (example: got 0x31000000000006d4 which is
> obviously bogus). Fix this.
> 
> Fixes: fdba6d96 ("qdev: add 64bit properties")
> Signed-off-by: Cornelia Huck <address@hidden>

Tested-by: Christian Borntraeger <address@hidden>

With that patch a pre-v1-patches save file loads and works. (Without this
patch the guest loads, but virtio is broken and all I/O hangs)

> ---
>  hw/core/qdev-properties.c    | 2 +-
>  include/hw/qdev-properties.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> index e9e686f..04fd80a 100644
> --- a/hw/core/qdev-properties.c
> +++ b/hw/core/qdev-properties.c
> @@ -130,7 +130,7 @@ PropertyInfo qdev_prop_bit = {
> 
>  static uint64_t qdev_get_prop_mask64(Property *prop)
>  {
> -    assert(prop->info == &qdev_prop_bit);
> +    assert(prop->info == &qdev_prop_bit64);
>      return 0x1ull << prop->bitnr;
>  }
> 
> diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
> index 0cfff1c..77538a8 100644
> --- a/include/hw/qdev-properties.h
> +++ b/include/hw/qdev-properties.h
> @@ -53,7 +53,7 @@ extern PropertyInfo qdev_prop_arraylen;
>          }
>  #define DEFINE_PROP_BIT64(_name, _state, _field, _bit, _defval) {       \
>          .name      = (_name),                                           \
> -        .info      = &(qdev_prop_bit),                                  \
> +        .info      = &(qdev_prop_bit64),                                \
>          .bitnr    = (_bit),                                             \
>          .offset    = offsetof(_state, _field)                           \
>              + type_check(uint64_t, typeof_field(_state, _field)),       \
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]