summaryrefslogtreecommitdiff
path: root/hw/usb/xen-usb.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-04-27 16:58:17 -0500
committerMarkus Armbruster <armbru@redhat.com>2017-05-09 09:13:51 +0200
commit46f5ac205a9dc5e2c24274c7df371509a286281f (patch)
tree52cd3eab32f34963a5275f6f291386d4ad8b6624 /hw/usb/xen-usb.c
parenta92c21591b5bb9543996538f14854ca6b528318b (diff)
downloadqemu-46f5ac205a9dc5e2c24274c7df371509a286281f.tar.gz
qobject: Use simpler QDict/QList scalar insertion macros
We now have macros in place to make it less verbose to add a scalar to QDict and QList, so use them. Patch created mechanically via: spatch --sp-file scripts/coccinelle/qobject.cocci \ --macro-file scripts/cocci-macro-file.h --dir . --in-place then touched up manually to fix a couple of '?:' back to original spacing, as well as avoiding a long line in monitor.c. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170427215821.19397-7-eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw/usb/xen-usb.c')
-rw-r--r--hw/usb/xen-usb.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 370b3d9387..fe62183fe3 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -746,16 +746,16 @@ static void usbback_portid_add(struct usbback_info *usbif, unsigned port,
portname++;
qdict = qdict_new();
- qdict_put(qdict, "driver", qstring_from_str("usb-host"));
+ qdict_put_str(qdict, "driver", "usb-host");
tmp = g_strdup_printf("%s.0", usbif->xendev.qdev.id);
- qdict_put(qdict, "bus", qstring_from_str(tmp));
+ qdict_put_str(qdict, "bus", tmp);
g_free(tmp);
tmp = g_strdup_printf("%s-%u", usbif->xendev.qdev.id, port);
- qdict_put(qdict, "id", qstring_from_str(tmp));
+ qdict_put_str(qdict, "id", tmp);
g_free(tmp);
- qdict_put(qdict, "port", qint_from_int(port));
- qdict_put(qdict, "hostbus", qint_from_int(atoi(busid)));
- qdict_put(qdict, "hostport", qstring_from_str(portname));
+ qdict_put_int(qdict, "port", port);
+ qdict_put_int(qdict, "hostbus", atoi(busid));
+ qdict_put_str(qdict, "hostport", portname);
opts = qemu_opts_from_qdict(qemu_find_opts("device"), qdict, &local_err);
if (local_err) {
goto err;