Patchwork [3/8] qom: fix swapped parameters

login
register
mail settings
Submitter Paolo Bonzini
Date Dec. 16, 2011, 12:01 p.m.
Message ID <1324036918-2405-4-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/131812/
State New
Headers show

Comments

Paolo Bonzini - Dec. 16, 2011, 12:01 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/qdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Anthony Liguori - Dec. 16, 2011, 1:57 p.m.
On 12/16/2011 06:01 AM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>

Yeah, this code path is currently dead as there is no way to test it until we 
defer s/init/realize/ and defer it to guest launch.

In my next series when I introduce Object and move properties into it, we can 
write some unit tests to cover this sort of thing.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

> ---
>   hw/qdev.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/qdev.c b/hw/qdev.c
> index 83913c7..bda8d6c 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -1110,7 +1110,7 @@ void qdev_property_set(DeviceState *dev, Visitor *v, const char *name,
>       if (!prop->set) {
>           error_set(errp, QERR_PERMISSION_DENIED);
>       } else {
> -        prop->set(dev, prop->opaque, v, name, errp);
> +        prop->set(dev, v, prop->opaque, name, errp);
>       }
>   }
>

Patch

diff --git a/hw/qdev.c b/hw/qdev.c
index 83913c7..bda8d6c 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -1110,7 +1110,7 @@  void qdev_property_set(DeviceState *dev, Visitor *v, const char *name,
     if (!prop->set) {
         error_set(errp, QERR_PERMISSION_DENIED);
     } else {
-        prop->set(dev, prop->opaque, v, name, errp);
+        prop->set(dev, v, prop->opaque, name, errp);
     }
 }