[Qemu-devel] [PATCH] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate

Markus Armbruster posted 1 patch 5 days ago
Test asan failed
Test docker-clang@ubuntu passed
Test docker-mingw@fedora passed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190313174433.12966-1-armbru@redhat.com
hw/block/xen-block.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

[Qemu-devel] [PATCH] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate

Posted by Markus Armbruster 5 days ago
Patch created mechanically by rerunning:

    $ spatch --sp-file scripts/coccinelle/qobject.cocci \
             --macro-file scripts/cocci-macro-file.h \
             --dir hw/block --in-place

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/block/xen-block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 70fc2455e8..9c722b9b95 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -771,7 +771,7 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
             QDict *cache_qdict = qdict_new();
 
             qdict_put_bool(cache_qdict, "direct", true);
-            qdict_put_obj(file_layer, "cache", QOBJECT(cache_qdict));
+            qdict_put(file_layer, "cache", cache_qdict);
 
             qdict_put_str(file_layer, "aio", "native");
         }
@@ -796,7 +796,7 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
     qdict_put_str(driver_layer, "driver", driver);
     g_free(driver);
 
-    qdict_put_obj(driver_layer, "file", QOBJECT(file_layer));
+    qdict_put(driver_layer, "file", file_layer);
 
     g_assert(!drive->node_name);
     drive->node_name = xen_block_blockdev_add(drive->id, driver_layer,
-- 
2.17.2


Re: [Qemu-devel] [Qemu-block] [PATCH] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate

Posted by Kevin Wolf 4 days ago
Am 13.03.2019 um 18:44 hat Markus Armbruster geschrieben:
> Patch created mechanically by rerunning:
> 
>     $ spatch --sp-file scripts/coccinelle/qobject.cocci \
>              --macro-file scripts/cocci-macro-file.h \
>              --dir hw/block --in-place
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Kevin Wolf <kwolf@redhat.com>

Which tree should this go through? The Xen one?

Kevin

Re: [Qemu-devel] [Qemu-block] [PATCH] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate

Posted by Markus Armbruster 4 days ago
Kevin Wolf <kwolf@redhat.com> writes:

> Am 13.03.2019 um 18:44 hat Markus Armbruster geschrieben:
>> Patch created mechanically by rerunning:
>> 
>>     $ spatch --sp-file scripts/coccinelle/qobject.cocci \
>>              --macro-file scripts/cocci-macro-file.h \
>>              --dir hw/block --in-place
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>

Thanks!

> Which tree should this go through? The Xen one?

Fine with me.  I could also include it in a "miscellaneous cleanup" pull
request along with other cleanup patches I got in flight.

Re: [Qemu-devel] [Qemu-block] [PATCH] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate

Posted by Anthony PERARD 3 days ago
On Thu, Mar 14, 2019 at 08:04:00PM +0100, Markus Armbruster wrote:
> Kevin Wolf <kwolf@redhat.com> writes:
> 
> > Am 13.03.2019 um 18:44 hat Markus Armbruster geschrieben:
> >> Patch created mechanically by rerunning:
> >> 
> >>     $ spatch --sp-file scripts/coccinelle/qobject.cocci \
> >>              --macro-file scripts/cocci-macro-file.h \
> >>              --dir hw/block --in-place
> >> 
> >> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> >
> > Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> 
> Thanks!
> 
> > Which tree should this go through? The Xen one?
> 
> Fine with me.  I could also include it in a "miscellaneous cleanup" pull
> request along with other cleanup patches I got in flight.

Markus, I don't have any other Xen patches, so could you include this
one in your pull request?

Thanks,

-- 
Anthony PERARD

Re: [Qemu-devel] [Qemu-block] [PATCH] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate

Posted by Markus Armbruster 3 days ago
Anthony PERARD <anthony.perard@citrix.com> writes:

> On Thu, Mar 14, 2019 at 08:04:00PM +0100, Markus Armbruster wrote:
>> Kevin Wolf <kwolf@redhat.com> writes:
>> 
>> > Am 13.03.2019 um 18:44 hat Markus Armbruster geschrieben:
>> >> Patch created mechanically by rerunning:
>> >> 
>> >>     $ spatch --sp-file scripts/coccinelle/qobject.cocci \
>> >>              --macro-file scripts/cocci-macro-file.h \
>> >>              --dir hw/block --in-place
>> >> 
>> >> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> >
>> > Reviewed-by: Kevin Wolf <kwolf@redhat.com>
>> 
>> Thanks!
>> 
>> > Which tree should this go through? The Xen one?
>> 
>> Fine with me.  I could also include it in a "miscellaneous cleanup" pull
>> request along with other cleanup patches I got in flight.
>
> Markus, I don't have any other Xen patches, so could you include this
> one in your pull request?

Sure!

Re: [Qemu-devel] [PATCH] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate

Posted by Paul Durrant 4 days ago
> -----Original Message-----
> From: Markus Armbruster [mailto:armbru@redhat.com]
> Sent: 13 March 2019 17:45
> To: qemu-devel@nongnu.org
> Cc: sstabellini@kernel.org; Anthony Perard <anthony.perard@citrix.com>; Paul Durrant
> <Paul.Durrant@citrix.com>; xen-devel@lists.xenproject.org; qemu-block@nongnu.org
> Subject: [PATCH] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate
> 
> Patch created mechanically by rerunning:
> 
>     $ spatch --sp-file scripts/coccinelle/qobject.cocci \
>              --macro-file scripts/cocci-macro-file.h \
>              --dir hw/block --in-place
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Acked-by: Paul Durrant <paul.durrant@citrix.com>

> ---
>  hw/block/xen-block.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
> index 70fc2455e8..9c722b9b95 100644
> --- a/hw/block/xen-block.c
> +++ b/hw/block/xen-block.c
> @@ -771,7 +771,7 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
>              QDict *cache_qdict = qdict_new();
> 
>              qdict_put_bool(cache_qdict, "direct", true);
> -            qdict_put_obj(file_layer, "cache", QOBJECT(cache_qdict));
> +            qdict_put(file_layer, "cache", cache_qdict);
> 
>              qdict_put_str(file_layer, "aio", "native");
>          }
> @@ -796,7 +796,7 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
>      qdict_put_str(driver_layer, "driver", driver);
>      g_free(driver);
> 
> -    qdict_put_obj(driver_layer, "file", QOBJECT(file_layer));
> +    qdict_put(driver_layer, "file", file_layer);
> 
>      g_assert(!drive->node_name);
>      drive->node_name = xen_block_blockdev_add(drive->id, driver_layer,
> --
> 2.17.2


Re: [Qemu-devel] [PATCH] xen-block: Replace qdict_put_obj() by qdict_put() where appropriate

Posted by Eric Blake 5 days ago
On 3/13/19 12:44 PM, Markus Armbruster wrote:
> Patch created mechanically by rerunning:
> 
>     $ spatch --sp-file scripts/coccinelle/qobject.cocci \
>              --macro-file scripts/cocci-macro-file.h \
>              --dir hw/block --in-place
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hw/block/xen-block.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

Safe for 4.0 softfreeze in my opinion, but also harmless if it slips to 4.1.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org