* [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups
@ 2017-04-05 19:47 Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 01/13] pci: Use struct instead of QDict to pass back parameters Eric Blake
` (14 more replies)
0 siblings, 15 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru
This is a subset of my earlier post "Rip out dynamic JSON parsing"[1],
and then a rebase of that work onto master. It is available here:
git fetch git://repo.or.cz/qemu/ericb.git qapi-dynamic-json-v3
the tag name is a bit of a misnomer for the current series, but is
historically accurate.
Since v2 [2], I've split up the original patches 2-3 (done manually,
and mixing multiple cleanups into one) into a much longer sequence of
patches 2-11 (separate cleanups in 2, 3, 10, 11, and use of Coccinelle
instead of manual for the bulk of the work); I've also dropped the
original patch 6. I've also addressed some of the comments left by
Markus on v2, although I still couldn't figure out how to use an 'id'
instead of "device":"floppy0" in 12.
This is 2.10 material, and will probably be a conflict magnet the
longer it is not applied (conversely, since it is now generated by
Coccinelle, it will be a lot easier to regenerate the series if
another round of rebasing is needed).
[1] https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg05425.html
[2] https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg03661.html
001/13:[0030] [FC] 'pci: Use struct instead of QDict to pass back parameters'
002/13:[down] 'pci: Reduce scope of error injection'
003/13:[down] 's390x: Drop useless casts'
004/13:[down] 'coccinelle: Add script to remove useless QObject casts'
005/13:[down] 'qobject: Drop useless QObject casts'
006/13:[down] 'qobject: Add helper macros for common scalar insertions'
007/13:[down] 'block: Use simpler QDict/QList scalar insertion macros'
008/13:[down] 'tests: Use simpler QDict/QList scalar insertion macros'
009/13:[down] 'qobject: Use simpler QDict/QList scalar insertion macros'
010/13:[down] 'block: Simplify bdrv_append_temp_snapshot() logic'
011/13:[down] 'QemuOpts: Simplify qemu_opts_to_qdict()'
012/13:[----] [--] 'fdc-test: Avoid deprecated 'change' command'
013/13:[0024] [FC] 'test-qga: Actually test 0xff sync bytes'
Eric Blake (13):
pci: Use struct instead of QDict to pass back parameters
pci: Reduce scope of error injection
s390x: Drop useless casts
coccinelle: Add script to remove useless QObject casts
qobject: Drop useless QObject casts
qobject: Add helper macros for common scalar insertions
block: Use simpler QDict/QList scalar insertion macros
tests: Use simpler QDict/QList scalar insertion macros
qobject: Use simpler QDict/QList scalar insertion macros
block: Simplify bdrv_append_temp_snapshot() logic
QemuOpts: Simplify qemu_opts_to_qdict()
fdc-test: Avoid deprecated 'change' command
test-qga: Actually test 0xff sync bytes
include/hw/pci/pcie_aer.h | 4 -
include/qapi/qmp/qdict.h | 8 ++
include/qapi/qmp/qlist.h | 8 ++
block.c | 58 ++++++---------
block/blkdebug.c | 8 +-
block/blkverify.c | 11 ++-
block/curl.c | 2 +-
block/file-posix.c | 8 +-
block/file-win32.c | 4 +-
block/iscsi.c | 2 +-
block/nbd.c | 41 +++++------
block/nfs.c | 43 +++++------
block/null.c | 2 +-
block/qcow2.c | 4 +-
block/quorum.c | 16 ++--
block/rbd.c | 16 ++--
block/ssh.c | 16 ++--
block/vvfat.c | 10 +--
blockdev.c | 30 ++++----
hw/block/xen_disk.c | 2 +-
hw/pci/pcie_aer.c | 48 +++++++-----
hw/usb/xen-usb.c | 12 +--
monitor.c | 23 +++---
qapi/qmp-event.c | 2 +-
qemu-img.c | 6 +-
qemu-io.c | 2 +-
qemu-nbd.c | 2 +-
qobject/qdict.c | 2 +-
target/s390x/cpu_models.c | 4 +-
tests/check-qdict.c | 142 ++++++++++++++++++------------------
tests/check-qlist.c | 4 +-
tests/device-introspect-test.c | 4 +-
tests/fdc-test.c | 5 +-
tests/libqtest.c | 8 ++
tests/test-qemu-opts.c | 4 +-
tests/test-qga.c | 34 +++++++--
tests/test-qmp-commands.c | 30 ++++----
tests/test-qmp-event.c | 30 ++++----
tests/test-qobject-output-visitor.c | 6 +-
util/qemu-option.c | 6 +-
MAINTAINERS | 1 +
scripts/coccinelle/qobject.cocci | 35 +++++++++
42 files changed, 375 insertions(+), 328 deletions(-)
create mode 100644 scripts/coccinelle/qobject.cocci
--
2.9.3
^ permalink raw reply [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 01/13] pci: Use struct instead of QDict to pass back parameters
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-05 22:04 ` Michael S. Tsirkin
2017-04-06 5:41 ` Marcel Apfelbaum
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection Eric Blake
` (13 subsequent siblings)
14 siblings, 2 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru, Michael S. Tsirkin, Marcel Apfelbaum
It's simpler to just use a C struct than it is to bundle things
into a QDict in one function just to pull them back out in the
caller. Plus, doing this gets rid of one more user of dynamic
JSON through qobject_from_jsonf(), as well as a memory leak of
the QDict.
While cleaning the code, fix things to report all errors (the
code was previously silently ignoring a failure of
pcie_aer_inject_error(), at a distance).
Signed-off-by: Eric Blake <eblake@redhat.com>
---
v3: more cleanups suggested by Markus, drop R-b
---
hw/pci/pcie_aer.c | 44 ++++++++++++++++++++++++++------------------
1 file changed, 26 insertions(+), 18 deletions(-)
diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index a8c1820..653af86 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -44,6 +44,13 @@
#define PCI_ERR_SRC_COR_OFFS 0
#define PCI_ERR_SRC_UNCOR_OFFS 2
+typedef struct PCIEErrorDetails {
+ const char *id;
+ const char *root_bus;
+ int bus;
+ int devfn;
+} PCIEErrorDetails;
+
/* From 6.2.7 Error Listing and Rules. Table 6-2, 6-3 and 6-4 */
static uint32_t pcie_aer_uncor_default_severity(uint32_t status)
{
@@ -942,8 +949,14 @@ static int pcie_aer_parse_error_string(const char *error_name,
return -EINVAL;
}
+/*
+ * Inject an error described by @qdict.
+ * On success, set @details to show where error was sent.
+ * Return negative errno if injection failed and a message was emitted.
+ */
static int do_pcie_aer_inject_error(Monitor *mon,
- const QDict *qdict, QObject **ret_data)
+ const QDict *qdict,
+ PCIEErrorDetails *details)
{
const char *id = qdict_get_str(qdict, "id");
const char *error_name;
@@ -1005,33 +1018,28 @@ static int do_pcie_aer_inject_error(Monitor *mon,
err.prefix[3] = qdict_get_try_int(qdict, "prefix3", 0);
ret = pcie_aer_inject_error(dev, &err);
- *ret_data = qobject_from_jsonf("{'id': %s, "
- "'root_bus': %s, 'bus': %d, 'devfn': %d, "
- "'ret': %d}",
- id, pci_root_bus_path(dev),
- pci_bus_num(dev->bus), dev->devfn,
- ret);
- assert(*ret_data);
+ if (ret < 0) {
+ monitor_printf(mon, "failed to inject error: %s\n",
+ strerror(-ret));
+ return ret;
+ }
+ details->id = id;
+ details->root_bus = pci_root_bus_path(dev);
+ details->bus = pci_bus_num(dev->bus);
+ details->devfn = dev->devfn;
return 0;
}
void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict)
{
- QObject *data;
- int devfn;
+ PCIEErrorDetails data;
if (do_pcie_aer_inject_error(mon, qdict, &data) < 0) {
return;
}
- qdict = qobject_to_qdict(data);
- assert(qdict);
-
- devfn = (int)qdict_get_int(qdict, "devfn");
monitor_printf(mon, "OK id: %s root bus: %s, bus: %x devfn: %x.%x\n",
- qdict_get_str(qdict, "id"),
- qdict_get_str(qdict, "root_bus"),
- (int) qdict_get_int(qdict, "bus"),
- PCI_SLOT(devfn), PCI_FUNC(devfn));
+ data.id, data.root_bus, data.bus,
+ PCI_SLOT(data.devfn), PCI_FUNC(data.devfn));
}
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 01/13] pci: Use struct instead of QDict to pass back parameters Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-05 19:57 ` Philippe Mathieu-Daudé
` (2 more replies)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts Eric Blake
` (12 subsequent siblings)
14 siblings, 3 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru, Michael S. Tsirkin, Marcel Apfelbaum
No one outside of pcie_aer.h was using error injection; mark them
static for internal use.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
v3: new patch, suggested by Markus
---
include/hw/pci/pcie_aer.h | 4 ----
hw/pci/pcie_aer.c | 4 ++--
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/include/hw/pci/pcie_aer.h b/include/hw/pci/pcie_aer.h
index 526802b..729a943 100644
--- a/include/hw/pci/pcie_aer.h
+++ b/include/hw/pci/pcie_aer.h
@@ -100,8 +100,4 @@ void pcie_aer_root_write_config(PCIDevice *dev,
uint32_t addr, uint32_t val, int len,
uint32_t root_cmd_prev);
-/* error injection */
-int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err);
-void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg);
-
#endif /* QEMU_PCIE_AER_H */
diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index 653af86..828052b 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -376,7 +376,7 @@ static void pcie_aer_msg_root_port(PCIDevice *dev, const PCIEAERMsg *msg)
*
* Walk up the bus tree from the device, propagate the error message.
*/
-void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg)
+static void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg)
{
uint8_t type;
@@ -631,7 +631,7 @@ static bool pcie_aer_inject_uncor_error(PCIEAERInject *inj, bool is_fatal)
* Figure 6-2: Flowchart Showing Sequence of Device Error Signaling and Logging
* Operations
*/
-int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err)
+static int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err)
{
uint8_t *aer_cap = NULL;
uint16_t devctl = 0;
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 01/13] pci: Use struct instead of QDict to pass back parameters Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-05 19:57 ` Philippe Mathieu-Daudé
` (2 more replies)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 04/13] coccinelle: Add script to remove useless QObject casts Eric Blake
` (11 subsequent siblings)
14 siblings, 3 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru, Richard Henderson, Alexander Graf
An upcoming Coccinelle cleanup script wanted to reformat the casts
present in this file - but on closer look, we don't need the casts
at all because C automatically converts void* to any other pointer.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
target/s390x/cpu_models.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 1434d15..ce461cc 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -376,12 +376,12 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
static void qdict_add_disabled_feat(const char *name, void *opaque)
{
- qdict_put((QDict *) opaque, name, qbool_from_bool(false));
+ qdict_put(opaque, name, qbool_from_bool(false));
}
static void qdict_add_enabled_feat(const char *name, void *opaque)
{
- qdict_put((QDict *) opaque, name, qbool_from_bool(true));
+ qdict_put(opaque, name, qbool_from_bool(true));
}
/* convert S390CPUDef into a static CpuModelInfo */
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 04/13] coccinelle: Add script to remove useless QObject casts
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (2 preceding siblings ...)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 05/13] qobject: Drop " Eric Blake
` (10 subsequent siblings)
14 siblings, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru
We have macros in place to make it less verbose to add a subtype
of QObject to both QDict and QList. While we have made cleanups
like this in the past (see commit fcfcd8ffc, for example), having
it be automated by Coccinelle makes it easier to maintain.
The script is separate from the cleanups, for ease of review and
backporting. A later patch will then add further possible cleanups.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
MAINTAINERS | 1 +
scripts/coccinelle/qobject.cocci | 13 +++++++++++++
2 files changed, 14 insertions(+)
create mode 100644 scripts/coccinelle/qobject.cocci
diff --git a/MAINTAINERS b/MAINTAINERS
index c60235e..430efb0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1395,6 +1395,7 @@ S: Supported
F: qobject/
F: include/qapi/qmp/
X: include/qapi/qmp/dispatch.h
+F: scripts/coccinelle/qobject.cocci
F: tests/check-qdict.c
F: tests/check-qfloat.c
F: tests/check-qint.c
diff --git a/scripts/coccinelle/qobject.cocci b/scripts/coccinelle/qobject.cocci
new file mode 100644
index 0000000..aa899e2
--- /dev/null
+++ b/scripts/coccinelle/qobject.cocci
@@ -0,0 +1,13 @@
+// Use QDict macros where they make sense
+@@
+expression Obj, Key, E;
+@@
+- qdict_put_obj(Obj, Key, QOBJECT(E));
++ qdict_put(Obj, Key, E);
+
+// Use QList macros where they make sense
+@@
+expression Obj, E;
+@@
+- qlist_append_obj(Obj, QOBJECT(E));
++ qlist_append(Obj, E);
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 05/13] qobject: Drop useless QObject casts
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (3 preceding siblings ...)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 04/13] coccinelle: Add script to remove useless QObject casts Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-07 9:04 ` Stefan Hajnoczi
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 06/13] qobject: Add helper macros for common scalar insertions Eric Blake
` (9 subsequent siblings)
14 siblings, 1 reply; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel
Cc: armbru, Kevin Wolf, Max Reitz, Stefan Hajnoczi, Stefan Weil,
Alberto Garcia, Michael Roth, open list:Block layer core
We have macros in place to make it less verbose to add a subtype
of QObject to both QDict and QList. While we have made cleanups
like this in the past (see commit fcfcd8ffc, for example), having
it be automated by Coccinelle makes it easier to maintain.
Patch created mechanically via:
spatch --sp-file scripts/coccinelle/qobject.cocci \
--macro-file scripts/cocci-macro-file.h --dir . --in-place
then I verified that no manual touchups were required.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
block.c | 12 ++++--------
block/blkdebug.c | 4 ++--
block/blkverify.c | 7 +++----
block/file-posix.c | 6 +++---
block/file-win32.c | 4 ++--
block/quorum.c | 16 ++++++----------
tests/check-qdict.c | 20 ++++++++++----------
tests/test-qmp-commands.c | 24 ++++++++++++------------
8 files changed, 42 insertions(+), 51 deletions(-)
diff --git a/block.c b/block.c
index 927ba89..1803334 100644
--- a/block.c
+++ b/block.c
@@ -4658,11 +4658,9 @@ void bdrv_refresh_filename(BlockDriverState *bs)
* contain a representation of the filename, therefore the following
* suffices without querying the (exact_)filename of this BDS. */
if (bs->file->bs->full_open_options) {
- qdict_put_obj(opts, "driver",
- QOBJECT(qstring_from_str(drv->format_name)));
+ qdict_put(opts, "driver", qstring_from_str(drv->format_name));
QINCREF(bs->file->bs->full_open_options);
- qdict_put_obj(opts, "file",
- QOBJECT(bs->file->bs->full_open_options));
+ qdict_put(opts, "file", bs->file->bs->full_open_options);
bs->full_open_options = opts;
} else {
@@ -4678,8 +4676,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
opts = qdict_new();
append_open_options(opts, bs);
- qdict_put_obj(opts, "driver",
- QOBJECT(qstring_from_str(drv->format_name)));
+ qdict_put(opts, "driver", qstring_from_str(drv->format_name));
if (bs->exact_filename[0]) {
/* This may not work for all block protocol drivers (some may
@@ -4689,8 +4686,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
* needs some special format of the options QDict, it needs to
* implement the driver-specific bdrv_refresh_filename() function.
*/
- qdict_put_obj(opts, "filename",
- QOBJECT(qstring_from_str(bs->exact_filename)));
+ qdict_put(opts, "filename", qstring_from_str(bs->exact_filename));
}
bs->full_open_options = opts;
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 67e8024..c5d4772 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -695,10 +695,10 @@ static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)
}
opts = qdict_new();
- qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("blkdebug")));
+ qdict_put(opts, "driver", qstring_from_str("blkdebug"));
QINCREF(bs->file->bs->full_open_options);
- qdict_put_obj(opts, "image", QOBJECT(bs->file->bs->full_open_options));
+ qdict_put(opts, "image", bs->file->bs->full_open_options);
for (e = qdict_first(options); e; e = qdict_next(options, e)) {
if (strcmp(qdict_entry_key(e), "x-image")) {
diff --git a/block/blkverify.c b/block/blkverify.c
index 9a1e21c..79c8914 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -291,13 +291,12 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)
&& s->test_file->bs->full_open_options)
{
QDict *opts = qdict_new();
- qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("blkverify")));
+ qdict_put(opts, "driver", qstring_from_str("blkverify"));
QINCREF(bs->file->bs->full_open_options);
- qdict_put_obj(opts, "raw", QOBJECT(bs->file->bs->full_open_options));
+ qdict_put(opts, "raw", bs->file->bs->full_open_options);
QINCREF(s->test_file->bs->full_open_options);
- qdict_put_obj(opts, "test",
- QOBJECT(s->test_file->bs->full_open_options));
+ qdict_put(opts, "test", s->test_file->bs->full_open_options);
bs->full_open_options = opts;
}
diff --git a/block/file-posix.c b/block/file-posix.c
index 0c48968..5370ba0 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -377,7 +377,7 @@ static void raw_parse_filename(const char *filename, QDict *options,
* function call can be ignored. */
strstart(filename, "file:", &filename);
- qdict_put_obj(options, "filename", QOBJECT(qstring_from_str(filename)));
+ qdict_put(options, "filename", qstring_from_str(filename));
}
static QemuOptsList raw_runtime_opts = {
@@ -2150,7 +2150,7 @@ static void hdev_parse_filename(const char *filename, QDict *options,
/* The prefix is optional, just as for "file". */
strstart(filename, "host_device:", &filename);
- qdict_put_obj(options, "filename", QOBJECT(qstring_from_str(filename)));
+ qdict_put(options, "filename", qstring_from_str(filename));
}
static bool hdev_is_sg(BlockDriverState *bs)
@@ -2449,7 +2449,7 @@ static void cdrom_parse_filename(const char *filename, QDict *options,
/* The prefix is optional, just as for "file". */
strstart(filename, "host_cdrom:", &filename);
- qdict_put_obj(options, "filename", QOBJECT(qstring_from_str(filename)));
+ qdict_put(options, "filename", qstring_from_str(filename));
}
#endif
diff --git a/block/file-win32.c b/block/file-win32.c
index 800fabd..57c4a78 100644
--- a/block/file-win32.c
+++ b/block/file-win32.c
@@ -282,7 +282,7 @@ static void raw_parse_filename(const char *filename, QDict *options,
* function call can be ignored. */
strstart(filename, "file:", &filename);
- qdict_put_obj(options, "filename", QOBJECT(qstring_from_str(filename)));
+ qdict_put(options, "filename", qstring_from_str(filename));
}
static QemuOptsList raw_runtime_opts = {
@@ -669,7 +669,7 @@ static void hdev_parse_filename(const char *filename, QDict *options,
/* The prefix is optional, just as for "file". */
strstart(filename, "host_device:", &filename);
- qdict_put_obj(options, "filename", QOBJECT(qstring_from_str(filename)));
+ qdict_put(options, "filename", qstring_from_str(filename));
}
static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
diff --git a/block/quorum.c b/block/quorum.c
index 40205fb..f7949e2 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -1096,19 +1096,15 @@ static void quorum_refresh_filename(BlockDriverState *bs, QDict *options)
children = qlist_new();
for (i = 0; i < s->num_children; i++) {
QINCREF(s->children[i]->bs->full_open_options);
- qlist_append_obj(children,
- QOBJECT(s->children[i]->bs->full_open_options));
+ qlist_append(children, s->children[i]->bs->full_open_options);
}
opts = qdict_new();
- qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("quorum")));
- qdict_put_obj(opts, QUORUM_OPT_VOTE_THRESHOLD,
- QOBJECT(qint_from_int(s->threshold)));
- qdict_put_obj(opts, QUORUM_OPT_BLKVERIFY,
- QOBJECT(qbool_from_bool(s->is_blkverify)));
- qdict_put_obj(opts, QUORUM_OPT_REWRITE,
- QOBJECT(qbool_from_bool(s->rewrite_corrupted)));
- qdict_put_obj(opts, "children", QOBJECT(children));
+ qdict_put(opts, "driver", qstring_from_str("quorum"));
+ qdict_put(opts, QUORUM_OPT_VOTE_THRESHOLD, qint_from_int(s->threshold));
+ qdict_put(opts, QUORUM_OPT_BLKVERIFY, qbool_from_bool(s->is_blkverify));
+ qdict_put(opts, QUORUM_OPT_REWRITE, qbool_from_bool(s->rewrite_corrupted));
+ qdict_put(opts, "children", children);
bs->full_open_options = opts;
}
diff --git a/tests/check-qdict.c b/tests/check-qdict.c
index 81162ee..9cdc985 100644
--- a/tests/check-qdict.c
+++ b/tests/check-qdict.c
@@ -47,7 +47,7 @@ static void qdict_put_obj_test(void)
qdict = qdict_new();
// key "" will have tdb hash 12345
- qdict_put_obj(qdict, "", QOBJECT(qint_from_int(num)));
+ qdict_put(qdict, "", qint_from_int(num));
g_assert(qdict_size(qdict) == 1);
ent = QLIST_FIRST(&qdict->table[12345 % QDICT_BUCKET_MAX]);
@@ -66,8 +66,8 @@ static void qdict_destroy_simple_test(void)
QDict *qdict;
qdict = qdict_new();
- qdict_put_obj(qdict, "num", QOBJECT(qint_from_int(0)));
- qdict_put_obj(qdict, "str", QOBJECT(qstring_from_str("foo")));
+ qdict_put(qdict, "num", qint_from_int(0));
+ qdict_put(qdict, "str", qstring_from_str("foo"));
QDECREF(qdict);
}
@@ -297,16 +297,16 @@ static void qdict_flatten_test(void)
qdict_put(dict1, "a", qint_from_int(0));
qdict_put(dict1, "b", qint_from_int(1));
- qlist_append_obj(list1, QOBJECT(qint_from_int(23)));
- qlist_append_obj(list1, QOBJECT(qint_from_int(66)));
- qlist_append_obj(list1, QOBJECT(dict1));
- qlist_append_obj(list2, QOBJECT(qint_from_int(42)));
- qlist_append_obj(list2, QOBJECT(list1));
+ qlist_append(list1, qint_from_int(23));
+ qlist_append(list1, qint_from_int(66));
+ qlist_append(list1, dict1);
+ qlist_append(list2, qint_from_int(42));
+ qlist_append(list2, list1);
qdict_put(dict2, "c", qint_from_int(2));
qdict_put(dict2, "d", qint_from_int(3));
- qdict_put_obj(dict3, "e", QOBJECT(list2));
- qdict_put_obj(dict3, "f", QOBJECT(dict2));
+ qdict_put(dict3, "e", list2);
+ qdict_put(dict3, "f", dict2);
qdict_put(dict3, "g", qint_from_int(4));
qdict_flatten(dict3);
diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c
index 0f81a98..ac3fd03 100644
--- a/tests/test-qmp-commands.c
+++ b/tests/test-qmp-commands.c
@@ -94,7 +94,7 @@ static void test_dispatch_cmd(void)
QDict *req = qdict_new();
QObject *resp;
- qdict_put_obj(req, "execute", QOBJECT(qstring_from_str("user_def_cmd")));
+ qdict_put(req, "execute", qstring_from_str("user_def_cmd"));
resp = qmp_dispatch(&qmp_commands, QOBJECT(req));
assert(resp != NULL);
@@ -111,7 +111,7 @@ static void test_dispatch_cmd_failure(void)
QDict *args = qdict_new();
QObject *resp;
- qdict_put_obj(req, "execute", QOBJECT(qstring_from_str("user_def_cmd2")));
+ qdict_put(req, "execute", qstring_from_str("user_def_cmd2"));
resp = qmp_dispatch(&qmp_commands, QOBJECT(req));
assert(resp != NULL);
@@ -125,7 +125,7 @@ static void test_dispatch_cmd_failure(void)
qdict_put(args, "a", qint_from_int(66));
qdict_put(req, "arguments", args);
- qdict_put_obj(req, "execute", QOBJECT(qstring_from_str("user_def_cmd")));
+ qdict_put(req, "execute", qstring_from_str("user_def_cmd"));
resp = qmp_dispatch(&qmp_commands, QOBJECT(req));
assert(resp != NULL);
@@ -164,14 +164,14 @@ static void test_dispatch_cmd_io(void)
QDict *ret_dict_dict2, *ret_dict_dict2_userdef;
QInt *ret3;
- qdict_put_obj(ud1a, "integer", QOBJECT(qint_from_int(42)));
- qdict_put_obj(ud1a, "string", QOBJECT(qstring_from_str("hello")));
- qdict_put_obj(ud1b, "integer", QOBJECT(qint_from_int(422)));
- qdict_put_obj(ud1b, "string", QOBJECT(qstring_from_str("hello2")));
- qdict_put_obj(args, "ud1a", QOBJECT(ud1a));
- qdict_put_obj(args, "ud1b", QOBJECT(ud1b));
- qdict_put_obj(req, "arguments", QOBJECT(args));
- qdict_put_obj(req, "execute", QOBJECT(qstring_from_str("user_def_cmd2")));
+ qdict_put(ud1a, "integer", qint_from_int(42));
+ qdict_put(ud1a, "string", qstring_from_str("hello"));
+ qdict_put(ud1b, "integer", qint_from_int(422));
+ qdict_put(ud1b, "string", qstring_from_str("hello2"));
+ qdict_put(args, "ud1a", ud1a);
+ qdict_put(args, "ud1b", ud1b);
+ qdict_put(req, "arguments", args);
+ qdict_put(req, "execute", qstring_from_str("user_def_cmd2"));
ret = qobject_to_qdict(test_qmp_dispatch(req));
@@ -244,7 +244,7 @@ static void test_dealloc_partial(void)
Visitor *v;
ud2_dict = qdict_new();
- qdict_put_obj(ud2_dict, "string0", QOBJECT(qstring_from_str(text)));
+ qdict_put(ud2_dict, "string0", qstring_from_str(text));
v = qobject_input_visitor_new(QOBJECT(ud2_dict));
visit_type_UserDefTwo(v, NULL, &ud2, &err);
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 06/13] qobject: Add helper macros for common scalar insertions
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (4 preceding siblings ...)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 05/13] qobject: Drop " Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-11 17:06 ` Markus Armbruster
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 07/13] block: Use simpler QDict/QList scalar insertion macros Eric Blake
` (8 subsequent siblings)
14 siblings, 1 reply; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru
Rather than making lots of callers wrap a scalar in a QInt, QString,
or QBool, provide helper macros that do the wrapping automatically.
Update the Coccinelle script to make mass conversions easy, although
the conversion itself will be done as a separate patches to ease
review and backport efforts.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
include/qapi/qmp/qdict.h | 8 ++++++++
include/qapi/qmp/qlist.h | 8 ++++++++
scripts/coccinelle/qobject.cocci | 22 ++++++++++++++++++++++
3 files changed, 38 insertions(+)
diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h
index fe9a4c5..9d9f9a3 100644
--- a/include/qapi/qmp/qdict.h
+++ b/include/qapi/qmp/qdict.h
@@ -52,6 +52,14 @@ void qdict_destroy_obj(QObject *obj);
#define qdict_put(qdict, key, obj) \
qdict_put_obj(qdict, key, QOBJECT(obj))
+/* Helpers for int, bool, and const char*. */
+#define qdict_put_int(qdict, key, value) \
+ qdict_put(qdict, key, qint_from_int(value))
+#define qdict_put_bool(qdict, key, value) \
+ qdict_put(qdict, key, qbool_from_bool(value))
+#define qdict_put_str(qdict, key, value) \
+ qdict_put(qdict, key, qstring_from_str(value))
+
/* High level helpers */
double qdict_get_double(const QDict *qdict, const char *key);
int64_t qdict_get_int(const QDict *qdict, const char *key);
diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h
index a84117e..659325a 100644
--- a/include/qapi/qmp/qlist.h
+++ b/include/qapi/qmp/qlist.h
@@ -29,6 +29,14 @@ typedef struct QList {
#define qlist_append(qlist, obj) \
qlist_append_obj(qlist, QOBJECT(obj))
+/* Helpers for int, bool, and const char*. */
+#define qlist_append_int(qlist, value) \
+ qlist_append(qlist, qint_from_int(value))
+#define qlist_append_bool(qlist, value) \
+ qlist_append(qlist, qbool_from_bool(value))
+#define qlist_append_str(qlist, value) \
+ qlist_append(qlist, qstring_from_str(value))
+
#define QLIST_FOREACH_ENTRY(qlist, var) \
for ((var) = ((qlist)->head.tqh_first); \
(var); \
diff --git a/scripts/coccinelle/qobject.cocci b/scripts/coccinelle/qobject.cocci
index aa899e2..97703a4 100644
--- a/scripts/coccinelle/qobject.cocci
+++ b/scripts/coccinelle/qobject.cocci
@@ -2,12 +2,34 @@
@@
expression Obj, Key, E;
@@
+(
- qdict_put_obj(Obj, Key, QOBJECT(E));
+ qdict_put(Obj, Key, E);
+|
+- qdict_put(Obj, Key, qint_from_int(E));
++ qdict_put_int(Obj, Key, E);
+|
+- qdict_put(Obj, Key, qbool_from_bool(E));
++ qdict_put_bool(Obj, Key, E);
+|
+- qdict_put(Obj, Key, qstring_from_str(E));
++ qdict_put_str(Obj, Key, E);
+)
// Use QList macros where they make sense
@@
expression Obj, E;
@@
+(
- qlist_append_obj(Obj, QOBJECT(E));
+ qlist_append(Obj, E);
+|
+- qlist_append(Obj, qint_from_int(E));
++ qlist_append_int(Obj, E);
+|
+- qlist_append(Obj, qbool_from_bool(E));
++ qlist_append_bool(Obj, E);
+|
+- qlist_append(Obj, qstring_from_str(E));
++ qlist_append_str(Obj, E);
+)
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 07/13] block: Use simpler QDict/QList scalar insertion macros
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (5 preceding siblings ...)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 06/13] qobject: Add helper macros for common scalar insertions Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-05 19:51 ` Richard W.M. Jones
2017-04-07 9:04 ` Stefan Hajnoczi
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 08/13] tests: " Eric Blake
` (7 subsequent siblings)
14 siblings, 2 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel
Cc: armbru, Kevin Wolf, Max Reitz, Stefan Hajnoczi, Jeff Cody,
Stefan Weil, Ronnie Sahlberg, Paolo Bonzini, Peter Lieven,
Fam Zheng, Alberto Garcia, Josh Durgin, Richard W.M. Jones,
open list:blkdebug
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 block --in-place
then touched up manually to fix a couple of '?:' back to original spacing.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
block/blkdebug.c | 6 +++---
block/blkverify.c | 6 +++---
block/curl.c | 2 +-
block/file-posix.c | 8 ++++----
block/file-win32.c | 4 ++--
block/iscsi.c | 2 +-
block/nbd.c | 41 ++++++++++++++++++++---------------------
block/nfs.c | 43 +++++++++++++++++--------------------------
block/null.c | 2 +-
block/qcow2.c | 4 ++--
block/quorum.c | 8 ++++----
block/rbd.c | 16 ++++++++--------
block/ssh.c | 16 +++++++---------
block/vvfat.c | 10 +++++-----
14 files changed, 78 insertions(+), 90 deletions(-)
diff --git a/block/blkdebug.c b/block/blkdebug.c
index c5d4772..f69e136 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -301,7 +301,7 @@ static void blkdebug_parse_filename(const char *filename, QDict *options,
if (!strstart(filename, "blkdebug:", &filename)) {
/* There was no prefix; therefore, all options have to be already
present in the QDict (except for the filename) */
- qdict_put(options, "x-image", qstring_from_str(filename));
+ qdict_put_str(options, "x-image", filename);
return;
}
@@ -320,7 +320,7 @@ static void blkdebug_parse_filename(const char *filename, QDict *options,
/* TODO Allow multi-level nesting and set file.filename here */
filename = c + 1;
- qdict_put(options, "x-image", qstring_from_str(filename));
+ qdict_put_str(options, "x-image", filename);
}
static QemuOptsList runtime_opts = {
@@ -695,7 +695,7 @@ static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)
}
opts = qdict_new();
- qdict_put(opts, "driver", qstring_from_str("blkdebug"));
+ qdict_put_str(opts, "driver", "blkdebug");
QINCREF(bs->file->bs->full_open_options);
qdict_put(opts, "image", bs->file->bs->full_open_options);
diff --git a/block/blkverify.c b/block/blkverify.c
index 79c8914..5c7d506 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -67,7 +67,7 @@ static void blkverify_parse_filename(const char *filename, QDict *options,
if (!strstart(filename, "blkverify:", &filename)) {
/* There was no prefix; therefore, all options have to be already
present in the QDict (except for the filename) */
- qdict_put(options, "x-image", qstring_from_str(filename));
+ qdict_put_str(options, "x-image", filename);
return;
}
@@ -84,7 +84,7 @@ static void blkverify_parse_filename(const char *filename, QDict *options,
/* TODO Allow multi-level nesting and set file.filename here */
filename = c + 1;
- qdict_put(options, "x-image", qstring_from_str(filename));
+ qdict_put_str(options, "x-image", filename);
}
static QemuOptsList runtime_opts = {
@@ -291,7 +291,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)
&& s->test_file->bs->full_open_options)
{
QDict *opts = qdict_new();
- qdict_put(opts, "driver", qstring_from_str("blkverify"));
+ qdict_put_str(opts, "driver", "blkverify");
QINCREF(bs->file->bs->full_open_options);
qdict_put(opts, "raw", bs->file->bs->full_open_options);
diff --git a/block/curl.c b/block/curl.c
index 2708d57..aa6e8cc 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -548,7 +548,7 @@ static void curl_clean_state(CURLState *s)
static void curl_parse_filename(const char *filename, QDict *options,
Error **errp)
{
- qdict_put(options, CURL_BLOCK_OPT_URL, qstring_from_str(filename));
+ qdict_put_str(options, CURL_BLOCK_OPT_URL, filename);
}
static void curl_detach_aio_context(BlockDriverState *bs)
diff --git a/block/file-posix.c b/block/file-posix.c
index 5370ba0..9431ad1 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -377,7 +377,7 @@ static void raw_parse_filename(const char *filename, QDict *options,
* function call can be ignored. */
strstart(filename, "file:", &filename);
- qdict_put(options, "filename", qstring_from_str(filename));
+ qdict_put_str(options, "filename", filename);
}
static QemuOptsList raw_runtime_opts = {
@@ -2150,7 +2150,7 @@ static void hdev_parse_filename(const char *filename, QDict *options,
/* The prefix is optional, just as for "file". */
strstart(filename, "host_device:", &filename);
- qdict_put(options, "filename", qstring_from_str(filename));
+ qdict_put_str(options, "filename", filename);
}
static bool hdev_is_sg(BlockDriverState *bs)
@@ -2239,7 +2239,7 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
goto hdev_open_Mac_error;
}
- qdict_put(options, "filename", qstring_from_str(bsd_path));
+ qdict_put_str(options, "filename", bsd_path);
hdev_open_Mac_error:
g_free(mediaType);
@@ -2449,7 +2449,7 @@ static void cdrom_parse_filename(const char *filename, QDict *options,
/* The prefix is optional, just as for "file". */
strstart(filename, "host_cdrom:", &filename);
- qdict_put(options, "filename", qstring_from_str(filename));
+ qdict_put_str(options, "filename", filename);
}
#endif
diff --git a/block/file-win32.c b/block/file-win32.c
index 57c4a78..0d455d1 100644
--- a/block/file-win32.c
+++ b/block/file-win32.c
@@ -282,7 +282,7 @@ static void raw_parse_filename(const char *filename, QDict *options,
* function call can be ignored. */
strstart(filename, "file:", &filename);
- qdict_put(options, "filename", qstring_from_str(filename));
+ qdict_put_str(options, "filename", filename);
}
static QemuOptsList raw_runtime_opts = {
@@ -669,7 +669,7 @@ static void hdev_parse_filename(const char *filename, QDict *options,
/* The prefix is optional, just as for "file". */
strstart(filename, "host_device:", &filename);
- qdict_put(options, "filename", qstring_from_str(filename));
+ qdict_put_str(options, "filename", filename);
}
static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
diff --git a/block/iscsi.c b/block/iscsi.c
index 716e74a..1534ab6 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -2102,7 +2102,7 @@ static int iscsi_create(const char *filename, QemuOpts *opts, Error **errp)
iscsilun = bs->opaque;
bs_options = qdict_new();
- qdict_put(bs_options, "filename", qstring_from_str(filename));
+ qdict_put_str(bs_options, "filename", filename);
ret = iscsi_open(bs, bs_options, 0, NULL);
QDECREF(bs_options);
diff --git a/block/nbd.c b/block/nbd.c
index 814ab26d..b3545f5 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -79,7 +79,7 @@ static int nbd_parse_uri(const char *filename, QDict *options)
p = uri->path ? uri->path : "/";
p += strspn(p, "/");
if (p[0]) {
- qdict_put(options, "export", qstring_from_str(p));
+ qdict_put_str(options, "export", p);
}
qp = query_params_parse(uri->query);
@@ -94,9 +94,8 @@ static int nbd_parse_uri(const char *filename, QDict *options)
ret = -EINVAL;
goto out;
}
- qdict_put(options, "server.type", qstring_from_str("unix"));
- qdict_put(options, "server.path",
- qstring_from_str(qp->p[0].value));
+ qdict_put_str(options, "server.type", "unix");
+ qdict_put_str(options, "server.path", qp->p[0].value);
} else {
QString *host;
char *port_str;
@@ -115,11 +114,11 @@ static int nbd_parse_uri(const char *filename, QDict *options)
host = qstring_from_str(uri->server);
}
- qdict_put(options, "server.type", qstring_from_str("inet"));
+ qdict_put_str(options, "server.type", "inet");
qdict_put(options, "server.host", host);
port_str = g_strdup_printf("%d", uri->port ?: NBD_DEFAULT_PORT);
- qdict_put(options, "server.port", qstring_from_str(port_str));
+ qdict_put_str(options, "server.port", port_str);
g_free(port_str);
}
@@ -181,7 +180,7 @@ static void nbd_parse_filename(const char *filename, QDict *options,
export_name[0] = 0; /* truncate 'file' */
export_name += strlen(EN_OPTSTR);
- qdict_put(options, "export", qstring_from_str(export_name));
+ qdict_put_str(options, "export", export_name);
}
/* extract the host_spec - fail if it's not nbd:... */
@@ -196,8 +195,8 @@ static void nbd_parse_filename(const char *filename, QDict *options,
/* are we a UNIX or TCP socket? */
if (strstart(host_spec, "unix:", &unixpath)) {
- qdict_put(options, "server.type", qstring_from_str("unix"));
- qdict_put(options, "server.path", qstring_from_str(unixpath));
+ qdict_put_str(options, "server.type", "unix");
+ qdict_put_str(options, "server.path", unixpath);
} else {
InetSocketAddress *addr = NULL;
@@ -206,9 +205,9 @@ static void nbd_parse_filename(const char *filename, QDict *options,
goto out;
}
- qdict_put(options, "server.type", qstring_from_str("inet"));
- qdict_put(options, "server.host", qstring_from_str(addr->host));
- qdict_put(options, "server.port", qstring_from_str(addr->port));
+ qdict_put_str(options, "server.type", "inet");
+ qdict_put_str(options, "server.host", addr->host);
+ qdict_put_str(options, "server.port", addr->port);
qapi_free_InetSocketAddress(addr);
}
@@ -247,13 +246,13 @@ static bool nbd_process_legacy_socket_options(QDict *output_options,
return false;
}
- qdict_put(output_options, "server.type", qstring_from_str("unix"));
- qdict_put(output_options, "server.path", qstring_from_str(path));
+ qdict_put_str(output_options, "server.type", "unix");
+ qdict_put_str(output_options, "server.path", path);
} else if (host) {
- qdict_put(output_options, "server.type", qstring_from_str("inet"));
- qdict_put(output_options, "server.host", qstring_from_str(host));
- qdict_put(output_options, "server.port",
- qstring_from_str(port ?: stringify(NBD_DEFAULT_PORT)));
+ qdict_put_str(output_options, "server.type", "inet");
+ qdict_put_str(output_options, "server.host", host);
+ qdict_put_str(output_options, "server.port",
+ port ?: stringify(NBD_DEFAULT_PORT));
}
return true;
@@ -528,7 +527,7 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
path = s->saddr->u.q_unix.path;
} /* else can't represent as pseudo-filename */
- qdict_put(opts, "driver", qstring_from_str("nbd"));
+ qdict_put_str(opts, "driver", "nbd");
if (path && s->export) {
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
@@ -551,10 +550,10 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
qdict_put_obj(opts, "server", saddr_qdict);
if (s->export) {
- qdict_put(opts, "export", qstring_from_str(s->export));
+ qdict_put_str(opts, "export", s->export);
}
if (s->tlscredsid) {
- qdict_put(opts, "tls-creds", qstring_from_str(s->tlscredsid));
+ qdict_put_str(opts, "tls-creds", s->tlscredsid);
}
qdict_flatten(opts);
diff --git a/block/nfs.c b/block/nfs.c
index 0816678..bfeebc1 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -104,9 +104,9 @@ static int nfs_parse_uri(const char *filename, QDict *options, Error **errp)
goto out;
}
- qdict_put(options, "server.host", qstring_from_str(uri->server));
- qdict_put(options, "server.type", qstring_from_str("inet"));
- qdict_put(options, "path", qstring_from_str(uri->path));
+ qdict_put_str(options, "server.host", uri->server);
+ qdict_put_str(options, "server.type", "inet");
+ qdict_put_str(options, "path", uri->path);
for (i = 0; i < qp->n; i++) {
unsigned long long val;
@@ -121,23 +121,17 @@ static int nfs_parse_uri(const char *filename, QDict *options, Error **errp)
goto out;
}
if (!strcmp(qp->p[i].name, "uid")) {
- qdict_put(options, "user",
- qstring_from_str(qp->p[i].value));
+ qdict_put_str(options, "user", qp->p[i].value);
} else if (!strcmp(qp->p[i].name, "gid")) {
- qdict_put(options, "group",
- qstring_from_str(qp->p[i].value));
+ qdict_put_str(options, "group", qp->p[i].value);
} else if (!strcmp(qp->p[i].name, "tcp-syncnt")) {
- qdict_put(options, "tcp-syn-count",
- qstring_from_str(qp->p[i].value));
+ qdict_put_str(options, "tcp-syn-count", qp->p[i].value);
} else if (!strcmp(qp->p[i].name, "readahead")) {
- qdict_put(options, "readahead-size",
- qstring_from_str(qp->p[i].value));
+ qdict_put_str(options, "readahead-size", qp->p[i].value);
} else if (!strcmp(qp->p[i].name, "pagecache")) {
- qdict_put(options, "page-cache-size",
- qstring_from_str(qp->p[i].value));
+ qdict_put_str(options, "page-cache-size", qp->p[i].value);
} else if (!strcmp(qp->p[i].name, "debug")) {
- qdict_put(options, "debug",
- qstring_from_str(qp->p[i].value));
+ qdict_put_str(options, "debug", qp->p[i].value);
} else {
error_setg(errp, "Unknown NFS parameter name: %s",
qp->p[i].name);
@@ -811,7 +805,7 @@ static void nfs_refresh_filename(BlockDriverState *bs, QDict *options)
QObject *server_qdict;
Visitor *ov;
- qdict_put(opts, "driver", qstring_from_str("nfs"));
+ qdict_put_str(opts, "driver", "nfs");
if (client->uid && !client->gid) {
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
@@ -834,28 +828,25 @@ static void nfs_refresh_filename(BlockDriverState *bs, QDict *options)
visit_type_NFSServer(ov, NULL, &client->server, &error_abort);
visit_complete(ov, &server_qdict);
qdict_put_obj(opts, "server", server_qdict);
- qdict_put(opts, "path", qstring_from_str(client->path));
+ qdict_put_str(opts, "path", client->path);
if (client->uid) {
- qdict_put(opts, "user", qint_from_int(client->uid));
+ qdict_put_int(opts, "user", client->uid);
}
if (client->gid) {
- qdict_put(opts, "group", qint_from_int(client->gid));
+ qdict_put_int(opts, "group", client->gid);
}
if (client->tcp_syncnt) {
- qdict_put(opts, "tcp-syn-cnt",
- qint_from_int(client->tcp_syncnt));
+ qdict_put_int(opts, "tcp-syn-cnt", client->tcp_syncnt);
}
if (client->readahead) {
- qdict_put(opts, "readahead-size",
- qint_from_int(client->readahead));
+ qdict_put_int(opts, "readahead-size", client->readahead);
}
if (client->pagecache) {
- qdict_put(opts, "page-cache-size",
- qint_from_int(client->pagecache));
+ qdict_put_int(opts, "page-cache-size", client->pagecache);
}
if (client->debug) {
- qdict_put(opts, "debug", qint_from_int(client->debug));
+ qdict_put_int(opts, "debug", client->debug);
}
visit_free(ov);
diff --git a/block/null.c b/block/null.c
index b300390..876f909 100644
--- a/block/null.c
+++ b/block/null.c
@@ -232,7 +232,7 @@ static void null_refresh_filename(BlockDriverState *bs, QDict *opts)
bs->drv->format_name);
}
- qdict_put(opts, "driver", qstring_from_str(bs->drv->format_name));
+ qdict_put_str(opts, "driver", bs->drv->format_name);
bs->full_open_options = opts;
}
diff --git a/block/qcow2.c b/block/qcow2.c
index 6a92d2e..49c737f 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2265,7 +2265,7 @@ static int qcow2_create2(const char *filename, int64_t total_size,
* table)
*/
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str("qcow2"));
+ qdict_put_str(options, "driver", "qcow2");
blk = blk_new_open(filename, NULL, options,
BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_NO_FLUSH,
&local_err);
@@ -2327,7 +2327,7 @@ static int qcow2_create2(const char *filename, int64_t total_size,
/* Reopen the image without BDRV_O_NO_FLUSH to flush it before returning */
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str("qcow2"));
+ qdict_put_str(options, "driver", "qcow2");
blk = blk_new_open(filename, NULL, options,
BDRV_O_RDWR | BDRV_O_NO_BACKING, &local_err);
if (blk == NULL) {
diff --git a/block/quorum.c b/block/quorum.c
index f7949e2..1b2a8c3 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -1100,10 +1100,10 @@ static void quorum_refresh_filename(BlockDriverState *bs, QDict *options)
}
opts = qdict_new();
- qdict_put(opts, "driver", qstring_from_str("quorum"));
- qdict_put(opts, QUORUM_OPT_VOTE_THRESHOLD, qint_from_int(s->threshold));
- qdict_put(opts, QUORUM_OPT_BLKVERIFY, qbool_from_bool(s->is_blkverify));
- qdict_put(opts, QUORUM_OPT_REWRITE, qbool_from_bool(s->rewrite_corrupted));
+ qdict_put_str(opts, "driver", "quorum");
+ qdict_put_int(opts, QUORUM_OPT_VOTE_THRESHOLD, s->threshold);
+ qdict_put_bool(opts, QUORUM_OPT_BLKVERIFY, s->is_blkverify);
+ qdict_put_bool(opts, QUORUM_OPT_REWRITE, s->rewrite_corrupted);
qdict_put(opts, "children", children);
bs->full_open_options = opts;
diff --git a/block/rbd.c b/block/rbd.c
index 1ceeeb5..2354ffc 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -154,20 +154,20 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
goto done;
}
qemu_rbd_unescape(found_str);
- qdict_put(options, "pool", qstring_from_str(found_str));
+ qdict_put_str(options, "pool", found_str);
if (strchr(p, '@')) {
found_str = qemu_rbd_next_tok(p, '@', &p);
qemu_rbd_unescape(found_str);
- qdict_put(options, "image", qstring_from_str(found_str));
+ qdict_put_str(options, "image", found_str);
found_str = qemu_rbd_next_tok(p, ':', &p);
qemu_rbd_unescape(found_str);
- qdict_put(options, "snapshot", qstring_from_str(found_str));
+ qdict_put_str(options, "snapshot", found_str);
} else {
found_str = qemu_rbd_next_tok(p, ':', &p);
qemu_rbd_unescape(found_str);
- qdict_put(options, "image", qstring_from_str(found_str));
+ qdict_put_str(options, "image", found_str);
}
if (!p) {
goto done;
@@ -189,9 +189,9 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
qemu_rbd_unescape(value);
if (!strcmp(name, "conf")) {
- qdict_put(options, "conf", qstring_from_str(value));
+ qdict_put_str(options, "conf", value);
} else if (!strcmp(name, "id")) {
- qdict_put(options, "user" , qstring_from_str(value));
+ qdict_put_str(options, "user", value);
} else {
/*
* We pass these internally to qemu_rbd_set_keypairs(), so
@@ -204,8 +204,8 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
if (!keypairs) {
keypairs = qlist_new();
}
- qlist_append(keypairs, qstring_from_str(name));
- qlist_append(keypairs, qstring_from_str(value));
+ qlist_append_str(keypairs, name);
+ qlist_append_str(keypairs, value);
}
}
diff --git a/block/ssh.c b/block/ssh.c
index 471ba8a..34a2f79 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -227,24 +227,23 @@ static int parse_uri(const char *filename, QDict *options, Error **errp)
}
if(uri->user && strcmp(uri->user, "") != 0) {
- qdict_put(options, "user", qstring_from_str(uri->user));
+ qdict_put_str(options, "user", uri->user);
}
- qdict_put(options, "server.host", qstring_from_str(uri->server));
+ qdict_put_str(options, "server.host", uri->server);
port_str = g_strdup_printf("%d", uri->port ?: 22);
- qdict_put(options, "server.port", qstring_from_str(port_str));
+ qdict_put_str(options, "server.port", port_str);
g_free(port_str);
- qdict_put(options, "path", qstring_from_str(uri->path));
+ qdict_put_str(options, "path", uri->path);
/* Pick out any query parameters that we understand, and ignore
* the rest.
*/
for (i = 0; i < qp->n; ++i) {
if (strcmp(qp->p[i].name, "host_key_check") == 0) {
- qdict_put(options, "host_key_check",
- qstring_from_str(qp->p[i].value));
+ qdict_put_str(options, "host_key_check", qp->p[i].value);
}
}
@@ -574,9 +573,8 @@ static bool ssh_process_legacy_socket_options(QDict *output_opts,
}
if (host) {
- qdict_put(output_opts, "server.host", qstring_from_str(host));
- qdict_put(output_opts, "server.port",
- qstring_from_str(port ?: stringify(22)));
+ qdict_put_str(output_opts, "server.host", host);
+ qdict_put_str(output_opts, "server.port", port ?: stringify(22));
}
return true;
diff --git a/block/vvfat.c b/block/vvfat.c
index af5153d..8b4e4eb 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -1057,10 +1057,10 @@ static void vvfat_parse_filename(const char *filename, QDict *options,
}
/* Fill in the options QDict */
- qdict_put(options, "dir", qstring_from_str(filename));
- qdict_put(options, "fat-type", qint_from_int(fat_type));
- qdict_put(options, "floppy", qbool_from_bool(floppy));
- qdict_put(options, "rw", qbool_from_bool(rw));
+ qdict_put_str(options, "dir", filename);
+ qdict_put_int(options, "fat-type", fat_type);
+ qdict_put_bool(options, "floppy", floppy);
+ qdict_put_bool(options, "rw", rw);
}
static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
@@ -3040,7 +3040,7 @@ static int enable_write_target(BlockDriverState *bs, Error **errp)
}
options = qdict_new();
- qdict_put(options, "write-target.driver", qstring_from_str("qcow"));
+ qdict_put_str(options, "write-target.driver", "qcow");
s->qcow = bdrv_open_child(s->qcow_filename, options, "write-target", bs,
&child_vvfat_qcow, false, errp);
QDECREF(options);
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 08/13] tests: Use simpler QDict/QList scalar insertion macros
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (6 preceding siblings ...)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 07/13] block: Use simpler QDict/QList scalar insertion macros Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-05 19:47 ` Eric Blake
` (6 subsequent siblings)
14 siblings, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru, Michael Roth
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 tests --in-place
then manually checked that no touch-ups were needed.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
tests/check-qdict.c | 134 ++++++++++++++++++------------------
tests/check-qlist.c | 4 +-
tests/device-introspect-test.c | 4 +-
tests/test-qemu-opts.c | 4 +-
tests/test-qmp-commands.c | 24 +++----
tests/test-qmp-event.c | 30 ++++----
tests/test-qobject-output-visitor.c | 6 +-
7 files changed, 103 insertions(+), 103 deletions(-)
diff --git a/tests/check-qdict.c b/tests/check-qdict.c
index 9cdc985..3effca5 100644
--- a/tests/check-qdict.c
+++ b/tests/check-qdict.c
@@ -47,7 +47,7 @@ static void qdict_put_obj_test(void)
qdict = qdict_new();
// key "" will have tdb hash 12345
- qdict_put(qdict, "", qint_from_int(num));
+ qdict_put_int(qdict, "", num);
g_assert(qdict_size(qdict) == 1);
ent = QLIST_FIRST(&qdict->table[12345 % QDICT_BUCKET_MAX]);
@@ -66,8 +66,8 @@ static void qdict_destroy_simple_test(void)
QDict *qdict;
qdict = qdict_new();
- qdict_put(qdict, "num", qint_from_int(0));
- qdict_put(qdict, "str", qstring_from_str("foo"));
+ qdict_put_int(qdict, "num", 0);
+ qdict_put_str(qdict, "str", "foo");
QDECREF(qdict);
}
@@ -80,7 +80,7 @@ static void qdict_get_test(void)
const char *key = "test";
QDict *tests_dict = qdict_new();
- qdict_put(tests_dict, key, qint_from_int(value));
+ qdict_put_int(tests_dict, key, value);
obj = qdict_get(tests_dict, key);
g_assert(obj != NULL);
@@ -98,7 +98,7 @@ static void qdict_get_int_test(void)
const char *key = "int";
QDict *tests_dict = qdict_new();
- qdict_put(tests_dict, key, qint_from_int(value));
+ qdict_put_int(tests_dict, key, value);
ret = qdict_get_int(tests_dict, key);
g_assert(ret == value);
@@ -113,7 +113,7 @@ static void qdict_get_try_int_test(void)
const char *key = "int";
QDict *tests_dict = qdict_new();
- qdict_put(tests_dict, key, qint_from_int(value));
+ qdict_put_int(tests_dict, key, value);
ret = qdict_get_try_int(tests_dict, key, 0);
g_assert(ret == value);
@@ -128,7 +128,7 @@ static void qdict_get_str_test(void)
const char *str = "string";
QDict *tests_dict = qdict_new();
- qdict_put(tests_dict, key, qstring_from_str(str));
+ qdict_put_str(tests_dict, key, str);
p = qdict_get_str(tests_dict, key);
g_assert(p != NULL);
@@ -144,7 +144,7 @@ static void qdict_get_try_str_test(void)
const char *str = "string";
QDict *tests_dict = qdict_new();
- qdict_put(tests_dict, key, qstring_from_str(str));
+ qdict_put_str(tests_dict, key, str);
p = qdict_get_try_str(tests_dict, key);
g_assert(p != NULL);
@@ -188,7 +188,7 @@ static void qdict_haskey_test(void)
const char *key = "test";
QDict *tests_dict = qdict_new();
- qdict_put(tests_dict, key, qint_from_int(0));
+ qdict_put_int(tests_dict, key, 0);
g_assert(qdict_haskey(tests_dict, key) == 1);
QDECREF(tests_dict);
@@ -199,7 +199,7 @@ static void qdict_del_test(void)
const char *key = "key test";
QDict *tests_dict = qdict_new();
- qdict_put(tests_dict, key, qstring_from_str("foo"));
+ qdict_put_str(tests_dict, key, "foo");
g_assert(qdict_size(tests_dict) == 1);
qdict_del(tests_dict, key);
@@ -226,9 +226,9 @@ static void qdict_iterapi_test(void)
g_assert(qdict_first(tests_dict) == NULL);
- qdict_put(tests_dict, "key1", qint_from_int(1));
- qdict_put(tests_dict, "key2", qint_from_int(2));
- qdict_put(tests_dict, "key3", qint_from_int(3));
+ qdict_put_int(tests_dict, "key1", 1);
+ qdict_put_int(tests_dict, "key2", 2);
+ qdict_put_int(tests_dict, "key3", 3);
count = 0;
for (ent = qdict_first(tests_dict); ent; ent = qdict_next(tests_dict, ent)){
@@ -294,20 +294,20 @@ static void qdict_flatten_test(void)
* }
*/
- qdict_put(dict1, "a", qint_from_int(0));
- qdict_put(dict1, "b", qint_from_int(1));
+ qdict_put_int(dict1, "a", 0);
+ qdict_put_int(dict1, "b", 1);
- qlist_append(list1, qint_from_int(23));
- qlist_append(list1, qint_from_int(66));
+ qlist_append_int(list1, 23);
+ qlist_append_int(list1, 66);
qlist_append(list1, dict1);
- qlist_append(list2, qint_from_int(42));
+ qlist_append_int(list2, 42);
qlist_append(list2, list1);
- qdict_put(dict2, "c", qint_from_int(2));
- qdict_put(dict2, "d", qint_from_int(3));
+ qdict_put_int(dict2, "c", 2);
+ qdict_put_int(dict2, "d", 3);
qdict_put(dict3, "e", list2);
qdict_put(dict3, "f", dict2);
- qdict_put(dict3, "g", qint_from_int(4));
+ qdict_put_int(dict3, "g", 4);
qdict_flatten(dict3);
@@ -369,12 +369,12 @@ static void qdict_array_split_test(void)
* This example is given in the comment of qdict_array_split().
*/
- qdict_put(test_dict, "1.x", qint_from_int(0));
- qdict_put(test_dict, "4.y", qint_from_int(1));
- qdict_put(test_dict, "0.a", qint_from_int(42));
- qdict_put(test_dict, "o.o", qint_from_int(7));
- qdict_put(test_dict, "0.b", qint_from_int(23));
- qdict_put(test_dict, "2", qint_from_int(66));
+ qdict_put_int(test_dict, "1.x", 0);
+ qdict_put_int(test_dict, "4.y", 1);
+ qdict_put_int(test_dict, "0.a", 42);
+ qdict_put_int(test_dict, "o.o", 7);
+ qdict_put_int(test_dict, "0.b", 23);
+ qdict_put_int(test_dict, "2", 66);
qdict_array_split(test_dict, &test_list);
@@ -441,9 +441,9 @@ static void qdict_array_split_test(void)
test_dict = qdict_new();
- qdict_put(test_dict, "0", qint_from_int(42));
- qdict_put(test_dict, "1", qint_from_int(23));
- qdict_put(test_dict, "1.x", qint_from_int(84));
+ qdict_put_int(test_dict, "0", 42);
+ qdict_put_int(test_dict, "1", 23);
+ qdict_put_int(test_dict, "1.x", 84);
qdict_array_split(test_dict, &test_list);
@@ -472,38 +472,38 @@ static void qdict_array_entries_test(void)
g_assert_cmpint(qdict_array_entries(dict, "foo."), ==, 0);
- qdict_put(dict, "bar", qint_from_int(0));
- qdict_put(dict, "baz.0", qint_from_int(0));
+ qdict_put_int(dict, "bar", 0);
+ qdict_put_int(dict, "baz.0", 0);
g_assert_cmpint(qdict_array_entries(dict, "foo."), ==, 0);
- qdict_put(dict, "foo.1", qint_from_int(0));
+ qdict_put_int(dict, "foo.1", 0);
g_assert_cmpint(qdict_array_entries(dict, "foo."), ==, -EINVAL);
- qdict_put(dict, "foo.0", qint_from_int(0));
+ qdict_put_int(dict, "foo.0", 0);
g_assert_cmpint(qdict_array_entries(dict, "foo."), ==, 2);
- qdict_put(dict, "foo.bar", qint_from_int(0));
+ qdict_put_int(dict, "foo.bar", 0);
g_assert_cmpint(qdict_array_entries(dict, "foo."), ==, -EINVAL);
qdict_del(dict, "foo.bar");
- qdict_put(dict, "foo.2.a", qint_from_int(0));
- qdict_put(dict, "foo.2.b", qint_from_int(0));
- qdict_put(dict, "foo.2.c", qint_from_int(0));
+ qdict_put_int(dict, "foo.2.a", 0);
+ qdict_put_int(dict, "foo.2.b", 0);
+ qdict_put_int(dict, "foo.2.c", 0);
g_assert_cmpint(qdict_array_entries(dict, "foo."), ==, 3);
g_assert_cmpint(qdict_array_entries(dict, ""), ==, -EINVAL);
QDECREF(dict);
dict = qdict_new();
- qdict_put(dict, "1", qint_from_int(0));
+ qdict_put_int(dict, "1", 0);
g_assert_cmpint(qdict_array_entries(dict, ""), ==, -EINVAL);
- qdict_put(dict, "0", qint_from_int(0));
+ qdict_put_int(dict, "0", 0);
g_assert_cmpint(qdict_array_entries(dict, ""), ==, 2);
- qdict_put(dict, "bar", qint_from_int(0));
+ qdict_put_int(dict, "bar", 0);
g_assert_cmpint(qdict_array_entries(dict, ""), ==, -EINVAL);
qdict_del(dict, "bar");
- qdict_put(dict, "2.a", qint_from_int(0));
- qdict_put(dict, "2.b", qint_from_int(0));
- qdict_put(dict, "2.c", qint_from_int(0));
+ qdict_put_int(dict, "2.a", 0);
+ qdict_put_int(dict, "2.b", 0);
+ qdict_put_int(dict, "2.c", 0);
g_assert_cmpint(qdict_array_entries(dict, ""), ==, 3);
QDECREF(dict);
@@ -529,7 +529,7 @@ static void qdict_join_test(void)
/* First iteration: Test movement */
/* Second iteration: Test empty source and non-empty destination */
- qdict_put(dict2, "foo", qint_from_int(42));
+ qdict_put_int(dict2, "foo", 42);
for (i = 0; i < 2; i++) {
qdict_join(dict1, dict2, overwrite);
@@ -541,7 +541,7 @@ static void qdict_join_test(void)
}
/* Test non-empty source and destination without conflict */
- qdict_put(dict2, "bar", qint_from_int(23));
+ qdict_put_int(dict2, "bar", 23);
qdict_join(dict1, dict2, overwrite);
@@ -552,7 +552,7 @@ static void qdict_join_test(void)
g_assert(qdict_get_int(dict1, "bar") == 23);
/* Test conflict */
- qdict_put(dict2, "foo", qint_from_int(84));
+ qdict_put_int(dict2, "foo", 84);
qdict_join(dict1, dict2, overwrite);
@@ -594,15 +594,15 @@ static void qdict_crumple_test_recursive(void)
QList *rules;
src = qdict_new();
- qdict_put(src, "vnc.listen.addr", qstring_from_str("127.0.0.1"));
- qdict_put(src, "vnc.listen.port", qstring_from_str("5901"));
- qdict_put(src, "vnc.acl.rules.0.match", qstring_from_str("fred"));
- qdict_put(src, "vnc.acl.rules.0.policy", qstring_from_str("allow"));
- qdict_put(src, "vnc.acl.rules.1.match", qstring_from_str("bob"));
- qdict_put(src, "vnc.acl.rules.1.policy", qstring_from_str("deny"));
- qdict_put(src, "vnc.acl.default", qstring_from_str("deny"));
- qdict_put(src, "vnc.acl..name", qstring_from_str("acl0"));
- qdict_put(src, "vnc.acl.rule..name", qstring_from_str("acl0"));
+ qdict_put_str(src, "vnc.listen.addr", "127.0.0.1");
+ qdict_put_str(src, "vnc.listen.port", "5901");
+ qdict_put_str(src, "vnc.acl.rules.0.match", "fred");
+ qdict_put_str(src, "vnc.acl.rules.0.policy", "allow");
+ qdict_put_str(src, "vnc.acl.rules.1.match", "bob");
+ qdict_put_str(src, "vnc.acl.rules.1.policy", "deny");
+ qdict_put_str(src, "vnc.acl.default", "deny");
+ qdict_put_str(src, "vnc.acl..name", "acl0");
+ qdict_put_str(src, "vnc.acl.rule..name", "acl0");
dst = qobject_to_qdict(qdict_crumple(src, &error_abort));
g_assert(dst);
@@ -669,8 +669,8 @@ static void qdict_crumple_test_bad_inputs(void)
src = qdict_new();
/* rule.0 can't be both a string and a dict */
- qdict_put(src, "rule.0", qstring_from_str("fred"));
- qdict_put(src, "rule.0.policy", qstring_from_str("allow"));
+ qdict_put_str(src, "rule.0", "fred");
+ qdict_put_str(src, "rule.0.policy", "allow");
g_assert(qdict_crumple(src, &error) == NULL);
g_assert(error != NULL);
@@ -680,8 +680,8 @@ static void qdict_crumple_test_bad_inputs(void)
src = qdict_new();
/* rule can't be both a list and a dict */
- qdict_put(src, "rule.0", qstring_from_str("fred"));
- qdict_put(src, "rule.a", qstring_from_str("allow"));
+ qdict_put_str(src, "rule.0", "fred");
+ qdict_put_str(src, "rule.a", "allow");
g_assert(qdict_crumple(src, &error) == NULL);
g_assert(error != NULL);
@@ -692,7 +692,7 @@ static void qdict_crumple_test_bad_inputs(void)
src = qdict_new();
/* The input should be flat, ie no dicts or lists */
qdict_put(src, "rule.a", qdict_new());
- qdict_put(src, "rule.b", qstring_from_str("allow"));
+ qdict_put_str(src, "rule.b", "allow");
g_assert(qdict_crumple(src, &error) == NULL);
g_assert(error != NULL);
@@ -702,8 +702,8 @@ static void qdict_crumple_test_bad_inputs(void)
src = qdict_new();
/* List indexes must not have gaps */
- qdict_put(src, "rule.0", qstring_from_str("deny"));
- qdict_put(src, "rule.3", qstring_from_str("allow"));
+ qdict_put_str(src, "rule.0", "deny");
+ qdict_put_str(src, "rule.3", "allow");
g_assert(qdict_crumple(src, &error) == NULL);
g_assert(error != NULL);
@@ -713,8 +713,8 @@ static void qdict_crumple_test_bad_inputs(void)
src = qdict_new();
/* List indexes must be in %zu format */
- qdict_put(src, "rule.0", qstring_from_str("deny"));
- qdict_put(src, "rule.+1", qstring_from_str("allow"));
+ qdict_put_str(src, "rule.0", "deny");
+ qdict_put_str(src, "rule.+1", "allow");
g_assert(qdict_crumple(src, &error) == NULL);
g_assert(error != NULL);
@@ -733,8 +733,8 @@ static void qdict_put_exists_test(void)
const char *key = "exists";
QDict *tests_dict = qdict_new();
- qdict_put(tests_dict, key, qint_from_int(1));
- qdict_put(tests_dict, key, qint_from_int(2));
+ qdict_put_int(tests_dict, key, 1);
+ qdict_put_int(tests_dict, key, 2);
value = qdict_get_int(tests_dict, key);
g_assert(value == 2);
diff --git a/tests/check-qlist.c b/tests/check-qlist.c
index e16da5e..4983867 100644
--- a/tests/check-qlist.c
+++ b/tests/check-qlist.c
@@ -74,7 +74,7 @@ static void qlist_destroy_test(void)
qlist = qlist_new();
for (i = 0; i < 42; i++)
- qlist_append(qlist, qint_from_int(i));
+ qlist_append_int(qlist, i);
QDECREF(qlist);
}
@@ -103,7 +103,7 @@ static void qlist_iter_test(void)
qlist = qlist_new();
for (i = 0; i < iter_max; i++)
- qlist_append(qlist, qint_from_int(i));
+ qlist_append_int(qlist, i);
iter_called = 0;
qlist_iter(qlist, iter_func, NULL);
diff --git a/tests/device-introspect-test.c b/tests/device-introspect-test.c
index c5637cc..b1abb2a 100644
--- a/tests/device-introspect-test.c
+++ b/tests/device-introspect-test.c
@@ -32,9 +32,9 @@ static QList *qom_list_types(const char *implements, bool abstract)
QList *ret;
QDict *args = qdict_new();
- qdict_put(args, "abstract", qbool_from_bool(abstract));
+ qdict_put_bool(args, "abstract", abstract);
if (implements) {
- qdict_put(args, "implements", qstring_from_str(implements));
+ qdict_put_str(args, "implements", implements);
}
resp = qmp("{'execute': 'qom-list-types',"
" 'arguments': %p }", args);
diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index 0ad74b4..cc1bb1a 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -299,7 +299,7 @@ static void test_qemu_opt_get_size(void)
dict = qdict_new();
g_assert(dict != NULL);
- qdict_put(dict, "size1", qstring_from_str("10"));
+ qdict_put_str(dict, "size1", "10");
qemu_opts_absorb_qdict(opts, dict, &error_abort);
g_assert(error_abort == NULL);
@@ -309,7 +309,7 @@ static void test_qemu_opt_get_size(void)
g_assert(opt == 10);
/* reset value */
- qdict_put(dict, "size1", qstring_from_str("15"));
+ qdict_put_str(dict, "size1", "15");
qemu_opts_absorb_qdict(opts, dict, &error_abort);
g_assert(error_abort == NULL);
diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c
index ac3fd03..acdded4 100644
--- a/tests/test-qmp-commands.c
+++ b/tests/test-qmp-commands.c
@@ -94,7 +94,7 @@ static void test_dispatch_cmd(void)
QDict *req = qdict_new();
QObject *resp;
- qdict_put(req, "execute", qstring_from_str("user_def_cmd"));
+ qdict_put_str(req, "execute", "user_def_cmd");
resp = qmp_dispatch(&qmp_commands, QOBJECT(req));
assert(resp != NULL);
@@ -111,7 +111,7 @@ static void test_dispatch_cmd_failure(void)
QDict *args = qdict_new();
QObject *resp;
- qdict_put(req, "execute", qstring_from_str("user_def_cmd2"));
+ qdict_put_str(req, "execute", "user_def_cmd2");
resp = qmp_dispatch(&qmp_commands, QOBJECT(req));
assert(resp != NULL);
@@ -122,10 +122,10 @@ static void test_dispatch_cmd_failure(void)
/* check that with extra arguments it throws an error */
req = qdict_new();
- qdict_put(args, "a", qint_from_int(66));
+ qdict_put_int(args, "a", 66);
qdict_put(req, "arguments", args);
- qdict_put(req, "execute", qstring_from_str("user_def_cmd"));
+ qdict_put_str(req, "execute", "user_def_cmd");
resp = qmp_dispatch(&qmp_commands, QOBJECT(req));
assert(resp != NULL);
@@ -164,14 +164,14 @@ static void test_dispatch_cmd_io(void)
QDict *ret_dict_dict2, *ret_dict_dict2_userdef;
QInt *ret3;
- qdict_put(ud1a, "integer", qint_from_int(42));
- qdict_put(ud1a, "string", qstring_from_str("hello"));
- qdict_put(ud1b, "integer", qint_from_int(422));
- qdict_put(ud1b, "string", qstring_from_str("hello2"));
+ qdict_put_int(ud1a, "integer", 42);
+ qdict_put_str(ud1a, "string", "hello");
+ qdict_put_int(ud1b, "integer", 422);
+ qdict_put_str(ud1b, "string", "hello2");
qdict_put(args, "ud1a", ud1a);
qdict_put(args, "ud1b", ud1b);
qdict_put(req, "arguments", args);
- qdict_put(req, "execute", qstring_from_str("user_def_cmd2"));
+ qdict_put_str(req, "execute", "user_def_cmd2");
ret = qobject_to_qdict(test_qmp_dispatch(req));
@@ -190,9 +190,9 @@ static void test_dispatch_cmd_io(void)
assert(!strcmp(qdict_get_str(ret_dict_dict2, "string"), "blah4"));
QDECREF(ret);
- qdict_put(args3, "a", qint_from_int(66));
+ qdict_put_int(args3, "a", 66);
qdict_put(req, "arguments", args3);
- qdict_put(req, "execute", qstring_from_str("guest-get-time"));
+ qdict_put_str(req, "execute", "guest-get-time");
ret3 = qobject_to_qint(test_qmp_dispatch(req));
assert(qint_get_int(ret3) == 66);
@@ -244,7 +244,7 @@ static void test_dealloc_partial(void)
Visitor *v;
ud2_dict = qdict_new();
- qdict_put(ud2_dict, "string0", qstring_from_str(text));
+ qdict_put_str(ud2_dict, "string0", text);
v = qobject_input_visitor_new(QOBJECT(ud2_dict));
visit_type_UserDefTwo(v, NULL, &ud2, &err);
diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
index 7bb621b..4c0f096 100644
--- a/tests/test-qmp-event.c
+++ b/tests/test-qmp-event.c
@@ -153,7 +153,7 @@ static void test_event_a(TestEventData *data,
{
QDict *d;
d = data->expect;
- qdict_put(d, "event", qstring_from_str("EVENT_A"));
+ qdict_put_str(d, "event", "EVENT_A");
qapi_event_send_event_a(&error_abort);
}
@@ -162,7 +162,7 @@ static void test_event_b(TestEventData *data,
{
QDict *d;
d = data->expect;
- qdict_put(d, "event", qstring_from_str("EVENT_B"));
+ qdict_put_str(d, "event", "EVENT_B");
qapi_event_send_event_b(&error_abort);
}
@@ -177,16 +177,16 @@ static void test_event_c(TestEventData *data,
b.has_enum1 = false;
d_b = qdict_new();
- qdict_put(d_b, "integer", qint_from_int(2));
- qdict_put(d_b, "string", qstring_from_str("test1"));
+ qdict_put_int(d_b, "integer", 2);
+ qdict_put_str(d_b, "string", "test1");
d_data = qdict_new();
- qdict_put(d_data, "a", qint_from_int(1));
+ qdict_put_int(d_data, "a", 1);
qdict_put(d_data, "b", d_b);
- qdict_put(d_data, "c", qstring_from_str("test2"));
+ qdict_put_str(d_data, "c", "test2");
d = data->expect;
- qdict_put(d, "event", qstring_from_str("EVENT_C"));
+ qdict_put_str(d, "event", "EVENT_C");
qdict_put(d, "data", d_data);
qapi_event_send_event_c(true, 1, true, &b, "test2", &error_abort);
@@ -213,22 +213,22 @@ static void test_event_d(TestEventData *data,
a.enum2 = ENUM_ONE_VALUE2;
d_struct1 = qdict_new();
- qdict_put(d_struct1, "integer", qint_from_int(2));
- qdict_put(d_struct1, "string", qstring_from_str("test1"));
- qdict_put(d_struct1, "enum1", qstring_from_str("value1"));
+ qdict_put_int(d_struct1, "integer", 2);
+ qdict_put_str(d_struct1, "string", "test1");
+ qdict_put_str(d_struct1, "enum1", "value1");
d_a = qdict_new();
qdict_put(d_a, "struct1", d_struct1);
- qdict_put(d_a, "string", qstring_from_str("test2"));
- qdict_put(d_a, "enum2", qstring_from_str("value2"));
+ qdict_put_str(d_a, "string", "test2");
+ qdict_put_str(d_a, "enum2", "value2");
d_data = qdict_new();
qdict_put(d_data, "a", d_a);
- qdict_put(d_data, "b", qstring_from_str("test3"));
- qdict_put(d_data, "enum3", qstring_from_str("value3"));
+ qdict_put_str(d_data, "b", "test3");
+ qdict_put_str(d_data, "enum3", "value3");
d = data->expect;
- qdict_put(d, "event", qstring_from_str("EVENT_D"));
+ qdict_put_str(d, "event", "EVENT_D");
qdict_put(d, "data", d_data);
qapi_event_send_event_d(&a, "test3", false, NULL, true, ENUM_ONE_VALUE3,
diff --git a/tests/test-qobject-output-visitor.c b/tests/test-qobject-output-visitor.c
index c213fce..94b9518 100644
--- a/tests/test-qobject-output-visitor.c
+++ b/tests/test-qobject-output-visitor.c
@@ -343,9 +343,9 @@ static void test_visitor_out_any(TestOutputVisitorData *data,
visitor_reset(data);
qdict = qdict_new();
- qdict_put(qdict, "integer", qint_from_int(-42));
- qdict_put(qdict, "boolean", qbool_from_bool(true));
- qdict_put(qdict, "string", qstring_from_str("foo"));
+ qdict_put_int(qdict, "integer", -42);
+ qdict_put_bool(qdict, "boolean", true);
+ qdict_put_str(qdict, "string", "foo");
qobj = QOBJECT(qdict);
visit_type_any(data->ov, NULL, &qobj, &error_abort);
qobject_decref(qobj);
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 09/13] qobject: Use simpler QDict/QList scalar insertion macros
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection Eric Blake
` (13 subsequent siblings)
14 siblings, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel
Cc: armbru, Kevin Wolf, Max Reitz, Stefano Stabellini,
Anthony Perard, Gerd Hoffmann, Dr. David Alan Gilbert,
Michael Roth, Paolo Bonzini, Richard Henderson, Alexander Graf,
open list:Block layer core, open list:X86
We now have macros in place to make it less verbose to add a scalar
to QDict and QList, so use them. To make this patch smaller to
review, a couple of subdirectories were done in earlier patches.
Patch created mechanically via:
spatch --sp-file scripts/coccinelle/qobject.cocci \
--macro-file scripts/cocci-macro-file.h --dir . --in-place
and needed only one touch-up in monitor.c to avoid a long line.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
block.c | 45 +++++++++++++++++++--------------------------
blockdev.c | 30 +++++++++++++-----------------
hw/block/xen_disk.c | 2 +-
hw/usb/xen-usb.c | 12 ++++++------
monitor.c | 23 +++++++++++------------
qapi/qmp-event.c | 2 +-
qemu-img.c | 6 +++---
qemu-io.c | 2 +-
qemu-nbd.c | 2 +-
qobject/qdict.c | 2 +-
target/s390x/cpu_models.c | 4 ++--
util/qemu-option.c | 2 +-
12 files changed, 60 insertions(+), 72 deletions(-)
diff --git a/block.c b/block.c
index 1803334..9b87bf6 100644
--- a/block.c
+++ b/block.c
@@ -937,16 +937,14 @@ static void update_flags_from_options(int *flags, QemuOpts *opts)
static void update_options_from_flags(QDict *options, int flags)
{
if (!qdict_haskey(options, BDRV_OPT_CACHE_DIRECT)) {
- qdict_put(options, BDRV_OPT_CACHE_DIRECT,
- qbool_from_bool(flags & BDRV_O_NOCACHE));
+ qdict_put_bool(options, BDRV_OPT_CACHE_DIRECT, flags & BDRV_O_NOCACHE);
}
if (!qdict_haskey(options, BDRV_OPT_CACHE_NO_FLUSH)) {
- qdict_put(options, BDRV_OPT_CACHE_NO_FLUSH,
- qbool_from_bool(flags & BDRV_O_NO_FLUSH));
+ qdict_put_bool(options, BDRV_OPT_CACHE_NO_FLUSH,
+ flags & BDRV_O_NO_FLUSH);
}
if (!qdict_haskey(options, BDRV_OPT_READ_ONLY)) {
- qdict_put(options, BDRV_OPT_READ_ONLY,
- qbool_from_bool(!(flags & BDRV_O_RDWR)));
+ qdict_put_bool(options, BDRV_OPT_READ_ONLY, !(flags & BDRV_O_RDWR));
}
}
@@ -1362,7 +1360,7 @@ static int bdrv_fill_options(QDict **options, const char *filename,
/* Fetch the file name from the options QDict if necessary */
if (protocol && filename) {
if (!qdict_haskey(*options, "filename")) {
- qdict_put(*options, "filename", qstring_from_str(filename));
+ qdict_put_str(*options, "filename", filename);
parse_filename = true;
} else {
error_setg(errp, "Can't specify 'file' and 'filename' options at "
@@ -1383,7 +1381,7 @@ static int bdrv_fill_options(QDict **options, const char *filename,
}
drvname = drv->format_name;
- qdict_put(*options, "driver", qstring_from_str(drvname));
+ qdict_put_str(*options, "driver", drvname);
} else {
error_setg(errp, "Must specify either driver or file");
return -EINVAL;
@@ -2034,7 +2032,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
}
if (bs->backing_format[0] != '\0' && !qdict_haskey(options, "driver")) {
- qdict_put(options, "driver", qstring_from_str(bs->backing_format));
+ qdict_put_str(options, "driver", bs->backing_format);
}
backing_hd = bdrv_open_inherit(*backing_filename ? backing_filename : NULL,
@@ -2189,12 +2187,9 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs,
}
/* Prepare options QDict for the temporary file */
- qdict_put(snapshot_options, "file.driver",
- qstring_from_str("file"));
- qdict_put(snapshot_options, "file.filename",
- qstring_from_str(tmp_filename));
- qdict_put(snapshot_options, "driver",
- qstring_from_str("qcow2"));
+ qdict_put_str(snapshot_options, "file.driver", "file");
+ qdict_put_str(snapshot_options, "file.filename", tmp_filename);
+ qdict_put_str(snapshot_options, "driver", "qcow2");
bs_snapshot = bdrv_open(NULL, NULL, snapshot_options, flags, errp);
snapshot_options = NULL;
@@ -2369,8 +2364,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
goto fail;
}
- qdict_put(options, "file",
- qstring_from_str(bdrv_get_node_name(file_bs)));
+ qdict_put_str(options, "file", bdrv_get_node_name(file_bs));
}
}
@@ -2392,8 +2386,8 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
* sure to update both bs->options (which has the full effective
* options for bs) and options (which has file.* already removed).
*/
- qdict_put(bs->options, "driver", qstring_from_str(drv->format_name));
- qdict_put(options, "driver", qstring_from_str(drv->format_name));
+ qdict_put_str(bs->options, "driver", drv->format_name);
+ qdict_put_str(options, "driver", drv->format_name);
} else if (!drv) {
error_setg(errp, "Must specify either driver or file");
goto fail;
@@ -2768,12 +2762,12 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue,
* that they are checked at the end of this function. */
value = qemu_opt_get(opts, "node-name");
if (value) {
- qdict_put(reopen_state->options, "node-name", qstring_from_str(value));
+ qdict_put_str(reopen_state->options, "node-name", value);
}
value = qemu_opt_get(opts, "driver");
if (value) {
- qdict_put(reopen_state->options, "driver", qstring_from_str(value));
+ qdict_put_str(reopen_state->options, "driver", value);
}
/* if we are to stay read-only, do not allow permission change
@@ -4260,8 +4254,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
if (backing_fmt) {
backing_options = qdict_new();
- qdict_put(backing_options, "driver",
- qstring_from_str(backing_fmt));
+ qdict_put_str(backing_options, "driver", backing_fmt);
}
bs = bdrv_open(full_backing, NULL, backing_options, back_flags,
@@ -4658,7 +4651,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
* contain a representation of the filename, therefore the following
* suffices without querying the (exact_)filename of this BDS. */
if (bs->file->bs->full_open_options) {
- qdict_put(opts, "driver", qstring_from_str(drv->format_name));
+ qdict_put_str(opts, "driver", drv->format_name);
QINCREF(bs->file->bs->full_open_options);
qdict_put(opts, "file", bs->file->bs->full_open_options);
@@ -4676,7 +4669,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
opts = qdict_new();
append_open_options(opts, bs);
- qdict_put(opts, "driver", qstring_from_str(drv->format_name));
+ qdict_put_str(opts, "driver", drv->format_name);
if (bs->exact_filename[0]) {
/* This may not work for all block protocol drivers (some may
@@ -4686,7 +4679,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
* needs some special format of the options QDict, it needs to
* implement the driver-specific bdrv_refresh_filename() function.
*/
- qdict_put(opts, "filename", qstring_from_str(bs->exact_filename));
+ qdict_put_str(opts, "filename", bs->exact_filename);
}
bs->full_open_options = opts;
diff --git a/blockdev.c b/blockdev.c
index 040c152..269a5e1 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -527,7 +527,7 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
error_setg(errp, "Cannot specify both 'driver' and 'format'");
goto early_err;
}
- qdict_put(bs_opts, "driver", qstring_from_str(buf));
+ qdict_put_str(bs_opts, "driver", buf);
}
on_write_error = BLOCKDEV_ON_ERROR_ENOSPC;
@@ -903,10 +903,8 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
copy_on_read = false;
}
- qdict_put(bs_opts, BDRV_OPT_READ_ONLY,
- qstring_from_str(read_only ? "on" : "off"));
- qdict_put(bs_opts, "copy-on-read",
- qstring_from_str(copy_on_read ? "on" :"off"));
+ qdict_put_str(bs_opts, BDRV_OPT_READ_ONLY, read_only ? "on" : "off");
+ qdict_put_str(bs_opts, "copy-on-read", copy_on_read ? "on" : "off");
/* Controller type */
value = qemu_opt_get(legacy_opts, "if");
@@ -1030,7 +1028,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
new_id = g_strdup_printf("%s%s%i", if_name[type],
mediastr, unit_id);
}
- qdict_put(bs_opts, "id", qstring_from_str(new_id));
+ qdict_put_str(bs_opts, "id", new_id);
g_free(new_id);
}
@@ -1067,7 +1065,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
error_report("werror is not supported by this bus type");
goto fail;
}
- qdict_put(bs_opts, "werror", qstring_from_str(werror));
+ qdict_put_str(bs_opts, "werror", werror);
}
rerror = qemu_opt_get(legacy_opts, "rerror");
@@ -1077,7 +1075,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
error_report("rerror is not supported by this bus type");
goto fail;
}
- qdict_put(bs_opts, "rerror", qstring_from_str(rerror));
+ qdict_put_str(bs_opts, "rerror", rerror);
}
/* Actual block device init: Functionality shared with blockdev-add */
@@ -1737,10 +1735,9 @@ static void external_snapshot_prepare(BlkActionState *common,
options = qdict_new();
if (s->has_snapshot_node_name) {
- qdict_put(options, "node-name",
- qstring_from_str(snapshot_node_name));
+ qdict_put_str(options, "node-name", snapshot_node_name);
}
- qdict_put(options, "driver", qstring_from_str(format));
+ qdict_put_str(options, "driver", format);
flags |= BDRV_O_NO_BACKING;
}
@@ -2579,11 +2576,10 @@ void qmp_blockdev_change_medium(bool has_device, const char *device,
options = qdict_new();
detect_zeroes = blk_get_detect_zeroes_from_root_state(blk);
- qdict_put(options, "detect-zeroes",
- qstring_from_str(detect_zeroes ? "on" : "off"));
+ qdict_put_str(options, "detect-zeroes", detect_zeroes ? "on" : "off");
if (has_format) {
- qdict_put(options, "driver", qstring_from_str(format));
+ qdict_put_str(options, "driver", format);
}
medium_bs = bdrv_open(filename, NULL, options, bdrv_flags, errp);
@@ -3251,7 +3247,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, BlockJobTxn *txn,
if (backup->format) {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(backup->format));
+ qdict_put_str(options, "driver", backup->format);
}
target_bs = bdrv_open(backup->target, NULL, options, flags, errp);
@@ -3555,10 +3551,10 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
options = qdict_new();
if (arg->has_node_name) {
- qdict_put(options, "node-name", qstring_from_str(arg->node_name));
+ qdict_put_str(options, "node-name", arg->node_name);
}
if (format) {
- qdict_put(options, "driver", qstring_from_str(format));
+ qdict_put_str(options, "driver", format);
}
/* Mirroring takes care of copy-on-write using the source's backing
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 456a2d5..47b2ca1 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -1082,7 +1082,7 @@ static int blk_connect(struct XenDevice *xendev)
if (strcmp(blkdev->fileproto, "<unset>")) {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(blkdev->fileproto));
+ qdict_put_str(options, "driver", blkdev->fileproto);
}
/* setup via xenbus -> create new block driver instance */
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 8e676e6..6659415 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;
diff --git a/monitor.c b/monitor.c
index be282ec..88f6fe9 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2671,7 +2671,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
}
goto fail;
}
- qdict_put(qdict, key, qstring_from_str(buf));
+ qdict_put_str(qdict, key, buf);
}
break;
case 'O':
@@ -2773,9 +2773,9 @@ static QDict *monitor_parse_arguments(Monitor *mon,
size = -1;
}
}
- qdict_put(qdict, "count", qint_from_int(count));
- qdict_put(qdict, "format", qint_from_int(format));
- qdict_put(qdict, "size", qint_from_int(size));
+ qdict_put_int(qdict, "count", count);
+ qdict_put_int(qdict, "format", format);
+ qdict_put_int(qdict, "size", size);
}
break;
case 'i':
@@ -2818,7 +2818,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
}
val <<= 20;
}
- qdict_put(qdict, key, qint_from_int(val));
+ qdict_put_int(qdict, key, val);
}
break;
case 'o':
@@ -2841,7 +2841,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
monitor_printf(mon, "invalid size\n");
goto fail;
}
- qdict_put(qdict, key, qint_from_int(val));
+ qdict_put_int(qdict, key, val);
p = end;
}
break;
@@ -2897,7 +2897,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
monitor_printf(mon, "Expected 'on' or 'off'\n");
goto fail;
}
- qdict_put(qdict, key, qbool_from_bool(val));
+ qdict_put_bool(qdict, key, val);
}
break;
case '-':
@@ -2928,7 +2928,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
} else {
/* has option */
p++;
- qdict_put(qdict, key, qbool_from_bool(true));
+ qdict_put_bool(qdict, key, true);
}
}
}
@@ -2954,7 +2954,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
cmd->name);
goto fail;
}
- qdict_put(qdict, key, qstring_from_str(p));
+ qdict_put_str(qdict, key, p);
p += len;
}
break;
@@ -3733,9 +3733,8 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
QapiErrorClass_lookup[ERROR_CLASS_COMMAND_NOT_FOUND])) {
/* Provide a more useful error message */
qdict_del(qdict, "desc");
- qdict_put(qdict, "desc",
- qstring_from_str("Expecting capabilities negotiation"
- " with 'qmp_capabilities'"));
+ qdict_put_str(qdict, "desc", "Expecting capabilities negotiation"
+ " with 'qmp_capabilities'");
}
}
diff --git a/qapi/qmp-event.c b/qapi/qmp-event.c
index 802ede4..ba3029c 100644
--- a/qapi/qmp-event.c
+++ b/qapi/qmp-event.c
@@ -51,7 +51,7 @@ static void timestamp_put(QDict *qdict)
QDict *qmp_event_build_dict(const char *event_name)
{
QDict *dict = qdict_new();
- qdict_put(dict, "event", qstring_from_str(event_name));
+ qdict_put_str(dict, "event", event_name);
timestamp_put(dict);
return dict;
}
diff --git a/qemu-img.c b/qemu-img.c
index b220cf7..efb9833 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -313,7 +313,7 @@ static BlockBackend *img_open_file(const char *filename,
if (fmt) {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(fmt));
+ qdict_put_str(options, "driver", fmt);
}
blk = blk_new_open(filename, NULL, options, flags, &local_err);
@@ -3158,7 +3158,7 @@ static int img_rebase(int argc, char **argv)
if (bs->backing_format[0] != '\0') {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(bs->backing_format));
+ qdict_put_str(options, "driver", bs->backing_format);
}
bdrv_get_backing_filename(bs, backing_name, sizeof(backing_name));
@@ -3175,7 +3175,7 @@ static int img_rebase(int argc, char **argv)
if (out_baseimg[0]) {
if (out_basefmt) {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(out_basefmt));
+ qdict_put_str(options, "driver", out_basefmt);
} else {
options = NULL;
}
diff --git a/qemu-io.c b/qemu-io.c
index 427cbae..ed0e2dc 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -601,7 +601,7 @@ int main(int argc, char **argv)
} else {
if (format) {
opts = qdict_new();
- qdict_put(opts, "driver", qstring_from_str(format));
+ qdict_put_str(opts, "driver", format);
}
if (openfile(argv[optind], flags, writethrough, opts)) {
exit(1);
diff --git a/qemu-nbd.c b/qemu-nbd.c
index e080fb7..e4f00e2 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -959,7 +959,7 @@ int main(int argc, char **argv)
} else {
if (fmt) {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(fmt));
+ qdict_put_str(options, "driver", fmt);
}
blk = blk_new_open(srcpath, NULL, options, flags, &local_err);
}
diff --git a/qobject/qdict.c b/qobject/qdict.c
index 291eef1..88e2ecd 100644
--- a/qobject/qdict.c
+++ b/qobject/qdict.c
@@ -463,7 +463,7 @@ void qdict_set_default_str(QDict *dst, const char *key, const char *val)
return;
}
- qdict_put(dst, key, qstring_from_str(val));
+ qdict_put_str(dst, key, val);
}
static void qdict_flatten_qdict(QDict *qdict, QDict *target,
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index ce461cc..8d27363 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -376,12 +376,12 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
static void qdict_add_disabled_feat(const char *name, void *opaque)
{
- qdict_put(opaque, name, qbool_from_bool(false));
+ qdict_put_bool(opaque, name, false);
}
static void qdict_add_enabled_feat(const char *name, void *opaque)
{
- qdict_put(opaque, name, qbool_from_bool(true));
+ qdict_put_bool(opaque, name, true);
}
/* convert S390CPUDef into a static CpuModelInfo */
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 5ce1b5c..a36cafa 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -1060,7 +1060,7 @@ QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict)
qdict = qdict_new();
}
if (opts->id) {
- qdict_put(qdict, "id", qstring_from_str(opts->id));
+ qdict_put_str(qdict, "id", opts->id);
}
QTAILQ_FOREACH(opt, &opts->head, next) {
val = QOBJECT(qstring_from_str(opt->str));
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v3 09/13] qobject: Use simpler QDict/QList scalar insertion macros
@ 2017-04-05 19:47 ` Eric Blake
0 siblings, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Alexander Graf, Stefano Stabellini, Michael Roth,
open list:Block layer core, armbru, Max Reitz, Gerd Hoffmann,
open list:X86, Anthony Perard, Paolo Bonzini,
Dr. David Alan Gilbert, Richard Henderson
We now have macros in place to make it less verbose to add a scalar
to QDict and QList, so use them. To make this patch smaller to
review, a couple of subdirectories were done in earlier patches.
Patch created mechanically via:
spatch --sp-file scripts/coccinelle/qobject.cocci \
--macro-file scripts/cocci-macro-file.h --dir . --in-place
and needed only one touch-up in monitor.c to avoid a long line.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
block.c | 45 +++++++++++++++++++--------------------------
blockdev.c | 30 +++++++++++++-----------------
hw/block/xen_disk.c | 2 +-
hw/usb/xen-usb.c | 12 ++++++------
monitor.c | 23 +++++++++++------------
qapi/qmp-event.c | 2 +-
qemu-img.c | 6 +++---
qemu-io.c | 2 +-
qemu-nbd.c | 2 +-
qobject/qdict.c | 2 +-
target/s390x/cpu_models.c | 4 ++--
util/qemu-option.c | 2 +-
12 files changed, 60 insertions(+), 72 deletions(-)
diff --git a/block.c b/block.c
index 1803334..9b87bf6 100644
--- a/block.c
+++ b/block.c
@@ -937,16 +937,14 @@ static void update_flags_from_options(int *flags, QemuOpts *opts)
static void update_options_from_flags(QDict *options, int flags)
{
if (!qdict_haskey(options, BDRV_OPT_CACHE_DIRECT)) {
- qdict_put(options, BDRV_OPT_CACHE_DIRECT,
- qbool_from_bool(flags & BDRV_O_NOCACHE));
+ qdict_put_bool(options, BDRV_OPT_CACHE_DIRECT, flags & BDRV_O_NOCACHE);
}
if (!qdict_haskey(options, BDRV_OPT_CACHE_NO_FLUSH)) {
- qdict_put(options, BDRV_OPT_CACHE_NO_FLUSH,
- qbool_from_bool(flags & BDRV_O_NO_FLUSH));
+ qdict_put_bool(options, BDRV_OPT_CACHE_NO_FLUSH,
+ flags & BDRV_O_NO_FLUSH);
}
if (!qdict_haskey(options, BDRV_OPT_READ_ONLY)) {
- qdict_put(options, BDRV_OPT_READ_ONLY,
- qbool_from_bool(!(flags & BDRV_O_RDWR)));
+ qdict_put_bool(options, BDRV_OPT_READ_ONLY, !(flags & BDRV_O_RDWR));
}
}
@@ -1362,7 +1360,7 @@ static int bdrv_fill_options(QDict **options, const char *filename,
/* Fetch the file name from the options QDict if necessary */
if (protocol && filename) {
if (!qdict_haskey(*options, "filename")) {
- qdict_put(*options, "filename", qstring_from_str(filename));
+ qdict_put_str(*options, "filename", filename);
parse_filename = true;
} else {
error_setg(errp, "Can't specify 'file' and 'filename' options at "
@@ -1383,7 +1381,7 @@ static int bdrv_fill_options(QDict **options, const char *filename,
}
drvname = drv->format_name;
- qdict_put(*options, "driver", qstring_from_str(drvname));
+ qdict_put_str(*options, "driver", drvname);
} else {
error_setg(errp, "Must specify either driver or file");
return -EINVAL;
@@ -2034,7 +2032,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
}
if (bs->backing_format[0] != '\0' && !qdict_haskey(options, "driver")) {
- qdict_put(options, "driver", qstring_from_str(bs->backing_format));
+ qdict_put_str(options, "driver", bs->backing_format);
}
backing_hd = bdrv_open_inherit(*backing_filename ? backing_filename : NULL,
@@ -2189,12 +2187,9 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs,
}
/* Prepare options QDict for the temporary file */
- qdict_put(snapshot_options, "file.driver",
- qstring_from_str("file"));
- qdict_put(snapshot_options, "file.filename",
- qstring_from_str(tmp_filename));
- qdict_put(snapshot_options, "driver",
- qstring_from_str("qcow2"));
+ qdict_put_str(snapshot_options, "file.driver", "file");
+ qdict_put_str(snapshot_options, "file.filename", tmp_filename);
+ qdict_put_str(snapshot_options, "driver", "qcow2");
bs_snapshot = bdrv_open(NULL, NULL, snapshot_options, flags, errp);
snapshot_options = NULL;
@@ -2369,8 +2364,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
goto fail;
}
- qdict_put(options, "file",
- qstring_from_str(bdrv_get_node_name(file_bs)));
+ qdict_put_str(options, "file", bdrv_get_node_name(file_bs));
}
}
@@ -2392,8 +2386,8 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
* sure to update both bs->options (which has the full effective
* options for bs) and options (which has file.* already removed).
*/
- qdict_put(bs->options, "driver", qstring_from_str(drv->format_name));
- qdict_put(options, "driver", qstring_from_str(drv->format_name));
+ qdict_put_str(bs->options, "driver", drv->format_name);
+ qdict_put_str(options, "driver", drv->format_name);
} else if (!drv) {
error_setg(errp, "Must specify either driver or file");
goto fail;
@@ -2768,12 +2762,12 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue,
* that they are checked at the end of this function. */
value = qemu_opt_get(opts, "node-name");
if (value) {
- qdict_put(reopen_state->options, "node-name", qstring_from_str(value));
+ qdict_put_str(reopen_state->options, "node-name", value);
}
value = qemu_opt_get(opts, "driver");
if (value) {
- qdict_put(reopen_state->options, "driver", qstring_from_str(value));
+ qdict_put_str(reopen_state->options, "driver", value);
}
/* if we are to stay read-only, do not allow permission change
@@ -4260,8 +4254,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
if (backing_fmt) {
backing_options = qdict_new();
- qdict_put(backing_options, "driver",
- qstring_from_str(backing_fmt));
+ qdict_put_str(backing_options, "driver", backing_fmt);
}
bs = bdrv_open(full_backing, NULL, backing_options, back_flags,
@@ -4658,7 +4651,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
* contain a representation of the filename, therefore the following
* suffices without querying the (exact_)filename of this BDS. */
if (bs->file->bs->full_open_options) {
- qdict_put(opts, "driver", qstring_from_str(drv->format_name));
+ qdict_put_str(opts, "driver", drv->format_name);
QINCREF(bs->file->bs->full_open_options);
qdict_put(opts, "file", bs->file->bs->full_open_options);
@@ -4676,7 +4669,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
opts = qdict_new();
append_open_options(opts, bs);
- qdict_put(opts, "driver", qstring_from_str(drv->format_name));
+ qdict_put_str(opts, "driver", drv->format_name);
if (bs->exact_filename[0]) {
/* This may not work for all block protocol drivers (some may
@@ -4686,7 +4679,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
* needs some special format of the options QDict, it needs to
* implement the driver-specific bdrv_refresh_filename() function.
*/
- qdict_put(opts, "filename", qstring_from_str(bs->exact_filename));
+ qdict_put_str(opts, "filename", bs->exact_filename);
}
bs->full_open_options = opts;
diff --git a/blockdev.c b/blockdev.c
index 040c152..269a5e1 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -527,7 +527,7 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
error_setg(errp, "Cannot specify both 'driver' and 'format'");
goto early_err;
}
- qdict_put(bs_opts, "driver", qstring_from_str(buf));
+ qdict_put_str(bs_opts, "driver", buf);
}
on_write_error = BLOCKDEV_ON_ERROR_ENOSPC;
@@ -903,10 +903,8 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
copy_on_read = false;
}
- qdict_put(bs_opts, BDRV_OPT_READ_ONLY,
- qstring_from_str(read_only ? "on" : "off"));
- qdict_put(bs_opts, "copy-on-read",
- qstring_from_str(copy_on_read ? "on" :"off"));
+ qdict_put_str(bs_opts, BDRV_OPT_READ_ONLY, read_only ? "on" : "off");
+ qdict_put_str(bs_opts, "copy-on-read", copy_on_read ? "on" : "off");
/* Controller type */
value = qemu_opt_get(legacy_opts, "if");
@@ -1030,7 +1028,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
new_id = g_strdup_printf("%s%s%i", if_name[type],
mediastr, unit_id);
}
- qdict_put(bs_opts, "id", qstring_from_str(new_id));
+ qdict_put_str(bs_opts, "id", new_id);
g_free(new_id);
}
@@ -1067,7 +1065,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
error_report("werror is not supported by this bus type");
goto fail;
}
- qdict_put(bs_opts, "werror", qstring_from_str(werror));
+ qdict_put_str(bs_opts, "werror", werror);
}
rerror = qemu_opt_get(legacy_opts, "rerror");
@@ -1077,7 +1075,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
error_report("rerror is not supported by this bus type");
goto fail;
}
- qdict_put(bs_opts, "rerror", qstring_from_str(rerror));
+ qdict_put_str(bs_opts, "rerror", rerror);
}
/* Actual block device init: Functionality shared with blockdev-add */
@@ -1737,10 +1735,9 @@ static void external_snapshot_prepare(BlkActionState *common,
options = qdict_new();
if (s->has_snapshot_node_name) {
- qdict_put(options, "node-name",
- qstring_from_str(snapshot_node_name));
+ qdict_put_str(options, "node-name", snapshot_node_name);
}
- qdict_put(options, "driver", qstring_from_str(format));
+ qdict_put_str(options, "driver", format);
flags |= BDRV_O_NO_BACKING;
}
@@ -2579,11 +2576,10 @@ void qmp_blockdev_change_medium(bool has_device, const char *device,
options = qdict_new();
detect_zeroes = blk_get_detect_zeroes_from_root_state(blk);
- qdict_put(options, "detect-zeroes",
- qstring_from_str(detect_zeroes ? "on" : "off"));
+ qdict_put_str(options, "detect-zeroes", detect_zeroes ? "on" : "off");
if (has_format) {
- qdict_put(options, "driver", qstring_from_str(format));
+ qdict_put_str(options, "driver", format);
}
medium_bs = bdrv_open(filename, NULL, options, bdrv_flags, errp);
@@ -3251,7 +3247,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, BlockJobTxn *txn,
if (backup->format) {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(backup->format));
+ qdict_put_str(options, "driver", backup->format);
}
target_bs = bdrv_open(backup->target, NULL, options, flags, errp);
@@ -3555,10 +3551,10 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
options = qdict_new();
if (arg->has_node_name) {
- qdict_put(options, "node-name", qstring_from_str(arg->node_name));
+ qdict_put_str(options, "node-name", arg->node_name);
}
if (format) {
- qdict_put(options, "driver", qstring_from_str(format));
+ qdict_put_str(options, "driver", format);
}
/* Mirroring takes care of copy-on-write using the source's backing
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 456a2d5..47b2ca1 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -1082,7 +1082,7 @@ static int blk_connect(struct XenDevice *xendev)
if (strcmp(blkdev->fileproto, "<unset>")) {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(blkdev->fileproto));
+ qdict_put_str(options, "driver", blkdev->fileproto);
}
/* setup via xenbus -> create new block driver instance */
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 8e676e6..6659415 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;
diff --git a/monitor.c b/monitor.c
index be282ec..88f6fe9 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2671,7 +2671,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
}
goto fail;
}
- qdict_put(qdict, key, qstring_from_str(buf));
+ qdict_put_str(qdict, key, buf);
}
break;
case 'O':
@@ -2773,9 +2773,9 @@ static QDict *monitor_parse_arguments(Monitor *mon,
size = -1;
}
}
- qdict_put(qdict, "count", qint_from_int(count));
- qdict_put(qdict, "format", qint_from_int(format));
- qdict_put(qdict, "size", qint_from_int(size));
+ qdict_put_int(qdict, "count", count);
+ qdict_put_int(qdict, "format", format);
+ qdict_put_int(qdict, "size", size);
}
break;
case 'i':
@@ -2818,7 +2818,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
}
val <<= 20;
}
- qdict_put(qdict, key, qint_from_int(val));
+ qdict_put_int(qdict, key, val);
}
break;
case 'o':
@@ -2841,7 +2841,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
monitor_printf(mon, "invalid size\n");
goto fail;
}
- qdict_put(qdict, key, qint_from_int(val));
+ qdict_put_int(qdict, key, val);
p = end;
}
break;
@@ -2897,7 +2897,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
monitor_printf(mon, "Expected 'on' or 'off'\n");
goto fail;
}
- qdict_put(qdict, key, qbool_from_bool(val));
+ qdict_put_bool(qdict, key, val);
}
break;
case '-':
@@ -2928,7 +2928,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
} else {
/* has option */
p++;
- qdict_put(qdict, key, qbool_from_bool(true));
+ qdict_put_bool(qdict, key, true);
}
}
}
@@ -2954,7 +2954,7 @@ static QDict *monitor_parse_arguments(Monitor *mon,
cmd->name);
goto fail;
}
- qdict_put(qdict, key, qstring_from_str(p));
+ qdict_put_str(qdict, key, p);
p += len;
}
break;
@@ -3733,9 +3733,8 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens)
QapiErrorClass_lookup[ERROR_CLASS_COMMAND_NOT_FOUND])) {
/* Provide a more useful error message */
qdict_del(qdict, "desc");
- qdict_put(qdict, "desc",
- qstring_from_str("Expecting capabilities negotiation"
- " with 'qmp_capabilities'"));
+ qdict_put_str(qdict, "desc", "Expecting capabilities negotiation"
+ " with 'qmp_capabilities'");
}
}
diff --git a/qapi/qmp-event.c b/qapi/qmp-event.c
index 802ede4..ba3029c 100644
--- a/qapi/qmp-event.c
+++ b/qapi/qmp-event.c
@@ -51,7 +51,7 @@ static void timestamp_put(QDict *qdict)
QDict *qmp_event_build_dict(const char *event_name)
{
QDict *dict = qdict_new();
- qdict_put(dict, "event", qstring_from_str(event_name));
+ qdict_put_str(dict, "event", event_name);
timestamp_put(dict);
return dict;
}
diff --git a/qemu-img.c b/qemu-img.c
index b220cf7..efb9833 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -313,7 +313,7 @@ static BlockBackend *img_open_file(const char *filename,
if (fmt) {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(fmt));
+ qdict_put_str(options, "driver", fmt);
}
blk = blk_new_open(filename, NULL, options, flags, &local_err);
@@ -3158,7 +3158,7 @@ static int img_rebase(int argc, char **argv)
if (bs->backing_format[0] != '\0') {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(bs->backing_format));
+ qdict_put_str(options, "driver", bs->backing_format);
}
bdrv_get_backing_filename(bs, backing_name, sizeof(backing_name));
@@ -3175,7 +3175,7 @@ static int img_rebase(int argc, char **argv)
if (out_baseimg[0]) {
if (out_basefmt) {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(out_basefmt));
+ qdict_put_str(options, "driver", out_basefmt);
} else {
options = NULL;
}
diff --git a/qemu-io.c b/qemu-io.c
index 427cbae..ed0e2dc 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -601,7 +601,7 @@ int main(int argc, char **argv)
} else {
if (format) {
opts = qdict_new();
- qdict_put(opts, "driver", qstring_from_str(format));
+ qdict_put_str(opts, "driver", format);
}
if (openfile(argv[optind], flags, writethrough, opts)) {
exit(1);
diff --git a/qemu-nbd.c b/qemu-nbd.c
index e080fb7..e4f00e2 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -959,7 +959,7 @@ int main(int argc, char **argv)
} else {
if (fmt) {
options = qdict_new();
- qdict_put(options, "driver", qstring_from_str(fmt));
+ qdict_put_str(options, "driver", fmt);
}
blk = blk_new_open(srcpath, NULL, options, flags, &local_err);
}
diff --git a/qobject/qdict.c b/qobject/qdict.c
index 291eef1..88e2ecd 100644
--- a/qobject/qdict.c
+++ b/qobject/qdict.c
@@ -463,7 +463,7 @@ void qdict_set_default_str(QDict *dst, const char *key, const char *val)
return;
}
- qdict_put(dst, key, qstring_from_str(val));
+ qdict_put_str(dst, key, val);
}
static void qdict_flatten_qdict(QDict *qdict, QDict *target,
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index ce461cc..8d27363 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -376,12 +376,12 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
static void qdict_add_disabled_feat(const char *name, void *opaque)
{
- qdict_put(opaque, name, qbool_from_bool(false));
+ qdict_put_bool(opaque, name, false);
}
static void qdict_add_enabled_feat(const char *name, void *opaque)
{
- qdict_put(opaque, name, qbool_from_bool(true));
+ qdict_put_bool(opaque, name, true);
}
/* convert S390CPUDef into a static CpuModelInfo */
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 5ce1b5c..a36cafa 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -1060,7 +1060,7 @@ QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict)
qdict = qdict_new();
}
if (opts->id) {
- qdict_put(qdict, "id", qstring_from_str(opts->id));
+ qdict_put_str(qdict, "id", opts->id);
}
QTAILQ_FOREACH(opt, &opts->head, next) {
val = QOBJECT(qstring_from_str(opt->str));
--
2.9.3
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (8 preceding siblings ...)
2017-04-05 19:47 ` Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-06 9:00 ` Kevin Wolf
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 11/13] QemuOpts: Simplify qemu_opts_to_qdict() Eric Blake
` (4 subsequent siblings)
14 siblings, 1 reply; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru, Kevin Wolf, Max Reitz, open list:Block layer core
Noticed while checking Coccinelle results. Naming a label 'out:'
when it is only used on error paths is weird; meanwhile we know
that snapshot_options is NULL on success and that QDECREF(NULL)
is safe. So merge the two exit paths into one.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
block.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/block.c b/block.c
index 9b87bf6..a13625f 100644
--- a/block.c
+++ b/block.c
@@ -2209,13 +2209,10 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs,
goto out;
}
+out:
+ QDECREF(snapshot_options);
g_free(tmp_filename);
return bs_snapshot;
-
-out:
- QDECREF(snapshot_options);
- g_free(tmp_filename);
- return NULL;
}
/*
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 11/13] QemuOpts: Simplify qemu_opts_to_qdict()
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (9 preceding siblings ...)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 12/13] fdc-test: Avoid deprecated 'change' command Eric Blake
` (3 subsequent siblings)
14 siblings, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru
Noticed while investigating Coccinelle cleanups. There is no need
for a temporary variable when we can use the new macro to do the
same thing with less typing.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
util/qemu-option.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/util/qemu-option.c b/util/qemu-option.c
index a36cafa..5977bfc 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -1054,7 +1054,6 @@ void qemu_opts_absorb_qdict(QemuOpts *opts, QDict *qdict, Error **errp)
QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict)
{
QemuOpt *opt;
- QObject *val;
if (!qdict) {
qdict = qdict_new();
@@ -1063,8 +1062,7 @@ QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict)
qdict_put_str(qdict, "id", opts->id);
}
QTAILQ_FOREACH(opt, &opts->head, next) {
- val = QOBJECT(qstring_from_str(opt->str));
- qdict_put_obj(qdict, opt->name, val);
+ qdict_put_str(qdict, opt->name, opt->str);
}
return qdict;
}
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 12/13] fdc-test: Avoid deprecated 'change' command
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (10 preceding siblings ...)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 11/13] QemuOpts: Simplify qemu_opts_to_qdict() Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-05 20:52 ` John Snow
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 13/13] test-qga: Actually test 0xff sync bytes Eric Blake
` (2 subsequent siblings)
14 siblings, 1 reply; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru, John Snow, open list:Floppy
Use the preferred blockdev-change-medium command instead.
Admittedly, use of 'device' is also deprecated over the newer use
of 'id', but the test is exploiting that the name 'floppy0' is
auto-created by the board, and I could not figure out where the
command line lives that would need to be tweaked to provide a
non-random 'id' to this device.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
---
v3: update commit message to point out that we are still using
deprecated 'device'
---
tests/fdc-test.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/fdc-test.c b/tests/fdc-test.c
index 738c6b4..f5ff68d 100644
--- a/tests/fdc-test.c
+++ b/tests/fdc-test.c
@@ -298,8 +298,9 @@ static void test_media_insert(void)
/* Insert media in drive. DSKCHK should not be reset until a step pulse
* is sent. */
- qmp_discard_response("{'execute':'change', 'arguments':{"
- " 'device':'floppy0', 'target': %s, 'arg': 'raw' }}",
+ qmp_discard_response("{'execute':'blockdev-change-medium', 'arguments':{"
+ " 'device':'floppy0', 'filename': %s, "
+ "'format': 'raw' }}",
test_image);
dir = inb(FLOPPY_BASE + reg_dir);
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH v3 13/13] test-qga: Actually test 0xff sync bytes
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (11 preceding siblings ...)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 12/13] fdc-test: Avoid deprecated 'change' command Eric Blake
@ 2017-04-05 19:47 ` Eric Blake
2017-04-06 12:38 ` [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups no-reply
2017-04-11 17:23 ` Markus Armbruster
14 siblings, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-05 19:47 UTC (permalink / raw)
To: qemu-devel; +Cc: armbru
Commit 62c39b3 introduced test-qga, and at face value, appears
to be testing the 'guest-sync' behavior that is recommended for
guests in sending 0xff to QGA to force the parser to reset. But
this aspect of the test has never actually done anything: the
qmp_fd() call chain converts its string argument into QObject,
then converts that QObject back to the actual string that is
sent over the wire - and the conversion process silently drops
the 0xff byte from the string sent to QGA, thus never resetting
the QGA parser.
An upcoming patch will get rid of the wasteful round trip
through QObject, at which point the string in test-qga will be
directly sent over the wire.
But fixing qmp_fd() to actually send 0xff over the wire is not
all we have to do - the actual QMP parser loudly complains that
0xff is not valid JSON, and sends an error message _prior_ to
actually parsing the 'guest-sync' or 'guest-sync-delimited'
command. With 'guest-sync', we cannot easily tell if this error
message is a result of our command - which is WHY we invented
the 'guest-sync-delimited' command. So for the testsuite, fix
things to only check 0xff behavior on 'guest-sync-delimited',
and to loop until we've consumed all garbage prior to the
requested delimiter, which matches the documented actions that
a real QGA client is supposed to do.
Ideally, we'd fix the QGA JSON parser to silently ignore 0xff
rather than sending an error message back, at which point we
could enhance this test for 'guest-sync' as well as for
'guest-sync-delimited'. But for the sake of this patch, our
testing of 'guest-sync' is no worse than it was pre-patch,
because we have never been sending 0xff over the wire in the
first place.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
v3: use inline \xff byte rather than %c, add comment
---
tests/libqtest.c | 8 ++++++++
tests/test-qga.c | 34 +++++++++++++++++++++++++++-------
2 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 99b1195..4b4407a 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -446,6 +446,14 @@ void qmp_fd_sendv(int fd, const char *fmt, va_list ap)
va_list ap_copy;
QObject *qobj;
+ /* qobject_from_jsonv() silently eats leading 0xff as invalid
+ * JSON, but we want to test sending them over the wire to force
+ * resyncs */
+ if (*fmt == '\377') {
+ socket_send(fd, fmt, 1);
+ fmt++;
+ }
+
/* Going through qobject ensures we escape strings properly.
* This seemingly unnecessary copy is required in case va_list
* is an array type.
diff --git a/tests/test-qga.c b/tests/test-qga.c
index c780f00..438c2e7 100644
--- a/tests/test-qga.c
+++ b/tests/test-qga.c
@@ -146,14 +146,23 @@ static void test_qga_sync_delimited(gconstpointer fix)
QDict *ret;
gchar *cmd;
- cmd = g_strdup_printf("%c{'execute': 'guest-sync-delimited',"
- " 'arguments': {'id': %u } }", 0xff, r);
+ cmd = g_strdup_printf("\xff{'execute': 'guest-sync-delimited',"
+ " 'arguments': {'id': %u } }", r);
qmp_fd_send(fixture->fd, cmd);
g_free(cmd);
- v = read(fixture->fd, &c, 1);
- g_assert_cmpint(v, ==, 1);
- g_assert_cmpint(c, ==, 0xff);
+ /*
+ * Read and ignore garbage until resynchronized.
+ *
+ * TODO: The server shouldn't emit so much garbage (among other
+ * things, it loudly complains about the client's \xff being
+ * invalid JSON, even though it is a documented part of the
+ * handshake.
+ */
+ do {
+ v = read(fixture->fd, &c, 1);
+ g_assert_cmpint(v, ==, 1);
+ } while (c != 0xff);
ret = qmp_fd_receive(fixture->fd);
g_assert_nonnull(ret);
@@ -172,8 +181,19 @@ static void test_qga_sync(gconstpointer fix)
QDict *ret;
gchar *cmd;
- cmd = g_strdup_printf("%c{'execute': 'guest-sync',"
- " 'arguments': {'id': %u } }", 0xff, r);
+ /*
+ * TODO guest-sync is inherently limited: we cannot distinguish
+ * failure caused by reacting to garbage on the wire prior to this
+ * command, from failure of this actual command. Clients are
+ * supposed to be able to send a raw '\xff' byte to at least
+ * re-synchronize the server's parser prior to this command, but
+ * we are not in a position to test that here because (at least
+ * for now) it causes the server to issue an error message about
+ * invalid JSON. Testing of '\xff' handling is done in
+ * guest-sync-delimited instead.
+ */
+ cmd = g_strdup_printf("{'execute': 'guest-sync',"
+ " 'arguments': {'id': %u } }", r);
ret = qmp_fd(fixture->fd, cmd);
g_free(cmd);
--
2.9.3
^ permalink raw reply related [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 07/13] block: Use simpler QDict/QList scalar insertion macros
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 07/13] block: Use simpler QDict/QList scalar insertion macros Eric Blake
@ 2017-04-05 19:51 ` Richard W.M. Jones
2017-04-07 9:04 ` Stefan Hajnoczi
1 sibling, 0 replies; 42+ messages in thread
From: Richard W.M. Jones @ 2017-04-05 19:51 UTC (permalink / raw)
To: Eric Blake
Cc: qemu-devel, armbru, Kevin Wolf, Max Reitz, Stefan Hajnoczi,
Jeff Cody, Stefan Weil, Ronnie Sahlberg, Paolo Bonzini,
Peter Lieven, Fam Zheng, Alberto Garcia, Josh Durgin,
open list:blkdebug
On Wed, Apr 05, 2017 at 02:47:35PM -0500, Eric Blake wrote:
> 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 block --in-place
> then touched up manually to fix a couple of '?:' back to original spacing.
It seems a trivial change to me, ACK.
Rich.
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> block/blkdebug.c | 6 +++---
> block/blkverify.c | 6 +++---
> block/curl.c | 2 +-
> block/file-posix.c | 8 ++++----
> block/file-win32.c | 4 ++--
> block/iscsi.c | 2 +-
> block/nbd.c | 41 ++++++++++++++++++++---------------------
> block/nfs.c | 43 +++++++++++++++++--------------------------
> block/null.c | 2 +-
> block/qcow2.c | 4 ++--
> block/quorum.c | 8 ++++----
> block/rbd.c | 16 ++++++++--------
> block/ssh.c | 16 +++++++---------
> block/vvfat.c | 10 +++++-----
> 14 files changed, 78 insertions(+), 90 deletions(-)
>
> diff --git a/block/blkdebug.c b/block/blkdebug.c
> index c5d4772..f69e136 100644
> --- a/block/blkdebug.c
> +++ b/block/blkdebug.c
> @@ -301,7 +301,7 @@ static void blkdebug_parse_filename(const char *filename, QDict *options,
> if (!strstart(filename, "blkdebug:", &filename)) {
> /* There was no prefix; therefore, all options have to be already
> present in the QDict (except for the filename) */
> - qdict_put(options, "x-image", qstring_from_str(filename));
> + qdict_put_str(options, "x-image", filename);
> return;
> }
>
> @@ -320,7 +320,7 @@ static void blkdebug_parse_filename(const char *filename, QDict *options,
>
> /* TODO Allow multi-level nesting and set file.filename here */
> filename = c + 1;
> - qdict_put(options, "x-image", qstring_from_str(filename));
> + qdict_put_str(options, "x-image", filename);
> }
>
> static QemuOptsList runtime_opts = {
> @@ -695,7 +695,7 @@ static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)
> }
>
> opts = qdict_new();
> - qdict_put(opts, "driver", qstring_from_str("blkdebug"));
> + qdict_put_str(opts, "driver", "blkdebug");
>
> QINCREF(bs->file->bs->full_open_options);
> qdict_put(opts, "image", bs->file->bs->full_open_options);
> diff --git a/block/blkverify.c b/block/blkverify.c
> index 79c8914..5c7d506 100644
> --- a/block/blkverify.c
> +++ b/block/blkverify.c
> @@ -67,7 +67,7 @@ static void blkverify_parse_filename(const char *filename, QDict *options,
> if (!strstart(filename, "blkverify:", &filename)) {
> /* There was no prefix; therefore, all options have to be already
> present in the QDict (except for the filename) */
> - qdict_put(options, "x-image", qstring_from_str(filename));
> + qdict_put_str(options, "x-image", filename);
> return;
> }
>
> @@ -84,7 +84,7 @@ static void blkverify_parse_filename(const char *filename, QDict *options,
>
> /* TODO Allow multi-level nesting and set file.filename here */
> filename = c + 1;
> - qdict_put(options, "x-image", qstring_from_str(filename));
> + qdict_put_str(options, "x-image", filename);
> }
>
> static QemuOptsList runtime_opts = {
> @@ -291,7 +291,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)
> && s->test_file->bs->full_open_options)
> {
> QDict *opts = qdict_new();
> - qdict_put(opts, "driver", qstring_from_str("blkverify"));
> + qdict_put_str(opts, "driver", "blkverify");
>
> QINCREF(bs->file->bs->full_open_options);
> qdict_put(opts, "raw", bs->file->bs->full_open_options);
> diff --git a/block/curl.c b/block/curl.c
> index 2708d57..aa6e8cc 100644
> --- a/block/curl.c
> +++ b/block/curl.c
> @@ -548,7 +548,7 @@ static void curl_clean_state(CURLState *s)
> static void curl_parse_filename(const char *filename, QDict *options,
> Error **errp)
> {
> - qdict_put(options, CURL_BLOCK_OPT_URL, qstring_from_str(filename));
> + qdict_put_str(options, CURL_BLOCK_OPT_URL, filename);
> }
>
> static void curl_detach_aio_context(BlockDriverState *bs)
> diff --git a/block/file-posix.c b/block/file-posix.c
> index 5370ba0..9431ad1 100644
> --- a/block/file-posix.c
> +++ b/block/file-posix.c
> @@ -377,7 +377,7 @@ static void raw_parse_filename(const char *filename, QDict *options,
> * function call can be ignored. */
> strstart(filename, "file:", &filename);
>
> - qdict_put(options, "filename", qstring_from_str(filename));
> + qdict_put_str(options, "filename", filename);
> }
>
> static QemuOptsList raw_runtime_opts = {
> @@ -2150,7 +2150,7 @@ static void hdev_parse_filename(const char *filename, QDict *options,
> /* The prefix is optional, just as for "file". */
> strstart(filename, "host_device:", &filename);
>
> - qdict_put(options, "filename", qstring_from_str(filename));
> + qdict_put_str(options, "filename", filename);
> }
>
> static bool hdev_is_sg(BlockDriverState *bs)
> @@ -2239,7 +2239,7 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
> goto hdev_open_Mac_error;
> }
>
> - qdict_put(options, "filename", qstring_from_str(bsd_path));
> + qdict_put_str(options, "filename", bsd_path);
>
> hdev_open_Mac_error:
> g_free(mediaType);
> @@ -2449,7 +2449,7 @@ static void cdrom_parse_filename(const char *filename, QDict *options,
> /* The prefix is optional, just as for "file". */
> strstart(filename, "host_cdrom:", &filename);
>
> - qdict_put(options, "filename", qstring_from_str(filename));
> + qdict_put_str(options, "filename", filename);
> }
> #endif
>
> diff --git a/block/file-win32.c b/block/file-win32.c
> index 57c4a78..0d455d1 100644
> --- a/block/file-win32.c
> +++ b/block/file-win32.c
> @@ -282,7 +282,7 @@ static void raw_parse_filename(const char *filename, QDict *options,
> * function call can be ignored. */
> strstart(filename, "file:", &filename);
>
> - qdict_put(options, "filename", qstring_from_str(filename));
> + qdict_put_str(options, "filename", filename);
> }
>
> static QemuOptsList raw_runtime_opts = {
> @@ -669,7 +669,7 @@ static void hdev_parse_filename(const char *filename, QDict *options,
> /* The prefix is optional, just as for "file". */
> strstart(filename, "host_device:", &filename);
>
> - qdict_put(options, "filename", qstring_from_str(filename));
> + qdict_put_str(options, "filename", filename);
> }
>
> static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
> diff --git a/block/iscsi.c b/block/iscsi.c
> index 716e74a..1534ab6 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -2102,7 +2102,7 @@ static int iscsi_create(const char *filename, QemuOpts *opts, Error **errp)
> iscsilun = bs->opaque;
>
> bs_options = qdict_new();
> - qdict_put(bs_options, "filename", qstring_from_str(filename));
> + qdict_put_str(bs_options, "filename", filename);
> ret = iscsi_open(bs, bs_options, 0, NULL);
> QDECREF(bs_options);
>
> diff --git a/block/nbd.c b/block/nbd.c
> index 814ab26d..b3545f5 100644
> --- a/block/nbd.c
> +++ b/block/nbd.c
> @@ -79,7 +79,7 @@ static int nbd_parse_uri(const char *filename, QDict *options)
> p = uri->path ? uri->path : "/";
> p += strspn(p, "/");
> if (p[0]) {
> - qdict_put(options, "export", qstring_from_str(p));
> + qdict_put_str(options, "export", p);
> }
>
> qp = query_params_parse(uri->query);
> @@ -94,9 +94,8 @@ static int nbd_parse_uri(const char *filename, QDict *options)
> ret = -EINVAL;
> goto out;
> }
> - qdict_put(options, "server.type", qstring_from_str("unix"));
> - qdict_put(options, "server.path",
> - qstring_from_str(qp->p[0].value));
> + qdict_put_str(options, "server.type", "unix");
> + qdict_put_str(options, "server.path", qp->p[0].value);
> } else {
> QString *host;
> char *port_str;
> @@ -115,11 +114,11 @@ static int nbd_parse_uri(const char *filename, QDict *options)
> host = qstring_from_str(uri->server);
> }
>
> - qdict_put(options, "server.type", qstring_from_str("inet"));
> + qdict_put_str(options, "server.type", "inet");
> qdict_put(options, "server.host", host);
>
> port_str = g_strdup_printf("%d", uri->port ?: NBD_DEFAULT_PORT);
> - qdict_put(options, "server.port", qstring_from_str(port_str));
> + qdict_put_str(options, "server.port", port_str);
> g_free(port_str);
> }
>
> @@ -181,7 +180,7 @@ static void nbd_parse_filename(const char *filename, QDict *options,
> export_name[0] = 0; /* truncate 'file' */
> export_name += strlen(EN_OPTSTR);
>
> - qdict_put(options, "export", qstring_from_str(export_name));
> + qdict_put_str(options, "export", export_name);
> }
>
> /* extract the host_spec - fail if it's not nbd:... */
> @@ -196,8 +195,8 @@ static void nbd_parse_filename(const char *filename, QDict *options,
>
> /* are we a UNIX or TCP socket? */
> if (strstart(host_spec, "unix:", &unixpath)) {
> - qdict_put(options, "server.type", qstring_from_str("unix"));
> - qdict_put(options, "server.path", qstring_from_str(unixpath));
> + qdict_put_str(options, "server.type", "unix");
> + qdict_put_str(options, "server.path", unixpath);
> } else {
> InetSocketAddress *addr = NULL;
>
> @@ -206,9 +205,9 @@ static void nbd_parse_filename(const char *filename, QDict *options,
> goto out;
> }
>
> - qdict_put(options, "server.type", qstring_from_str("inet"));
> - qdict_put(options, "server.host", qstring_from_str(addr->host));
> - qdict_put(options, "server.port", qstring_from_str(addr->port));
> + qdict_put_str(options, "server.type", "inet");
> + qdict_put_str(options, "server.host", addr->host);
> + qdict_put_str(options, "server.port", addr->port);
> qapi_free_InetSocketAddress(addr);
> }
>
> @@ -247,13 +246,13 @@ static bool nbd_process_legacy_socket_options(QDict *output_options,
> return false;
> }
>
> - qdict_put(output_options, "server.type", qstring_from_str("unix"));
> - qdict_put(output_options, "server.path", qstring_from_str(path));
> + qdict_put_str(output_options, "server.type", "unix");
> + qdict_put_str(output_options, "server.path", path);
> } else if (host) {
> - qdict_put(output_options, "server.type", qstring_from_str("inet"));
> - qdict_put(output_options, "server.host", qstring_from_str(host));
> - qdict_put(output_options, "server.port",
> - qstring_from_str(port ?: stringify(NBD_DEFAULT_PORT)));
> + qdict_put_str(output_options, "server.type", "inet");
> + qdict_put_str(output_options, "server.host", host);
> + qdict_put_str(output_options, "server.port",
> + port ?: stringify(NBD_DEFAULT_PORT));
> }
>
> return true;
> @@ -528,7 +527,7 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
> path = s->saddr->u.q_unix.path;
> } /* else can't represent as pseudo-filename */
>
> - qdict_put(opts, "driver", qstring_from_str("nbd"));
> + qdict_put_str(opts, "driver", "nbd");
>
> if (path && s->export) {
> snprintf(bs->exact_filename, sizeof(bs->exact_filename),
> @@ -551,10 +550,10 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
> qdict_put_obj(opts, "server", saddr_qdict);
>
> if (s->export) {
> - qdict_put(opts, "export", qstring_from_str(s->export));
> + qdict_put_str(opts, "export", s->export);
> }
> if (s->tlscredsid) {
> - qdict_put(opts, "tls-creds", qstring_from_str(s->tlscredsid));
> + qdict_put_str(opts, "tls-creds", s->tlscredsid);
> }
>
> qdict_flatten(opts);
> diff --git a/block/nfs.c b/block/nfs.c
> index 0816678..bfeebc1 100644
> --- a/block/nfs.c
> +++ b/block/nfs.c
> @@ -104,9 +104,9 @@ static int nfs_parse_uri(const char *filename, QDict *options, Error **errp)
> goto out;
> }
>
> - qdict_put(options, "server.host", qstring_from_str(uri->server));
> - qdict_put(options, "server.type", qstring_from_str("inet"));
> - qdict_put(options, "path", qstring_from_str(uri->path));
> + qdict_put_str(options, "server.host", uri->server);
> + qdict_put_str(options, "server.type", "inet");
> + qdict_put_str(options, "path", uri->path);
>
> for (i = 0; i < qp->n; i++) {
> unsigned long long val;
> @@ -121,23 +121,17 @@ static int nfs_parse_uri(const char *filename, QDict *options, Error **errp)
> goto out;
> }
> if (!strcmp(qp->p[i].name, "uid")) {
> - qdict_put(options, "user",
> - qstring_from_str(qp->p[i].value));
> + qdict_put_str(options, "user", qp->p[i].value);
> } else if (!strcmp(qp->p[i].name, "gid")) {
> - qdict_put(options, "group",
> - qstring_from_str(qp->p[i].value));
> + qdict_put_str(options, "group", qp->p[i].value);
> } else if (!strcmp(qp->p[i].name, "tcp-syncnt")) {
> - qdict_put(options, "tcp-syn-count",
> - qstring_from_str(qp->p[i].value));
> + qdict_put_str(options, "tcp-syn-count", qp->p[i].value);
> } else if (!strcmp(qp->p[i].name, "readahead")) {
> - qdict_put(options, "readahead-size",
> - qstring_from_str(qp->p[i].value));
> + qdict_put_str(options, "readahead-size", qp->p[i].value);
> } else if (!strcmp(qp->p[i].name, "pagecache")) {
> - qdict_put(options, "page-cache-size",
> - qstring_from_str(qp->p[i].value));
> + qdict_put_str(options, "page-cache-size", qp->p[i].value);
> } else if (!strcmp(qp->p[i].name, "debug")) {
> - qdict_put(options, "debug",
> - qstring_from_str(qp->p[i].value));
> + qdict_put_str(options, "debug", qp->p[i].value);
> } else {
> error_setg(errp, "Unknown NFS parameter name: %s",
> qp->p[i].name);
> @@ -811,7 +805,7 @@ static void nfs_refresh_filename(BlockDriverState *bs, QDict *options)
> QObject *server_qdict;
> Visitor *ov;
>
> - qdict_put(opts, "driver", qstring_from_str("nfs"));
> + qdict_put_str(opts, "driver", "nfs");
>
> if (client->uid && !client->gid) {
> snprintf(bs->exact_filename, sizeof(bs->exact_filename),
> @@ -834,28 +828,25 @@ static void nfs_refresh_filename(BlockDriverState *bs, QDict *options)
> visit_type_NFSServer(ov, NULL, &client->server, &error_abort);
> visit_complete(ov, &server_qdict);
> qdict_put_obj(opts, "server", server_qdict);
> - qdict_put(opts, "path", qstring_from_str(client->path));
> + qdict_put_str(opts, "path", client->path);
>
> if (client->uid) {
> - qdict_put(opts, "user", qint_from_int(client->uid));
> + qdict_put_int(opts, "user", client->uid);
> }
> if (client->gid) {
> - qdict_put(opts, "group", qint_from_int(client->gid));
> + qdict_put_int(opts, "group", client->gid);
> }
> if (client->tcp_syncnt) {
> - qdict_put(opts, "tcp-syn-cnt",
> - qint_from_int(client->tcp_syncnt));
> + qdict_put_int(opts, "tcp-syn-cnt", client->tcp_syncnt);
> }
> if (client->readahead) {
> - qdict_put(opts, "readahead-size",
> - qint_from_int(client->readahead));
> + qdict_put_int(opts, "readahead-size", client->readahead);
> }
> if (client->pagecache) {
> - qdict_put(opts, "page-cache-size",
> - qint_from_int(client->pagecache));
> + qdict_put_int(opts, "page-cache-size", client->pagecache);
> }
> if (client->debug) {
> - qdict_put(opts, "debug", qint_from_int(client->debug));
> + qdict_put_int(opts, "debug", client->debug);
> }
>
> visit_free(ov);
> diff --git a/block/null.c b/block/null.c
> index b300390..876f909 100644
> --- a/block/null.c
> +++ b/block/null.c
> @@ -232,7 +232,7 @@ static void null_refresh_filename(BlockDriverState *bs, QDict *opts)
> bs->drv->format_name);
> }
>
> - qdict_put(opts, "driver", qstring_from_str(bs->drv->format_name));
> + qdict_put_str(opts, "driver", bs->drv->format_name);
> bs->full_open_options = opts;
> }
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 6a92d2e..49c737f 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -2265,7 +2265,7 @@ static int qcow2_create2(const char *filename, int64_t total_size,
> * table)
> */
> options = qdict_new();
> - qdict_put(options, "driver", qstring_from_str("qcow2"));
> + qdict_put_str(options, "driver", "qcow2");
> blk = blk_new_open(filename, NULL, options,
> BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_NO_FLUSH,
> &local_err);
> @@ -2327,7 +2327,7 @@ static int qcow2_create2(const char *filename, int64_t total_size,
>
> /* Reopen the image without BDRV_O_NO_FLUSH to flush it before returning */
> options = qdict_new();
> - qdict_put(options, "driver", qstring_from_str("qcow2"));
> + qdict_put_str(options, "driver", "qcow2");
> blk = blk_new_open(filename, NULL, options,
> BDRV_O_RDWR | BDRV_O_NO_BACKING, &local_err);
> if (blk == NULL) {
> diff --git a/block/quorum.c b/block/quorum.c
> index f7949e2..1b2a8c3 100644
> --- a/block/quorum.c
> +++ b/block/quorum.c
> @@ -1100,10 +1100,10 @@ static void quorum_refresh_filename(BlockDriverState *bs, QDict *options)
> }
>
> opts = qdict_new();
> - qdict_put(opts, "driver", qstring_from_str("quorum"));
> - qdict_put(opts, QUORUM_OPT_VOTE_THRESHOLD, qint_from_int(s->threshold));
> - qdict_put(opts, QUORUM_OPT_BLKVERIFY, qbool_from_bool(s->is_blkverify));
> - qdict_put(opts, QUORUM_OPT_REWRITE, qbool_from_bool(s->rewrite_corrupted));
> + qdict_put_str(opts, "driver", "quorum");
> + qdict_put_int(opts, QUORUM_OPT_VOTE_THRESHOLD, s->threshold);
> + qdict_put_bool(opts, QUORUM_OPT_BLKVERIFY, s->is_blkverify);
> + qdict_put_bool(opts, QUORUM_OPT_REWRITE, s->rewrite_corrupted);
> qdict_put(opts, "children", children);
>
> bs->full_open_options = opts;
> diff --git a/block/rbd.c b/block/rbd.c
> index 1ceeeb5..2354ffc 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
> @@ -154,20 +154,20 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
> goto done;
> }
> qemu_rbd_unescape(found_str);
> - qdict_put(options, "pool", qstring_from_str(found_str));
> + qdict_put_str(options, "pool", found_str);
>
> if (strchr(p, '@')) {
> found_str = qemu_rbd_next_tok(p, '@', &p);
> qemu_rbd_unescape(found_str);
> - qdict_put(options, "image", qstring_from_str(found_str));
> + qdict_put_str(options, "image", found_str);
>
> found_str = qemu_rbd_next_tok(p, ':', &p);
> qemu_rbd_unescape(found_str);
> - qdict_put(options, "snapshot", qstring_from_str(found_str));
> + qdict_put_str(options, "snapshot", found_str);
> } else {
> found_str = qemu_rbd_next_tok(p, ':', &p);
> qemu_rbd_unescape(found_str);
> - qdict_put(options, "image", qstring_from_str(found_str));
> + qdict_put_str(options, "image", found_str);
> }
> if (!p) {
> goto done;
> @@ -189,9 +189,9 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
> qemu_rbd_unescape(value);
>
> if (!strcmp(name, "conf")) {
> - qdict_put(options, "conf", qstring_from_str(value));
> + qdict_put_str(options, "conf", value);
> } else if (!strcmp(name, "id")) {
> - qdict_put(options, "user" , qstring_from_str(value));
> + qdict_put_str(options, "user", value);
> } else {
> /*
> * We pass these internally to qemu_rbd_set_keypairs(), so
> @@ -204,8 +204,8 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
> if (!keypairs) {
> keypairs = qlist_new();
> }
> - qlist_append(keypairs, qstring_from_str(name));
> - qlist_append(keypairs, qstring_from_str(value));
> + qlist_append_str(keypairs, name);
> + qlist_append_str(keypairs, value);
> }
> }
>
> diff --git a/block/ssh.c b/block/ssh.c
> index 471ba8a..34a2f79 100644
> --- a/block/ssh.c
> +++ b/block/ssh.c
> @@ -227,24 +227,23 @@ static int parse_uri(const char *filename, QDict *options, Error **errp)
> }
>
> if(uri->user && strcmp(uri->user, "") != 0) {
> - qdict_put(options, "user", qstring_from_str(uri->user));
> + qdict_put_str(options, "user", uri->user);
> }
>
> - qdict_put(options, "server.host", qstring_from_str(uri->server));
> + qdict_put_str(options, "server.host", uri->server);
>
> port_str = g_strdup_printf("%d", uri->port ?: 22);
> - qdict_put(options, "server.port", qstring_from_str(port_str));
> + qdict_put_str(options, "server.port", port_str);
> g_free(port_str);
>
> - qdict_put(options, "path", qstring_from_str(uri->path));
> + qdict_put_str(options, "path", uri->path);
>
> /* Pick out any query parameters that we understand, and ignore
> * the rest.
> */
> for (i = 0; i < qp->n; ++i) {
> if (strcmp(qp->p[i].name, "host_key_check") == 0) {
> - qdict_put(options, "host_key_check",
> - qstring_from_str(qp->p[i].value));
> + qdict_put_str(options, "host_key_check", qp->p[i].value);
> }
> }
>
> @@ -574,9 +573,8 @@ static bool ssh_process_legacy_socket_options(QDict *output_opts,
> }
>
> if (host) {
> - qdict_put(output_opts, "server.host", qstring_from_str(host));
> - qdict_put(output_opts, "server.port",
> - qstring_from_str(port ?: stringify(22)));
> + qdict_put_str(output_opts, "server.host", host);
> + qdict_put_str(output_opts, "server.port", port ?: stringify(22));
> }
>
> return true;
> diff --git a/block/vvfat.c b/block/vvfat.c
> index af5153d..8b4e4eb 100644
> --- a/block/vvfat.c
> +++ b/block/vvfat.c
> @@ -1057,10 +1057,10 @@ static void vvfat_parse_filename(const char *filename, QDict *options,
> }
>
> /* Fill in the options QDict */
> - qdict_put(options, "dir", qstring_from_str(filename));
> - qdict_put(options, "fat-type", qint_from_int(fat_type));
> - qdict_put(options, "floppy", qbool_from_bool(floppy));
> - qdict_put(options, "rw", qbool_from_bool(rw));
> + qdict_put_str(options, "dir", filename);
> + qdict_put_int(options, "fat-type", fat_type);
> + qdict_put_bool(options, "floppy", floppy);
> + qdict_put_bool(options, "rw", rw);
> }
>
> static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
> @@ -3040,7 +3040,7 @@ static int enable_write_target(BlockDriverState *bs, Error **errp)
> }
>
> options = qdict_new();
> - qdict_put(options, "write-target.driver", qstring_from_str("qcow"));
> + qdict_put_str(options, "write-target.driver", "qcow");
> s->qcow = bdrv_open_child(s->qcow_filename, options, "write-target", bs,
> &child_vvfat_qcow, false, errp);
> QDECREF(options);
> --
> 2.9.3
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection Eric Blake
@ 2017-04-05 19:57 ` Philippe Mathieu-Daudé
2017-04-05 22:04 ` Michael S. Tsirkin
2017-04-06 5:42 ` Marcel Apfelbaum
2 siblings, 0 replies; 42+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-04-05 19:57 UTC (permalink / raw)
To: Eric Blake, qemu-devel; +Cc: Marcel Apfelbaum, armbru, Michael S. Tsirkin
On 04/05/2017 04:47 PM, Eric Blake wrote:
> No one outside of pcie_aer.h was using error injection; mark them
> static for internal use.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> ---
> v3: new patch, suggested by Markus
> ---
> include/hw/pci/pcie_aer.h | 4 ----
> hw/pci/pcie_aer.c | 4 ++--
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/include/hw/pci/pcie_aer.h b/include/hw/pci/pcie_aer.h
> index 526802b..729a943 100644
> --- a/include/hw/pci/pcie_aer.h
> +++ b/include/hw/pci/pcie_aer.h
> @@ -100,8 +100,4 @@ void pcie_aer_root_write_config(PCIDevice *dev,
> uint32_t addr, uint32_t val, int len,
> uint32_t root_cmd_prev);
>
> -/* error injection */
> -int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err);
> -void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg);
> -
> #endif /* QEMU_PCIE_AER_H */
> diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
> index 653af86..828052b 100644
> --- a/hw/pci/pcie_aer.c
> +++ b/hw/pci/pcie_aer.c
> @@ -376,7 +376,7 @@ static void pcie_aer_msg_root_port(PCIDevice *dev, const PCIEAERMsg *msg)
> *
> * Walk up the bus tree from the device, propagate the error message.
> */
> -void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg)
> +static void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg)
> {
> uint8_t type;
>
> @@ -631,7 +631,7 @@ static bool pcie_aer_inject_uncor_error(PCIEAERInject *inj, bool is_fatal)
> * Figure 6-2: Flowchart Showing Sequence of Device Error Signaling and Logging
> * Operations
> */
> -int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err)
> +static int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err)
> {
> uint8_t *aer_cap = NULL;
> uint16_t devctl = 0;
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts Eric Blake
@ 2017-04-05 19:57 ` Philippe Mathieu-Daudé
2017-04-06 7:36 ` Cornelia Huck
2017-04-06 13:53 ` Cornelia Huck
2 siblings, 0 replies; 42+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-04-05 19:57 UTC (permalink / raw)
To: Eric Blake, qemu-devel; +Cc: Alexander Graf, armbru, Richard Henderson
On 04/05/2017 04:47 PM, Eric Blake wrote:
> An upcoming Coccinelle cleanup script wanted to reformat the casts
> present in this file - but on closer look, we don't need the casts
> at all because C automatically converts void* to any other pointer.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> target/s390x/cpu_models.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index 1434d15..ce461cc 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -376,12 +376,12 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
>
> static void qdict_add_disabled_feat(const char *name, void *opaque)
> {
> - qdict_put((QDict *) opaque, name, qbool_from_bool(false));
> + qdict_put(opaque, name, qbool_from_bool(false));
> }
>
> static void qdict_add_enabled_feat(const char *name, void *opaque)
> {
> - qdict_put((QDict *) opaque, name, qbool_from_bool(true));
> + qdict_put(opaque, name, qbool_from_bool(true));
> }
>
> /* convert S390CPUDef into a static CpuModelInfo */
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 12/13] fdc-test: Avoid deprecated 'change' command
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 12/13] fdc-test: Avoid deprecated 'change' command Eric Blake
@ 2017-04-05 20:52 ` John Snow
2017-04-06 8:56 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
0 siblings, 1 reply; 42+ messages in thread
From: John Snow @ 2017-04-05 20:52 UTC (permalink / raw)
To: Eric Blake, qemu-devel; +Cc: armbru, open list:Floppy
On 04/05/2017 03:47 PM, Eric Blake wrote:
> Use the preferred blockdev-change-medium command instead.
>
> Admittedly, use of 'device' is also deprecated over the newer use
> of 'id', but the test is exploiting that the name 'floppy0' is
> auto-created by the board, and I could not figure out where the
> command line lives that would need to be tweaked to provide a
> non-random 'id' to this device.
>
qtest_start
qtest_init
qtest_init_without_qmp_handshake
You can give *extra* args to qtest_start, but depending on the board
-nodefaults isn't going to get rid of that embedded FDC nor its default
floppy0 drive, I think.
You could perhaps add a second floppy drive explicitly with
-device floppy,id=snafu,bus=floppy-bus.0,unit=1
and then interact with this non-default drive, or you could use Q35 and
-nodefaults to fully clear the isa-fdc, then re-add with
-device isa-fdc,id=foobar
-device floppy,bus=foobar.0,unit=1
Or you could do nothing, and I won't tell anyone.
--js
> Signed-off-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: John Snow <jsnow@redhat.com>
>
> ---
> v3: update commit message to point out that we are still using
> deprecated 'device'
> ---
> tests/fdc-test.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tests/fdc-test.c b/tests/fdc-test.c
> index 738c6b4..f5ff68d 100644
> --- a/tests/fdc-test.c
> +++ b/tests/fdc-test.c
> @@ -298,8 +298,9 @@ static void test_media_insert(void)
>
> /* Insert media in drive. DSKCHK should not be reset until a step pulse
> * is sent. */
> - qmp_discard_response("{'execute':'change', 'arguments':{"
> - " 'device':'floppy0', 'target': %s, 'arg': 'raw' }}",
> + qmp_discard_response("{'execute':'blockdev-change-medium', 'arguments':{"
> + " 'device':'floppy0', 'filename': %s, "
> + "'format': 'raw' }}",
> test_image);
>
> dir = inb(FLOPPY_BASE + reg_dir);
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 01/13] pci: Use struct instead of QDict to pass back parameters
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 01/13] pci: Use struct instead of QDict to pass back parameters Eric Blake
@ 2017-04-05 22:04 ` Michael S. Tsirkin
2017-04-06 5:41 ` Marcel Apfelbaum
1 sibling, 0 replies; 42+ messages in thread
From: Michael S. Tsirkin @ 2017-04-05 22:04 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel, armbru, Marcel Apfelbaum
On Wed, Apr 05, 2017 at 02:47:29PM -0500, Eric Blake wrote:
> It's simpler to just use a C struct than it is to bundle things
> into a QDict in one function just to pull them back out in the
> caller. Plus, doing this gets rid of one more user of dynamic
> JSON through qobject_from_jsonf(), as well as a memory leak of
> the QDict.
>
> While cleaning the code, fix things to report all errors (the
> code was previously silently ignoring a failure of
> pcie_aer_inject_error(), at a distance).
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> v3: more cleanups suggested by Markus, drop R-b
> ---
> hw/pci/pcie_aer.c | 44 ++++++++++++++++++++++++++------------------
> 1 file changed, 26 insertions(+), 18 deletions(-)
>
> diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
> index a8c1820..653af86 100644
> --- a/hw/pci/pcie_aer.c
> +++ b/hw/pci/pcie_aer.c
> @@ -44,6 +44,13 @@
> #define PCI_ERR_SRC_COR_OFFS 0
> #define PCI_ERR_SRC_UNCOR_OFFS 2
>
> +typedef struct PCIEErrorDetails {
> + const char *id;
> + const char *root_bus;
> + int bus;
> + int devfn;
> +} PCIEErrorDetails;
> +
> /* From 6.2.7 Error Listing and Rules. Table 6-2, 6-3 and 6-4 */
> static uint32_t pcie_aer_uncor_default_severity(uint32_t status)
> {
> @@ -942,8 +949,14 @@ static int pcie_aer_parse_error_string(const char *error_name,
> return -EINVAL;
> }
>
> +/*
> + * Inject an error described by @qdict.
> + * On success, set @details to show where error was sent.
> + * Return negative errno if injection failed and a message was emitted.
> + */
> static int do_pcie_aer_inject_error(Monitor *mon,
> - const QDict *qdict, QObject **ret_data)
> + const QDict *qdict,
> + PCIEErrorDetails *details)
> {
> const char *id = qdict_get_str(qdict, "id");
> const char *error_name;
> @@ -1005,33 +1018,28 @@ static int do_pcie_aer_inject_error(Monitor *mon,
> err.prefix[3] = qdict_get_try_int(qdict, "prefix3", 0);
>
> ret = pcie_aer_inject_error(dev, &err);
> - *ret_data = qobject_from_jsonf("{'id': %s, "
> - "'root_bus': %s, 'bus': %d, 'devfn': %d, "
> - "'ret': %d}",
> - id, pci_root_bus_path(dev),
> - pci_bus_num(dev->bus), dev->devfn,
> - ret);
> - assert(*ret_data);
> + if (ret < 0) {
> + monitor_printf(mon, "failed to inject error: %s\n",
> + strerror(-ret));
> + return ret;
> + }
> + details->id = id;
> + details->root_bus = pci_root_bus_path(dev);
> + details->bus = pci_bus_num(dev->bus);
> + details->devfn = dev->devfn;
>
> return 0;
> }
>
> void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict)
> {
> - QObject *data;
> - int devfn;
> + PCIEErrorDetails data;
>
> if (do_pcie_aer_inject_error(mon, qdict, &data) < 0) {
> return;
> }
>
> - qdict = qobject_to_qdict(data);
> - assert(qdict);
> -
> - devfn = (int)qdict_get_int(qdict, "devfn");
> monitor_printf(mon, "OK id: %s root bus: %s, bus: %x devfn: %x.%x\n",
> - qdict_get_str(qdict, "id"),
> - qdict_get_str(qdict, "root_bus"),
> - (int) qdict_get_int(qdict, "bus"),
> - PCI_SLOT(devfn), PCI_FUNC(devfn));
> + data.id, data.root_bus, data.bus,
> + PCI_SLOT(data.devfn), PCI_FUNC(data.devfn));
> }
> --
> 2.9.3
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection Eric Blake
2017-04-05 19:57 ` Philippe Mathieu-Daudé
@ 2017-04-05 22:04 ` Michael S. Tsirkin
2017-04-06 5:42 ` Marcel Apfelbaum
2 siblings, 0 replies; 42+ messages in thread
From: Michael S. Tsirkin @ 2017-04-05 22:04 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel, armbru, Marcel Apfelbaum
On Wed, Apr 05, 2017 at 02:47:30PM -0500, Eric Blake wrote:
> No one outside of pcie_aer.h was using error injection; mark them
> static for internal use.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> v3: new patch, suggested by Markus
> ---
> include/hw/pci/pcie_aer.h | 4 ----
> hw/pci/pcie_aer.c | 4 ++--
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/include/hw/pci/pcie_aer.h b/include/hw/pci/pcie_aer.h
> index 526802b..729a943 100644
> --- a/include/hw/pci/pcie_aer.h
> +++ b/include/hw/pci/pcie_aer.h
> @@ -100,8 +100,4 @@ void pcie_aer_root_write_config(PCIDevice *dev,
> uint32_t addr, uint32_t val, int len,
> uint32_t root_cmd_prev);
>
> -/* error injection */
> -int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err);
> -void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg);
> -
> #endif /* QEMU_PCIE_AER_H */
> diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
> index 653af86..828052b 100644
> --- a/hw/pci/pcie_aer.c
> +++ b/hw/pci/pcie_aer.c
> @@ -376,7 +376,7 @@ static void pcie_aer_msg_root_port(PCIDevice *dev, const PCIEAERMsg *msg)
> *
> * Walk up the bus tree from the device, propagate the error message.
> */
> -void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg)
> +static void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg)
> {
> uint8_t type;
>
> @@ -631,7 +631,7 @@ static bool pcie_aer_inject_uncor_error(PCIEAERInject *inj, bool is_fatal)
> * Figure 6-2: Flowchart Showing Sequence of Device Error Signaling and Logging
> * Operations
> */
> -int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err)
> +static int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err)
> {
> uint8_t *aer_cap = NULL;
> uint16_t devctl = 0;
> --
> 2.9.3
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 01/13] pci: Use struct instead of QDict to pass back parameters
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 01/13] pci: Use struct instead of QDict to pass back parameters Eric Blake
2017-04-05 22:04 ` Michael S. Tsirkin
@ 2017-04-06 5:41 ` Marcel Apfelbaum
1 sibling, 0 replies; 42+ messages in thread
From: Marcel Apfelbaum @ 2017-04-06 5:41 UTC (permalink / raw)
To: Eric Blake, qemu-devel; +Cc: armbru, Michael S. Tsirkin
On 04/05/2017 10:47 PM, Eric Blake wrote:
> It's simpler to just use a C struct than it is to bundle things
> into a QDict in one function just to pull them back out in the
> caller. Plus, doing this gets rid of one more user of dynamic
> JSON through qobject_from_jsonf(), as well as a memory leak of
> the QDict.
>
> While cleaning the code, fix things to report all errors (the
> code was previously silently ignoring a failure of
> pcie_aer_inject_error(), at a distance).
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
>
> ---
> v3: more cleanups suggested by Markus, drop R-b
> ---
> hw/pci/pcie_aer.c | 44 ++++++++++++++++++++++++++------------------
> 1 file changed, 26 insertions(+), 18 deletions(-)
>
> diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
> index a8c1820..653af86 100644
> --- a/hw/pci/pcie_aer.c
> +++ b/hw/pci/pcie_aer.c
> @@ -44,6 +44,13 @@
> #define PCI_ERR_SRC_COR_OFFS 0
> #define PCI_ERR_SRC_UNCOR_OFFS 2
>
> +typedef struct PCIEErrorDetails {
> + const char *id;
> + const char *root_bus;
> + int bus;
> + int devfn;
> +} PCIEErrorDetails;
> +
> /* From 6.2.7 Error Listing and Rules. Table 6-2, 6-3 and 6-4 */
> static uint32_t pcie_aer_uncor_default_severity(uint32_t status)
> {
> @@ -942,8 +949,14 @@ static int pcie_aer_parse_error_string(const char *error_name,
> return -EINVAL;
> }
>
> +/*
> + * Inject an error described by @qdict.
> + * On success, set @details to show where error was sent.
> + * Return negative errno if injection failed and a message was emitted.
> + */
> static int do_pcie_aer_inject_error(Monitor *mon,
> - const QDict *qdict, QObject **ret_data)
> + const QDict *qdict,
> + PCIEErrorDetails *details)
> {
> const char *id = qdict_get_str(qdict, "id");
> const char *error_name;
> @@ -1005,33 +1018,28 @@ static int do_pcie_aer_inject_error(Monitor *mon,
> err.prefix[3] = qdict_get_try_int(qdict, "prefix3", 0);
>
> ret = pcie_aer_inject_error(dev, &err);
> - *ret_data = qobject_from_jsonf("{'id': %s, "
> - "'root_bus': %s, 'bus': %d, 'devfn': %d, "
> - "'ret': %d}",
> - id, pci_root_bus_path(dev),
> - pci_bus_num(dev->bus), dev->devfn,
> - ret);
> - assert(*ret_data);
> + if (ret < 0) {
> + monitor_printf(mon, "failed to inject error: %s\n",
> + strerror(-ret));
> + return ret;
> + }
> + details->id = id;
> + details->root_bus = pci_root_bus_path(dev);
> + details->bus = pci_bus_num(dev->bus);
> + details->devfn = dev->devfn;
>
> return 0;
> }
>
> void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict)
> {
> - QObject *data;
> - int devfn;
> + PCIEErrorDetails data;
>
> if (do_pcie_aer_inject_error(mon, qdict, &data) < 0) {
> return;
> }
>
> - qdict = qobject_to_qdict(data);
> - assert(qdict);
> -
> - devfn = (int)qdict_get_int(qdict, "devfn");
> monitor_printf(mon, "OK id: %s root bus: %s, bus: %x devfn: %x.%x\n",
> - qdict_get_str(qdict, "id"),
> - qdict_get_str(qdict, "root_bus"),
> - (int) qdict_get_int(qdict, "bus"),
> - PCI_SLOT(devfn), PCI_FUNC(devfn));
> + data.id, data.root_bus, data.bus,
> + PCI_SLOT(data.devfn), PCI_FUNC(data.devfn));
> }
>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Thanks,
Marcel
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection Eric Blake
2017-04-05 19:57 ` Philippe Mathieu-Daudé
2017-04-05 22:04 ` Michael S. Tsirkin
@ 2017-04-06 5:42 ` Marcel Apfelbaum
2 siblings, 0 replies; 42+ messages in thread
From: Marcel Apfelbaum @ 2017-04-06 5:42 UTC (permalink / raw)
To: Eric Blake, qemu-devel; +Cc: armbru, Michael S. Tsirkin
On 04/05/2017 10:47 PM, Eric Blake wrote:
> No one outside of pcie_aer.h was using error injection; mark them
> static for internal use.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
>
> ---
> v3: new patch, suggested by Markus
> ---
> include/hw/pci/pcie_aer.h | 4 ----
> hw/pci/pcie_aer.c | 4 ++--
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/include/hw/pci/pcie_aer.h b/include/hw/pci/pcie_aer.h
> index 526802b..729a943 100644
> --- a/include/hw/pci/pcie_aer.h
> +++ b/include/hw/pci/pcie_aer.h
> @@ -100,8 +100,4 @@ void pcie_aer_root_write_config(PCIDevice *dev,
> uint32_t addr, uint32_t val, int len,
> uint32_t root_cmd_prev);
>
> -/* error injection */
> -int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err);
> -void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg);
> -
> #endif /* QEMU_PCIE_AER_H */
> diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
> index 653af86..828052b 100644
> --- a/hw/pci/pcie_aer.c
> +++ b/hw/pci/pcie_aer.c
> @@ -376,7 +376,7 @@ static void pcie_aer_msg_root_port(PCIDevice *dev, const PCIEAERMsg *msg)
> *
> * Walk up the bus tree from the device, propagate the error message.
> */
> -void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg)
> +static void pcie_aer_msg(PCIDevice *dev, const PCIEAERMsg *msg)
> {
> uint8_t type;
>
> @@ -631,7 +631,7 @@ static bool pcie_aer_inject_uncor_error(PCIEAERInject *inj, bool is_fatal)
> * Figure 6-2: Flowchart Showing Sequence of Device Error Signaling and Logging
> * Operations
> */
> -int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err)
> +static int pcie_aer_inject_error(PCIDevice *dev, const PCIEAERErr *err)
> {
> uint8_t *aer_cap = NULL;
> uint16_t devctl = 0;
>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Thanks,
Marcel
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts Eric Blake
2017-04-05 19:57 ` Philippe Mathieu-Daudé
@ 2017-04-06 7:36 ` Cornelia Huck
2017-04-06 13:31 ` Eric Blake
2017-04-06 13:53 ` Cornelia Huck
2 siblings, 1 reply; 42+ messages in thread
From: Cornelia Huck @ 2017-04-06 7:36 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel, Alexander Graf, armbru, Richard Henderson
On Wed, 5 Apr 2017 14:47:31 -0500
Eric Blake <eblake@redhat.com> wrote:
> An upcoming Coccinelle cleanup script wanted to reformat the casts
> present in this file - but on closer look, we don't need the casts
> at all because C automatically converts void* to any other pointer.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> target/s390x/cpu_models.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index 1434d15..ce461cc 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -376,12 +376,12 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
>
> static void qdict_add_disabled_feat(const char *name, void *opaque)
> {
> - qdict_put((QDict *) opaque, name, qbool_from_bool(false));
> + qdict_put(opaque, name, qbool_from_bool(false));
> }
>
> static void qdict_add_enabled_feat(const char *name, void *opaque)
> {
> - qdict_put((QDict *) opaque, name, qbool_from_bool(true));
> + qdict_put(opaque, name, qbool_from_bool(true));
> }
>
> /* convert S390CPUDef into a static CpuModelInfo */
Do you prefer to keep this in this series, or should we just go ahead
and apply this via s390x?
In any case,
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [Qemu-block] [PATCH v3 12/13] fdc-test: Avoid deprecated 'change' command
2017-04-05 20:52 ` John Snow
@ 2017-04-06 8:56 ` Kevin Wolf
0 siblings, 0 replies; 42+ messages in thread
From: Kevin Wolf @ 2017-04-06 8:56 UTC (permalink / raw)
To: John Snow; +Cc: Eric Blake, qemu-devel, armbru, open list:Floppy
Am 05.04.2017 um 22:52 hat John Snow geschrieben:
> On 04/05/2017 03:47 PM, Eric Blake wrote:
> > Use the preferred blockdev-change-medium command instead.
> >
> > Admittedly, use of 'device' is also deprecated over the newer use
> > of 'id', but the test is exploiting that the name 'floppy0' is
> > auto-created by the board, and I could not figure out where the
> > command line lives that would need to be tweaked to provide a
> > non-random 'id' to this device.
> >
>
> qtest_start
> qtest_init
> qtest_init_without_qmp_handshake
>
> You can give *extra* args to qtest_start, but depending on the board
> -nodefaults isn't going to get rid of that embedded FDC nor its default
> floppy0 drive, I think.
It does get rid of the default drive.
> You could perhaps add a second floppy drive explicitly with
> -device floppy,id=snafu,bus=floppy-bus.0,unit=1
As soon as you use -device floppy, the default drive goes away, too, so
you don't have to use a secondary floppy drive. It's like the default
CD-ROM that goes away if you use -device ide-cd.
So if you want to give it an ID, the solution is as simple as:
-device floppy,id=foo
Kevin
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic Eric Blake
@ 2017-04-06 9:00 ` Kevin Wolf
2017-04-06 12:52 ` Eric Blake
0 siblings, 1 reply; 42+ messages in thread
From: Kevin Wolf @ 2017-04-06 9:00 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel, armbru, Max Reitz, open list:Block layer core
Am 05.04.2017 um 21:47 hat Eric Blake geschrieben:
> Noticed while checking Coccinelle results. Naming a label 'out:'
> when it is only used on error paths is weird; meanwhile we know
> that snapshot_options is NULL on success and that QDECREF(NULL)
> is safe. So merge the two exit paths into one.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> block.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/block.c b/block.c
> index 9b87bf6..a13625f 100644
> --- a/block.c
> +++ b/block.c
> @@ -2209,13 +2209,10 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs,
> goto out;
> }
>
> +out:
> + QDECREF(snapshot_options);
> g_free(tmp_filename);
> return bs_snapshot;
bs_snapshot is uninitialised or at least the wrong return value in error
cases. (Hm... Shouldn't the compiler catch the uninitialised part?)
> -
> -out:
> - QDECREF(snapshot_options);
> - g_free(tmp_filename);
> - return NULL;
> }
Kevin
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (12 preceding siblings ...)
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 13/13] test-qga: Actually test 0xff sync bytes Eric Blake
@ 2017-04-06 12:38 ` no-reply
2017-04-11 17:23 ` Markus Armbruster
14 siblings, 0 replies; 42+ messages in thread
From: no-reply @ 2017-04-06 12:38 UTC (permalink / raw)
To: eblake; +Cc: famz, qemu-devel, armbru
Hi,
This series failed build test on s390x host. Please find the details below.
Message-id: 20170405194741.18956-1-eblake@redhat.com
Type: series
Subject: [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups
=== TEST SCRIPT BEGIN ===
#!/bin/bash
# Testing script will be invoked under the git checkout with
# HEAD pointing to a commit that has the patches applied on top of "base"
# branch
set -e
echo "=== ENV ==="
env
echo "=== PACKAGES ==="
rpm -qa
echo "=== TEST BEGIN ==="
CC=$HOME/bin/cc
INSTALL=$PWD/install
BUILD=$PWD/build
echo -n "Using CC: "
realpath $CC
mkdir -p $BUILD $INSTALL
SRC=$PWD
cd $BUILD
$SRC/configure --cc=$CC --prefix=$INSTALL
make -j4
# XXX: we need reliable clean up
# make check -j4 V=1
make install
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/1491445133-6534-1-git-send-email-he.chen@linux.intel.com -> patchew/1491445133-6534-1-git-send-email-he.chen@linux.intel.com
* [new tag] patchew/1491462524-1617-1-git-send-email-peterx@redhat.com -> patchew/1491462524-1617-1-git-send-email-peterx@redhat.com
- [tag update] patchew/20170403114044.15762-1-lvivier@redhat.com -> patchew/20170403114044.15762-1-lvivier@redhat.com
- [tag update] patchew/20170404202429.14643-1-ehabkost@redhat.com -> patchew/20170404202429.14643-1-ehabkost@redhat.com
- [tag update] patchew/20170405194741.18956-1-eblake@redhat.com -> patchew/20170405194741.18956-1-eblake@redhat.com
* [new tag] patchew/20170406102249.20383-1-nikunj@linux.vnet.ibm.com -> patchew/20170406102249.20383-1-nikunj@linux.vnet.ibm.com
* [new tag] patchew/20170406111646.12624-1-cornelia.huck@de.ibm.com -> patchew/20170406111646.12624-1-cornelia.huck@de.ibm.com
* [new tag] patchew/20170406120513.638-1-marcandre.lureau@redhat.com -> patchew/20170406120513.638-1-marcandre.lureau@redhat.com
Switched to a new branch 'test'
6a6a3cd test-qga: Actually test 0xff sync bytes
44e7f7d fdc-test: Avoid deprecated 'change' command
1522022 QemuOpts: Simplify qemu_opts_to_qdict()
6a5011a block: Simplify bdrv_append_temp_snapshot() logic
bdae5de qobject: Use simpler QDict/QList scalar insertion macros
32ab86d tests: Use simpler QDict/QList scalar insertion macros
913027b block: Use simpler QDict/QList scalar insertion macros
af8b37d qobject: Add helper macros for common scalar insertions
b8ff8c4 qobject: Drop useless QObject casts
1224e4c coccinelle: Add script to remove useless QObject casts
bb84496 s390x: Drop useless casts
8eae9c6 pci: Reduce scope of error injection
d60c30e pci: Use struct instead of QDict to pass back parameters
=== OUTPUT BEGIN ===
=== ENV ===
XDG_SESSION_ID=94369
SHELL=/bin/sh
USER=fam
PATCHEW=/home/fam/patchew/patchew-cli -s http://patchew.org --nodebug
PATH=/usr/bin:/bin
PWD=/var/tmp/patchew-tester-tmp-x3pbd_36/src
LANG=en_US.UTF-8
HOME=/home/fam
SHLVL=2
LOGNAME=fam
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1012/bus
XDG_RUNTIME_DIR=/run/user/1012
_=/usr/bin/env
=== PACKAGES ===
gpg-pubkey-873529b8-54e386ff
xz-libs-5.2.2-2.fc24.s390x
libacl-2.2.52-11.fc24.s390x
libxshmfence-1.2-3.fc24.s390x
cdparanoia-libs-10.2-21.fc24.s390x
ustr-1.0.4-21.fc24.s390x
giflib-4.1.6-15.fc24.s390x
libusb-0.1.5-7.fc24.s390x
trousers-lib-0.3.13-6.fc24.s390x
readline-devel-6.3-8.fc24.s390x
python-srpm-macros-3-10.fc25.noarch
ncurses-base-6.0-6.20160709.fc25.noarch
gmp-6.1.1-1.fc25.s390x
chkconfig-1.8-1.fc25.s390x
libidn-1.33-1.fc25.s390x
file-5.28-4.fc25.s390x
slang-2.3.0-7.fc25.s390x
avahi-libs-0.6.32-4.fc25.s390x
libsemanage-2.5-8.fc25.s390x
perl-Unicode-Normalize-1.25-365.fc25.s390x
perl-libnet-3.10-1.fc25.noarch
perl-Thread-Queue-3.11-1.fc25.noarch
perl-podlators-4.09-1.fc25.noarch
jasper-libs-1.900.13-1.fc25.s390x
graphite2-1.3.6-1.fc25.s390x
libblkid-2.28.2-1.fc25.s390x
pkgconfig-0.29.1-1.fc25.s390x
dbus-python-1.2.4-2.fc25.s390x
alsa-lib-1.1.1-2.fc25.s390x
libgnome-keyring-3.12.0-7.fc25.s390x
yum-metadata-parser-1.1.4-17.fc25.s390x
python3-3.5.2-4.fc25.s390x
python3-slip-dbus-0.6.4-4.fc25.noarch
python2-cssselect-0.9.2-1.fc25.noarch
python-backports-1.0-8.fc25.s390x
python-magic-5.28-4.fc25.noarch
python-pycparser-2.14-7.fc25.noarch
python-fedora-0.8.0-2.fc25.noarch
createrepo_c-libs-0.10.0-6.fc25.s390x
initscripts-9.69-1.fc25.s390x
plymouth-scripts-0.9.3-0.6.20160620git0e65b86c.fc25.s390x
cronie-1.5.1-2.fc25.s390x
python2-librepo-1.7.18-3.fc25.s390x
wget-1.18-2.fc25.s390x
python3-dnf-plugins-core-0.1.21-4.fc25.noarch
at-spi2-core-2.22.0-1.fc25.s390x
libXv-1.0.11-1.fc25.s390x
dhcp-client-4.3.5-1.fc25.s390x
python2-dnf-plugins-core-0.1.21-4.fc25.noarch
parted-3.2-21.fc25.s390x
python2-ndg_httpsclient-0.4.0-4.fc25.noarch
bash-completion-2.4-1.fc25.noarch
btrfs-progs-4.6.1-1.fc25.s390x
texinfo-6.1-3.fc25.s390x
perl-Filter-1.55-366.fc25.s390x
flex-2.6.0-3.fc25.s390x
libgcc-6.3.1-1.fc25.s390x
glib2-2.50.2-1.fc25.s390x
dbus-libs-1.11.8-1.fc25.s390x
libgomp-6.3.1-1.fc25.s390x
colord-libs-1.3.4-1.fc25.s390x
perl-Encode-2.88-5.fc25.s390x
gstreamer1-1.10.2-1.fc25.s390x
cracklib-2.9.6-4.fc25.s390x
rpm-build-libs-4.13.0-6.fc25.s390x
libobjc-6.3.1-1.fc25.s390x
pcre-devel-8.40-1.fc25.s390x
mariadb-config-10.1.20-1.fc25.s390x
gcc-6.3.1-1.fc25.s390x
mesa-libGL-13.0.3-1.fc25.s390x
python3-dnf-plugin-system-upgrade-0.7.1-4.fc25.noarch
bind-libs-9.10.4-4.P5.fc25.s390x
python-osbs-client-0.33-3.fc25.noarch
NetworkManager-1.4.4-3.fc25.s390x
audit-2.7.1-1.fc25.s390x
glibc-static-2.24-4.fc25.s390x
perl-Pod-Simple-3.35-1.fc25.noarch
gdb-7.12-36.fc25.s390x
python2-simplejson-3.10.0-1.fc25.s390x
python3-sssdconfig-1.14.2-2.fc25.noarch
texlive-lib-2016-30.20160520.fc25.s390x
boost-random-1.60.0-10.fc25.s390x
brltty-5.4-2.fc25.s390x
libref_array-0.1.5-29.fc25.s390x
librados2-10.2.4-2.fc25.s390x
gnutls-dane-3.5.8-1.fc25.s390x
systemtap-client-3.1-0.20160725git91bfb36.fc25.s390x
libXrender-devel-0.9.10-1.fc25.s390x
libXi-devel-1.7.8-2.fc25.s390x
texlive-pdftex-doc-svn41149-30.fc25.noarch
tcp_wrappers-7.6-83.fc25.s390x
javapackages-tools-4.7.0-6.1.fc25.noarch
texlive-kpathsea-bin-svn40473-30.20160520.fc25.s390x
texlive-url-svn32528.3.4-30.fc25.noarch
texlive-latex-fonts-svn28888.0-30.fc25.noarch
texlive-mptopdf-bin-svn18674.0-30.20160520.fc25.noarch
texlive-underscore-svn18261.0-30.fc25.noarch
texlive-subfig-svn15878.1.3-30.fc25.noarch
texlive-dvipdfmx-def-svn40328-30.fc25.noarch
texlive-plain-svn40274-30.fc25.noarch
texlive-texlive-scripts-svn41433-30.fc25.noarch
texlive-fancyref-svn15878.0.9c-30.fc25.noarch
texlive-csquotes-svn39538-30.fc25.noarch
texlive-pxfonts-svn15878.0-30.fc25.noarch
texlive-cite-svn36428.5.5-30.fc25.noarch
texlive-section-svn20180.0-30.fc25.noarch
texlive-pslatex-svn16416.0-30.fc25.noarch
texlive-tex-gyre-math-svn41264-30.fc25.noarch
texlive-knuth-local-svn38627-30.fc25.noarch
texlive-type1cm-svn21820.0-30.fc25.noarch
texlive-finstrut-svn21719.0.5-30.fc25.noarch
texlive-ucharcat-svn38907-30.fc25.noarch
texlive-environ-svn33821.0.3-30.fc25.noarch
texlive-eso-pic-svn37925.2.0g-30.fc25.noarch
texlive-filehook-svn24280.0.5d-30.fc25.noarch
texlive-luatexbase-svn38550-30.fc25.noarch
texlive-pst-text-svn15878.1.00-30.fc25.noarch
texlive-pst-tree-svn24142.1.12-30.fc25.noarch
texlive-latex-bin-bin-svn14050.0-30.20160520.fc25.noarch
texlive-metalogo-svn18611.0.12-30.fc25.noarch
texlive-cm-super-svn15878.0-30.fc25.noarch
texlive-xetex-svn41438-30.fc25.noarch
keyutils-1.5.9-8.fc24.s390x
libcephfs_jni1-10.2.4-2.fc25.s390x
libcom_err-devel-1.43.3-1.fc25.s390x
mesa-libGLES-devel-13.0.3-1.fc25.s390x
graphite2-devel-1.3.6-1.fc25.s390x
nettle-devel-3.3-1.fc25.s390x
lzo-minilzo-2.08-8.fc24.s390x
bzip2-devel-1.0.6-21.fc25.s390x
libusbx-devel-1.0.21-1.fc25.s390x
SDL2-devel-2.0.5-2.fc25.s390x
virglrenderer-devel-0.5.0-1.20160411git61846f92f.fc25.s390x
glib2-static-2.50.2-1.fc25.s390x
mesa-libgbm-devel-13.0.3-1.fc25.s390x
acpica-tools-20160831-1.fc25.s390x
gdk-pixbuf2-2.36.4-1.fc25.s390x
nss-softokn-3.28.1-1.0.fc25.s390x
python3-dnf-1.1.10-5.fc25.noarch
python-gluster-3.9.1-1.fc25.noarch
perl-IO-1.36-382.fc25.s390x
glusterfs-devel-3.9.1-1.fc25.s390x
gtk3-3.22.7-1.fc25.s390x
vim-enhanced-8.0.206-1.fc25.s390x
nss-tools-3.28.1-1.3.fc25.s390x
libmicrohttpd-0.9.52-1.fc25.s390x
gpg-pubkey-a29cb19c-53bcbba6
libaio-0.3.110-6.fc24.s390x
m4-1.4.17-9.fc24.s390x
libfontenc-1.1.3-3.fc24.s390x
lzo-2.08-8.fc24.s390x
isl-0.14-5.fc24.s390x
libXau-1.0.8-6.fc24.s390x
liblockfile-1.09-4.fc24.s390x
linux-atm-libs-2.5.1-14.fc24.s390x
sg3_utils-1.41-3.fc24.s390x
libXext-1.3.3-4.fc24.s390x
libXinerama-1.1.3-6.fc24.s390x
libXxf86vm-1.1.4-3.fc24.s390x
libXft-2.3.2-4.fc24.s390x
ykpers-1.17.3-2.fc24.s390x
bison-3.0.4-4.fc24.s390x
perl-srpm-macros-1-20.fc25.noarch
gawk-4.1.3-8.fc25.s390x
tcp_wrappers-libs-7.6-83.fc25.s390x
libwayland-client-1.12.0-1.fc25.s390x
iptables-1.6.0-2.fc25.s390x
perl-Exporter-5.72-366.fc25.noarch
perl-Text-Tabs+Wrap-2013.0523-365.fc25.noarch
perl-Error-0.17024-7.fc25.noarch
perl-Term-Cap-1.17-365.fc25.noarch
perl-version-0.99.17-1.fc25.s390x
perl-Pod-Usage-1.69-1.fc25.noarch
fftw-libs-double-3.3.5-3.fc25.s390x
device-mapper-persistent-data-0.6.3-1.fc25.s390x
krb5-libs-1.14.4-4.fc25.s390x
system-python-libs-3.5.2-4.fc25.s390x
net-snmp-libs-5.7.3-13.fc25.s390x
libssh2-1.8.0-1.fc25.s390x
libgusb-0.2.9-1.fc25.s390x
ModemManager-glib-1.6.4-1.fc25.s390x
python3-six-1.10.0-3.fc25.noarch
newt-python3-0.52.19-2.fc25.s390x
python3-pysocks-1.5.6-5.fc25.noarch
python-chardet-2.3.0-1.fc25.noarch
python-munch-2.0.4-3.fc25.noarch
python2-cffi-1.7.0-2.fc25.s390x
python-bugzilla-1.2.2-4.fc25.noarch
openldap-2.4.44-2.fc25.s390x
libedit-3.1-16.20160618cvs.fc25.s390x
gc-devel-7.4.4-1.fc25.s390x
python-pycurl-7.43.0-4.fc25.s390x
createrepo_c-0.10.0-6.fc25.s390x
plymouth-0.9.3-0.6.20160620git0e65b86c.fc25.s390x
device-mapper-multipath-libs-0.4.9-83.fc25.s390x
ebtables-2.0.10-21.fc25.s390x
python3-librepo-1.7.18-3.fc25.s390x
libwmf-lite-0.2.8.4-49.fc25.s390x
net-snmp-5.7.3-13.fc25.s390x
yum-3.4.3-510.fc25.noarch
dnf-plugins-core-0.1.21-4.fc25.noarch
at-spi2-atk-2.22.0-1.fc25.s390x
ImageMagick-libs-6.9.3.0-3.fc25.s390x
dhcp-common-4.3.5-1.fc25.noarch
kernel-modules-4.8.8-300.fc25.s390x
dracut-config-rescue-044-78.fc25.s390x
sendmail-8.15.2-7.fc25.s390x
avahi-autoipd-0.6.32-4.fc25.s390x
teamd-1.26-1.fc25.s390x
kernel-devel-4.8.8-300.fc25.s390x
mozjs17-17.0.0-16.fc25.s390x
libselinux-2.5-13.fc25.s390x
libcrypt-nss-2.24-4.fc25.s390x
systemd-libs-231-12.fc25.s390x
libgo-6.3.1-1.fc25.s390x
libgo-devel-6.3.1-1.fc25.s390x
NetworkManager-libnm-1.4.4-3.fc25.s390x
cpp-6.3.1-1.fc25.s390x
rpm-plugin-selinux-4.13.0-6.fc25.s390x
pcre-utf32-8.40-1.fc25.s390x
packagedb-cli-2.14-1.fc25.noarch
python2-pyparsing-2.1.10-1.fc25.noarch
glibc-devel-2.24-4.fc25.s390x
libdrm-2.4.74-1.fc25.s390x
kernel-modules-4.9.3-200.fc25.s390x
cairo-gobject-1.14.8-1.fc25.s390x
bind99-license-9.9.9-4.P5.fc25.noarch
pyrpkg-1.47-5.fc25.noarch
emacs-25.1-3.fc25.s390x
firewalld-0.4.4.2-2.fc25.noarch
pyparsing-2.1.10-1.fc25.noarch
kernel-devel-4.9.3-200.fc25.s390x
libproxy-0.4.14-1.fc25.s390x
ethtool-4.8-1.fc25.s390x
python3-pyparsing-2.1.10-1.fc25.noarch
xorg-x11-proto-devel-7.7-20.fc25.noarch
brlapi-0.6.5-2.fc25.s390x
libcollection-0.7.0-29.fc25.s390x
librados-devel-10.2.4-2.fc25.s390x
libcephfs-devel-10.2.4-2.fc25.s390x
libXdamage-devel-1.1.4-8.fc24.s390x
libXinerama-devel-1.1.3-6.fc24.s390x
quota-4.03-7.fc25.s390x
texlive-texlive-common-doc-svn40682-30.fc25.noarch
texlive-metafont-bin-svn40987-30.20160520.fc25.s390x
texlive-ifluatex-svn41346-30.fc25.noarch
texlive-dvips-bin-svn40987-30.20160520.fc25.s390x
texlive-marvosym-svn29349.2.2a-30.fc25.noarch
texlive-graphics-cfg-svn40269-30.fc25.noarch
texlive-carlisle-svn18258.0-30.fc25.noarch
texlive-glyphlist-svn28576.0-30.fc25.noarch
texlive-tex-bin-svn40987-30.20160520.fc25.s390x
texlive-texlive-scripts-bin-svn29741.0-30.20160520.fc25.noarch
texlive-mathtools-svn38833-30.fc25.noarch
texlive-euro-svn22191.1.1-30.fc25.noarch
texlive-palatino-svn31835.0-30.fc25.noarch
texlive-anysize-svn15878.0-30.fc25.noarch
texlive-sansmath-svn17997.1.1-30.fc25.noarch
texlive-mfnfss-svn19410.0-30.fc25.noarch
texlive-mathpazo-svn15878.1.003-30.fc25.noarch
texlive-knuth-lib-svn35820.0-30.fc25.noarch
texlive-updmap-map-svn41159-30.fc25.noarch
texlive-beton-svn15878.0-30.fc25.noarch
texlive-xetexconfig-svn41133-30.fc25.noarch
texlive-trimspaces-svn15878.1.1-30.fc25.noarch
texlive-memoir-svn41203-30.fc25.noarch
texlive-latex-svn40218-30.fc25.noarch
texlive-lualatex-math-svn40621-30.fc25.noarch
texlive-pst-grad-svn15878.1.06-30.fc25.noarch
texlive-pst-tools-svn34067.0.05-30.fc25.noarch
texlive-amscls-svn36804.0-30.fc25.noarch
texlive-tex-gyre-svn18651.2.004-30.fc25.noarch
texlive-ltxmisc-svn21927.0-30.fc25.noarch
texlive-xetex-bin-svn41091-30.20160520.fc25.s390x
lua-posix-33.3.1-3.fc25.s390x
gssproxy-0.5.1-3.fc25.s390x
java-1.8.0-openjdk-1.8.0.111-5.b16.fc25.s390x
libverto-devel-0.2.6-6.fc24.s390x
mesa-libGLES-13.0.3-1.fc25.s390x
p11-kit-devel-0.23.2-2.fc24.s390x
snappy-1.1.3-2.fc24.s390x
gnutls-devel-3.5.8-1.fc25.s390x
cairo-gobject-devel-1.14.8-1.fc25.s390x
usbredir-devel-0.7.1-2.fc24.s390x
systemtap-3.1-0.20160725git91bfb36.fc25.s390x
bluez-libs-devel-5.43-1.fc25.s390x
libcurl-devel-7.51.0-4.fc25.s390x
cyrus-sasl-devel-2.1.26-26.2.fc24.s390x
python-libs-2.7.13-1.fc25.s390x
nss-sysinit-3.28.1-1.3.fc25.s390x
dnf-1.1.10-5.fc25.noarch
glusterfs-extra-xlators-3.9.1-1.fc25.s390x
perl-5.24.1-382.fc25.s390x
linux-firmware-20161205-69.git91ddce49.fc25.noarch
libX11-devel-1.6.4-4.fc25.s390x
kernel-devel-4.9.5-200.fc25.s390x
python-devel-2.7.13-1.fc25.s390x
kernel-headers-4.9.5-200.fc25.s390x
gpg-pubkey-efe550f5-5220ba41
python-async-0.6.1-9.fc22.s390x
gpg-pubkey-81b46521-55b3ca9a
dejavu-sans-mono-fonts-2.35-3.fc24.noarch
filesystem-3.2-37.fc24.s390x
popt-1.16-7.fc24.s390x
libffi-3.1-9.fc24.s390x
cyrus-sasl-lib-2.1.26-26.2.fc24.s390x
xz-5.2.2-2.fc24.s390x
keyutils-libs-1.5.9-8.fc24.s390x
libnfnetlink-1.0.1-8.fc24.s390x
libnetfilter_conntrack-1.0.4-6.fc24.s390x
libtheora-1.1.1-14.fc24.s390x
xml-common-0.6.3-44.fc24.noarch
autoconf-2.69-22.fc24.noarch
libpipeline-1.4.1-2.fc24.s390x
libXt-1.1.5-3.fc24.s390x
kbd-legacy-2.0.3-3.fc24.noarch
ghostscript-fonts-5.50-35.fc24.noarch
libcroco-0.6.11-2.fc24.s390x
pinentry-0.9.7-2.fc24.s390x
libXevie-1.0.3-11.fc24.s390x
pth-2.0.7-27.fc24.s390x
python2-rpm-macros-3-10.fc25.noarch
libsepol-2.5-10.fc25.s390x
libcap-2.25-2.fc25.s390x
sqlite-libs-3.14.2-1.fc25.s390x
mpfr-3.1.5-1.fc25.s390x
libxcb-1.12-1.fc25.s390x
libicu-57.1-4.fc25.s390x
perl-Carp-1.40-365.fc25.noarch
perl-IO-Socket-IP-0.38-1.fc25.noarch
libmnl-1.0.4-1.fc25.s390x
perl-Unicode-EastAsianWidth-1.33-8.fc25.noarch
perl-Getopt-Long-2.49.1-1.fc25.noarch
libwayland-cursor-1.12.0-1.fc25.s390x
coreutils-common-8.25-15.fc25.s390x
libmount-2.28.2-1.fc25.s390x
python2-decorator-4.0.10-3.fc25.noarch
avahi-glib-0.6.32-4.fc25.s390x
python3-pip-8.1.2-2.fc25.noarch
python3-libcomps-0.1.7-5.fc25.s390x
python-slip-0.6.4-4.fc25.noarch
python-krbV-1.0.90-12.fc25.s390x
python2-libcomps-0.1.7-5.fc25.s390x
python2-urllib3-1.15.1-3.fc25.noarch
fipscheck-1.4.1-11.fc25.s390x
gc-7.4.4-1.fc25.s390x
libndp-1.6-1.fc25.s390x
libsolv-0.6.24-1.fc25.s390x
gnupg2-2.1.13-2.fc25.s390x
geoclue2-2.4.4-1.fc25.s390x
s390utils-cmsfs-1.36.0-1.fc25.s390x
libXfixes-5.0.3-1.fc25.s390x
libXi-1.7.8-2.fc25.s390x
adwaita-icon-theme-3.22.0-1.fc25.noarch
dconf-0.26.0-1.fc25.s390x
ncurses-devel-6.0-6.20160709.fc25.s390x
newt-python-0.52.19-2.fc25.s390x
perl-Test-Harness-3.36-367.fc25.noarch
valgrind-3.12.0-1.fc25.s390x
dejagnu-1.6-1.fc25.noarch
audit-libs-2.7.1-1.fc25.s390x
libstdc++-devel-6.3.1-1.fc25.s390x
emacs-filesystem-25.1-3.fc25.noarch
libdb-utils-5.3.28-16.fc25.s390x
libidn2-0.11-1.fc25.s390x
python3-rpm-4.13.0-6.fc25.s390x
gnutls-3.5.8-1.fc25.s390x
python-beautifulsoup4-4.5.3-1.fc25.noarch
qt5-srpm-macros-5.7.1-1.fc25.noarch
elfutils-default-yama-scope-0.168-1.fc25.noarch
device-mapper-1.02.136-3.fc25.s390x
device-mapper-event-1.02.136-3.fc25.s390x
systemd-container-231-12.fc25.s390x
python3-distro-1.0.1-2.fc25.noarch
fedpkg-1.26-4.fc25.noarch
gstreamer1-plugins-base-1.10.2-1.fc25.s390x
subversion-1.9.5-1.fc25.s390x
perl-Module-CoreList-5.20170115-1.fc25.noarch
perl-Class-Inspector-1.31-2.fc25.noarch
libtool-ltdl-2.4.6-13.fc25.s390x
python2-sssdconfig-1.14.2-2.fc25.noarch
glib2-devel-2.50.2-1.fc25.s390x
poppler-0.45.0-2.fc25.s390x
libbasicobjects-0.1.1-29.fc25.s390x
libevent-2.0.22-1.fc25.s390x
libradosstriper1-10.2.4-2.fc25.s390x
atk-devel-2.22.0-1.fc25.s390x
libXxf86vm-devel-1.1.4-3.fc24.s390x
libev-4.24-1.fc25.s390x
gsm-1.0.16-1.fc25.s390x
libnfsidmap-0.27-0.fc25.s390x
zziplib-0.13.62-7.fc24.s390x
texlive-metafont-svn40793-30.fc25.noarch
texlive-booktabs-svn40846-30.fc25.noarch
texlive-dvips-svn41149-30.fc25.noarch
texlive-zapfding-svn31835.0-30.fc25.noarch
texlive-graphics-svn41015-30.fc25.noarch
texlive-latexconfig-svn40274-30.fc25.noarch
texlive-gsftopk-bin-svn40473-30.20160520.fc25.s390x
texlive-tex-svn40793-30.fc25.noarch
texlive-xdvi-bin-svn40750-30.20160520.fc25.s390x
texlive-qstest-svn15878.0-30.fc25.noarch
texlive-avantgar-svn31835.0-30.fc25.noarch
texlive-ncntrsbk-svn31835.0-30.fc25.noarch
texlive-cm-svn32865.0-30.fc25.noarch
texlive-rcs-svn15878.0-30.fc25.noarch
texlive-fix2col-svn38770-30.fc25.noarch
texlive-lm-math-svn36915.1.959-30.fc25.noarch
texlive-hyphen-base-svn41138-30.fc25.noarch
texlive-unicode-data-svn39808-30.fc25.noarch
texlive-luatex-svn40963-30.fc25.noarch
texlive-xetex-def-svn40327-30.fc25.noarch
texlive-varwidth-svn24104.0.92-30.fc25.noarch
texlive-l3kernel-svn41246-30.fc25.noarch
texlive-hyperref-svn41396-30.fc25.noarch
texlive-unicode-math-svn38462-30.fc25.noarch
texlive-fancyvrb-svn18492.2.8-30.fc25.noarch
texlive-pst-plot-svn41242-30.fc25.noarch
texlive-rotating-svn16832.2.16b-30.fc25.noarch
texlive-pdfpages-svn40638-30.fc25.noarch
texlive-ae-svn15878.1.4-30.fc25.noarch
libpaper-1.1.24-12.fc24.s390x
texlive-collection-latexrecommended-svn35765.0-30.20160520.fc25.noarch
libini_config-1.3.0-29.fc25.s390x
xorg-x11-fonts-Type1-7.5-16.fc24.noarch
pcre2-devel-10.22-8.fc25.s390x
gnutls-c++-3.5.8-1.fc25.s390x
systemtap-devel-3.1-0.20160725git91bfb36.fc25.s390x
libtasn1-devel-4.10-1.fc25.s390x
pango-devel-1.40.3-1.fc25.s390x
vte291-devel-0.46.1-1.fc25.s390x
snappy-devel-1.1.3-2.fc24.s390x
brlapi-devel-0.6.5-2.fc25.s390x
man-pages-4.06-3.fc25.noarch
libcap-ng-devel-0.7.8-1.fc25.s390x
glusterfs-3.9.1-1.fc25.s390x
nss-util-devel-3.28.1-1.0.fc25.s390x
dnf-conf-1.1.10-5.fc25.noarch
libxkbcommon-devel-0.7.1-1.fc25.s390x
perl-macros-5.24.1-382.fc25.s390x
rpcbind-0.2.4-2.fc25.s390x
pulseaudio-libs-10.0-2.fc25.s390x
kernel-4.9.5-200.fc25.s390x
libnl3-cli-3.2.29-2.fc25.s390x
tzdata-2016j-2.fc25.noarch
gpg-pubkey-34ec9cba-54e38751
gpg-pubkey-030d5aed-55b577f0
basesystem-11-2.fc24.noarch
libattr-2.4.47-16.fc24.s390x
libmpc-1.0.2-5.fc24.s390x
apr-util-1.5.4-3.fc24.s390x
rsync-3.1.2-2.fc24.s390x
libunistring-0.9.4-3.fc24.s390x
jbigkit-libs-2.1-5.fc24.s390x
pixman-0.34.0-2.fc24.s390x
acl-2.2.52-11.fc24.s390x
dwz-0.12-2.fc24.s390x
expect-5.45-22.fc24.s390x
libmodman-2.0.1-12.fc24.s390x
libsigsegv-2.10-10.fc24.s390x
libvisual-0.4.0-20.fc24.s390x
fakeroot-libs-1.20.2-4.fc24.s390x
m17n-lib-1.7.0-5.fc24.s390x
libpcap-1.7.4-2.fc24.s390x
libverto-0.2.6-6.fc24.s390x
lsscsi-0.28-3.fc24.s390x
setup-2.10.4-1.fc25.noarch
rpmconf-base-1.0.18-2.fc25.noarch
bash-4.3.43-4.fc25.s390x
expat-2.2.0-1.fc25.s390x
libxml2-2.9.3-4.fc25.s390x
libgpg-error-1.24-1.fc25.s390x
nspr-4.13.1-1.fc25.s390x
libgcrypt-1.6.6-1.fc25.s390x
file-libs-5.28-4.fc25.s390x
findutils-4.6.0-8.fc25.s390x
libjpeg-turbo-1.5.1-0.fc25.s390x
kmod-23-1.fc25.s390x
libassuan-2.4.3-1.fc25.s390x
libusbx-1.0.21-1.fc25.s390x
newt-0.52.19-2.fc25.s390x
libxslt-1.1.28-13.fc25.s390x
libmetalink-0.1.3-1.fc25.s390x
perl-Socket-2.024-1.fc25.s390x
perl-File-Path-2.12-365.fc25.noarch
perl-MIME-Base64-3.15-365.fc25.s390x
perl-HTTP-Tiny-0.070-1.fc25.noarch
ncurses-6.0-6.20160709.fc25.s390x
libwayland-server-1.12.0-1.fc25.s390x
ipset-6.29-1.fc25.s390x
perl-Text-Unidecode-1.27-3.fc25.noarch
perl-Fedora-VSP-0.001-4.fc25.noarch
perl-libintl-perl-1.26-1.fc25.s390x
plymouth-core-libs-0.9.3-0.6.20160620git0e65b86c.fc25.s390x
hunspell-1.4.1-1.fc25.s390x
which-2.21-1.fc25.s390x
coreutils-8.25-15.fc25.s390x
python2-setuptools-25.1.1-1.fc25.noarch
shadow-utils-4.2.1-11.fc25.s390x
atk-2.22.0-1.fc25.s390x
system-python-3.5.2-4.fc25.s390x
pam-1.3.0-1.fc25.s390x
python2-pyasn1-0.1.9-7.fc25.1.noarch
harfbuzz-icu-1.3.2-1.fc25.s390x
gsettings-desktop-schemas-3.22.0-1.fc25.s390x
libsecret-0.18.5-2.fc25.s390x
s390utils-iucvterm-1.36.0-1.fc25.s390x
python3-setuptools-25.1.1-1.fc25.noarch
python3-decorator-4.0.10-3.fc25.noarch
python3-slip-0.6.4-4.fc25.noarch
python3-magic-5.28-4.fc25.noarch
python3-requests-2.10.0-4.fc25.noarch
python3-systemd-232-1.fc25.s390x
pyusb-1.0.0-2.fc25.noarch
python-slip-dbus-0.6.4-4.fc25.noarch
python-enum34-1.0.4-6.fc25.noarch
python-lockfile-0.11.0-4.fc25.noarch
python2-ply-3.8-2.fc25.noarch
pyOpenSSL-16.0.0-2.fc25.noarch
python2-requests-2.10.0-4.fc25.noarch
pyxattr-0.5.3-8.fc25.s390x
libarchive-3.2.2-1.fc25.s390x
libkadm5-1.14.4-4.fc25.s390x
dtc-1.4.2-1.fc25.s390x
libbabeltrace-1.4.0-3.fc25.s390x
guile-2.0.13-1.fc25.s390x
libthai-0.1.25-1.fc25.s390x
libnghttp2-1.13.0-2.fc25.s390x
deltarpm-3.6-17.fc25.s390x
python-urlgrabber-3.10.1-9.fc25.noarch
iputils-20161105-1.fc25.s390x
s390utils-mon_statd-1.36.0-1.fc25.s390x
cryptsetup-libs-1.7.2-3.fc25.s390x
device-mapper-multipath-0.4.9-83.fc25.s390x
cronie-anacron-1.5.1-2.fc25.s390x
ghostscript-core-9.20-5.fc25.s390x
python3-pygpgme-0.3-18.fc25.s390x
rest-0.8.0-1.fc25.s390x
libreport-filesystem-2.8.0-1.fc25.s390x
libXtst-1.2.3-1.fc25.s390x
iso-codes-3.70-1.fc25.noarch
ghc-srpm-macros-1.4.2-4.fc25.noarch
adwaita-cursor-theme-3.22.0-1.fc25.noarch
rpmdevtools-8.9-1.fc25.noarch
kernel-4.8.8-300.fc25.s390x
python-dnf-plugins-extras-migrate-0.0.12-4.fc25.noarch
s390utils-1.36.0-1.fc25.s390x
authconfig-6.2.10-14.fc25.s390x
fedora-cert-0.6.0.1-1.fc25.noarch
glibc-2.24-4.fc25.s390x
elfutils-libelf-0.168-1.fc25.s390x
libstdc++-6.3.1-1.fc25.s390x
perl-Scalar-List-Utils-1.47-1.fc25.s390x
gdb-headless-7.12-36.fc25.s390x
bzip2-1.0.6-21.fc25.s390x
bind-license-9.10.4-4.P5.fc25.noarch
pcre-cpp-8.40-1.fc25.s390x
perl-threads-2.12-1.fc25.s390x
subversion-libs-1.9.5-1.fc25.s390x
libss-1.43.3-1.fc25.s390x
shared-mime-info-1.8-1.fc25.s390x
libselinux-utils-2.5-13.fc25.s390x
libgfortran-6.3.1-1.fc25.s390x
rpm-4.13.0-6.fc25.s390x
python2-rpm-4.13.0-6.fc25.s390x
policycoreutils-2.5-19.fc25.s390x
libtasn1-4.10-1.fc25.s390x
mesa-libwayland-egl-13.0.3-1.fc25.s390x
pigz-2.3.4-1.fc25.s390x
koji-1.11.0-1.fc25.noarch
python3-enchant-1.6.8-1.fc25.noarch
mariadb-common-10.1.20-1.fc25.s390x
firewalld-filesystem-0.4.4.2-2.fc25.noarch
systemd-231-12.fc25.s390x
device-mapper-libs-1.02.136-3.fc25.s390x
systemd-udev-231-12.fc25.s390x
dnf-plugin-system-upgrade-0.7.1-4.fc25.noarch
mesa-libEGL-13.0.3-1.fc25.s390x
dnsmasq-2.76-2.fc25.s390x
distribution-gpg-keys-1.9-1.fc25.noarch
bind-libs-lite-9.10.4-4.P5.fc25.s390x
mock-1.3.3-1.fc25.noarch
python2-dockerfile-parse-0.0.5-7.fc25.noarch
fedora-packager-0.6.0.1-1.fc25.noarch
openssl-1.0.2j-3.fc25.s390x
lvm2-2.02.167-3.fc25.s390x
systemd-bootchart-231-2.fc25.s390x
gcc-c++-6.3.1-1.fc25.s390x
texlive-base-2016-30.20160520.fc25.noarch
boost-system-1.60.0-10.fc25.s390x
pcre2-10.22-8.fc25.s390x
libpng-devel-1.6.27-1.fc25.s390x
perl-XML-Parser-2.44-5.fc25.s390x
libtirpc-1.0.1-3.rc3.fc25.s390x
lttng-ust-2.8.1-2.fc25.s390x
libasyncns-0.8-10.fc24.s390x
unbound-libs-1.5.10-1.fc25.s390x
libradosstriper-devel-10.2.4-2.fc25.s390x
systemtap-runtime-3.1-0.20160725git91bfb36.fc25.s390x
libXau-devel-1.0.8-6.fc24.s390x
libXfixes-devel-5.0.3-1.fc25.s390x
mesa-libEGL-devel-13.0.3-1.fc25.s390x
libXcomposite-devel-0.4.4-8.fc24.s390x
libverto-libev-0.2.6-6.fc24.s390x
texlive-kpathsea-doc-svn41139-30.fc25.noarch
flac-libs-1.3.2-1.fc25.s390x
quota-nls-4.03-7.fc25.noarch
python3-html5lib-0.999-9.fc25.noarch
python3-javapackages-4.7.0-6.1.fc25.noarch
perl-Digest-1.17-366.fc25.noarch
texlive-texlive.infra-svn41280-30.fc25.noarch
texlive-tetex-svn41059-30.fc25.noarch
texlive-amsfonts-svn29208.3.04-30.fc25.noarch
texlive-etex-pkg-svn39355-30.fc25.noarch
texlive-lm-svn28119.2.004-30.fc25.noarch
texlive-fp-svn15878.0-30.fc25.noarch
texlive-mptopdf-svn41282-30.fc25.noarch
texlive-euler-svn17261.2.5-30.fc25.noarch
texlive-setspace-svn24881.6.7a-30.fc25.noarch
texlive-tools-svn40934-30.fc25.noarch
texlive-colortbl-svn29803.v1.0a-30.fc25.noarch
texlive-natbib-svn20668.8.31b-30.fc25.noarch
texlive-bibtex-svn40768-30.fc25.noarch
texlive-gsftopk-svn40768-30.fc25.noarch
texlive-mfware-svn40768-30.fc25.noarch
texlive-tex-ini-files-svn40533-30.fc25.noarch
texlive-texconfig-bin-svn29741.0-30.20160520.fc25.noarch
libXmu-1.1.2-4.fc24.s390x
libXcursor-1.1.14-6.fc24.s390x
kbd-misc-2.0.3-3.fc24.noarch
libutempter-1.1.6-8.fc24.s390x
python-kitchen-1.2.4-2.fc24.noarch
polkit-libs-0.113-5.fc24.s390x
libgudev-230-3.fc24.s390x
popt-devel-1.16-7.fc24.s390x
make-4.1-5.fc24.s390x
fakeroot-1.20.2-4.fc24.s390x
blktrace-1.1.0-3.fc24.s390x
hicolor-icon-theme-0.15-3.fc24.noarch
usermode-1.111-8.fc24.s390x
kbd-2.0.3-3.fc24.s390x
libaio-devel-0.3.110-6.fc24.s390x
web-assets-filesystem-5-4.fc24.noarch
perl-IO-Socket-SSL-2.038-1.fc25.noarch
python-backports-ssl_match_hostname-3.5.0.1-3.fc25.noarch
mc-4.8.18-2.fc25.s390x
expat-devel-2.2.0-1.fc25.s390x
automake-1.15-7.fc25.noarch
perl-File-ShareDir-1.102-7.fc25.noarch
lua-5.3.3-3.fc25.s390x
tcl-8.6.6-1.fc25.s390x
gcc-objc-6.3.1-1.fc25.s390x
libselinux-devel-2.5-13.fc25.s390x
e2fsprogs-1.43.3-1.fc25.s390x
perl-Storable-2.56-367.fc25.s390x
libstdc++-static-6.3.1-1.fc25.s390x
perl-Time-Local-1.250-1.fc25.noarch
libwebp-0.5.2-1.fc25.s390x
xkeyboard-config-2.19-1.1.fc25.noarch
python-firewall-0.4.4.2-2.fc25.noarch
texlive-xdvi-svn40768-30.fc25.noarch
texlive-wasy2-ps-svn35830.0-30.fc25.noarch
texlive-ltabptch-svn17533.1.74d-30.fc25.noarch
texlive-sauerj-svn15878.0-30.fc25.noarch
texlive-bookman-svn31835.0-30.fc25.noarch
texlive-courier-svn35058.0-30.fc25.noarch
texlive-mflogo-font-svn36898.1.002-30.fc25.noarch
texlive-rsfs-svn15878.0-30.fc25.noarch
texlive-zapfchan-svn31835.0-30.fc25.noarch
texlive-cmap-svn41168-30.fc25.noarch
texlive-parskip-svn19963.2.0-30.fc25.noarch
texlive-sepnum-svn20186.2.0-30.fc25.noarch
texlive-fancyhdr-svn15878.3.1-30.fc25.noarch
texlive-pspicture-svn15878.0-30.fc25.noarch
texlive-fpl-svn15878.1.002-30.fc25.noarch
texlive-utopia-svn15878.0-30.fc25.noarch
texlive-hyph-utf8-svn41189-30.fc25.noarch
texlive-lua-alt-getopt-svn29349.0.7.0-30.fc25.noarch
texlive-texlive-msg-translations-svn41431-30.fc25.noarch
texlive-parallel-svn15878.0-30.fc25.noarch
texlive-luatex-bin-svn41091-30.20160520.fc25.s390x
texlive-lineno-svn21442.4.41-30.fc25.noarch
texlive-kastrup-svn15878.0-30.fc25.noarch
texlive-chngcntr-svn17157.1.0a-30.fc25.noarch
texlive-lualibs-svn40370-30.fc25.noarch
texlive-xunicode-svn30466.0.981-30.fc25.noarch
texlive-l3packages-svn41246-30.fc25.noarch
texlive-pgf-svn40966-30.fc25.noarch
texlive-koma-script-svn41508-30.fc25.noarch
texlive-currfile-svn40725-30.fc25.noarch
texlive-luaotfload-svn40902-30.fc25.noarch
texlive-ifplatform-svn21156.0.4-30.fc25.noarch
texlive-showexpl-svn32737.v0.3l-30.fc25.noarch
texlive-pst-3d-svn17257.1.10-30.fc25.noarch
texlive-pst-node-svn40743-30.fc25.noarch
texlive-pstricks-add-svn40744-30.fc25.noarch
texlive-pst-pdf-svn31660.1.1v-30.fc25.noarch
texlive-latex-bin-svn41438-30.fc25.noarch
texlive-powerdot-svn38984-30.fc25.noarch
texlive-sansmathaccent-svn30187.0-30.fc25.noarch
texlive-typehtml-svn17134.0-30.fc25.noarch
texlive-ucs-svn35853.2.2-30.fc25.noarch
teckit-2.5.1-15.fc24.s390x
texlive-dvipdfmx-svn41149-30.fc25.noarch
texlive-collection-latex-svn41011-30.20160520.fc25.noarch
netpbm-10.76.00-2.fc25.s390x
libpath_utils-0.2.1-29.fc25.s390x
nfs-utils-1.3.4-1.rc3.fc25.s390x
ttmkfdir-3.0.9-48.fc24.s390x
libcephfs_jni-devel-10.2.4-2.fc25.s390x
pcre2-utf16-10.22-8.fc25.s390x
keyutils-libs-devel-1.5.9-8.fc24.s390x
libicu-devel-57.1-4.fc25.s390x
attr-2.4.47-16.fc24.s390x
harfbuzz-devel-1.3.2-1.fc25.s390x
libidn-devel-1.33-1.fc25.s390x
usbredir-0.7.1-2.fc24.s390x
libnfs-1.9.8-2.fc24.s390x
SDL2-2.0.5-2.fc25.s390x
freetype-devel-2.6.5-1.fc25.s390x
cairo-devel-1.14.8-1.fc25.s390x
libepoxy-devel-1.3.1-3.fc25.s390x
libcacard-devel-2.5.2-2.fc24.s390x
lzo-devel-2.08-8.fc24.s390x
libssh2-devel-1.8.0-1.fc25.s390x
pcre-static-8.40-1.fc25.s390x
qemu-sanity-check-nodeps-1.1.5-5.fc24.s390x
libcap-devel-2.25-2.fc25.s390x
alsa-lib-devel-1.1.1-2.fc25.s390x
nss-util-3.28.1-1.0.fc25.s390x
glusterfs-client-xlators-3.9.1-1.fc25.s390x
nss-softokn-freebl-3.28.1-1.0.fc25.s390x
libnl3-3.2.29-2.fc25.s390x
python3-hawkey-0.6.3-6.1.fc25.s390x
git-core-doc-2.9.3-2.fc25.s390x
glusterfs-fuse-3.9.1-1.fc25.s390x
gdk-pixbuf2-devel-2.36.4-1.fc25.s390x
perl-Errno-1.25-382.fc25.s390x
git-2.9.3-2.fc25.s390x
glusterfs-server-3.9.1-1.fc25.s390x
kernel-modules-4.9.5-200.fc25.s390x
pulseaudio-libs-glib2-10.0-2.fc25.s390x
libpsl-0.17.0-1.fc25.s390x
glusterfs-api-devel-3.9.1-1.fc25.s390x
nss-devel-3.28.1-1.3.fc25.s390x
wpa_supplicant-2.6-1.fc25.s390x
xemacs-filesystem-21.5.34-19.20170114hgd0e8ec0fe015.fc25.noarch
opus-1.1.3-2.fc25.s390x
copy-jdk-configs-2.0-1.fc25.noarch
gpg-pubkey-a0a7badb-52844296
fontpackages-filesystem-1.44-17.fc24.noarch
readline-6.3-8.fc24.s390x
cpio-2.12-3.fc24.s390x
groff-base-1.22.3-8.fc24.s390x
ilmbase-2.2.0-5.fc24.s390x
p11-kit-trust-0.23.2-2.fc24.s390x
OpenEXR-libs-2.2.0-5.fc24.s390x
hesiod-3.2.1-6.fc24.s390x
sysfsutils-2.1.0-19.fc24.s390x
qrencode-libs-3.4.2-6.fc24.s390x
GeoIP-1.6.9-2.fc24.s390x
ocaml-srpm-macros-2-4.fc24.noarch
libXcomposite-0.4.4-8.fc24.s390x
procps-ng-3.3.10-11.fc24.s390x
GConf2-3.2.6-16.fc24.s390x
mailx-12.5-19.fc24.s390x
xz-devel-5.2.2-2.fc24.s390x
fedora-logos-22.0.0-3.fc24.s390x
telnet-0.17-65.fc24.s390x
gpg-pubkey-e372e838-56fd7943
fedora-repos-25-1.noarch
ncurses-libs-6.0-6.20160709.fc25.s390x
lua-libs-5.3.3-3.fc25.s390x
kmod-libs-23-1.fc25.s390x
libseccomp-2.3.1-1.fc25.s390x
perl-parent-0.236-1.fc25.noarch
libICE-1.0.9-5.fc25.s390x
ipset-libs-6.29-1.fc25.s390x
perl-TermReadKey-2.37-1.fc25.s390x
dhcp-libs-4.3.5-1.fc25.s390x
gmp-devel-6.1.1-1.fc25.s390x
ncurses-c++-libs-6.0-6.20160709.fc25.s390x
python-pip-8.1.2-2.fc25.noarch
gzip-1.8-1.fc25.s390x
harfbuzz-1.3.2-1.fc25.s390x
python2-iniparse-0.4-20.fc25.noarch
libfdisk-2.28.2-1.fc25.s390x
python3-iniparse-0.4-20.fc25.noarch
python3-gobject-base-3.22.0-1.fc25.s390x
python3-kickstart-2.32-1.fc25.noarch
python2-yubico-1.3.2-3.fc25.noarch
python-idna-2.0-4.fc25.noarch
nss-pem-1.0.2-2.fc25.s390x
perl-Net-SSLeay-1.78-1.fc25.s390x
krb5-workstation-1.14.4-4.fc25.s390x
libepoxy-1.3.1-3.fc25.s390x
drpm-0.3.0-3.fc25.s390x
libsmartcols-2.28.2-1.fc25.s390x
s390utils-ziomon-1.36.0-1.fc25.s390x
librepo-1.7.18-3.fc25.s390x
glib-networking-2.50.0-1.fc25.s390x
librsvg2-2.40.16-2.fc25.s390x
gnat-srpm-macros-4-1.fc25.noarch
webkitgtk3-2.4.11-3.fc25.s390x
libXaw-1.0.13-4.fc25.s390x
sudo-1.8.18p1-1.fc25.s390x
systemtap-sdt-devel-3.1-0.20160725git91bfb36.fc25.s390x
xorg-x11-font-utils-7.5-32.fc25.s390x
python-decoratortools-1.8-12.fc25.noarch
m17n-db-1.7.0-7.fc25.noarch
hardlink-1.1-1.fc25.s390x
glibc-common-2.24-4.fc25.s390x
libcom_err-1.43.3-1.fc25.s390x
grep-2.27-1.fc25.s390x
iproute-4.6.0-6.fc25.s390x
e2fsprogs-libs-1.43.3-1.fc25.s390x
curl-7.51.0-4.fc25.s390x
libvorbis-1.3.5-1.fc25.s390x
python2-dateutil-2.6.0-1.fc25.noarch
python3-firewall-0.4.4.2-2.fc25.noarch
libXpm-3.5.12-1.fc25.s390x
systemd-pam-231-12.fc25.s390x
mesa-libgbm-13.0.3-1.fc25.s390x
rpm-build-4.13.0-6.fc25.s390x
openssl-libs-1.0.2j-3.fc25.s390x
python2-smmap-2.0.1-1.fc25.noarch
bind99-libs-9.9.9-4.P5.fc25.s390x
kernel-4.9.3-200.fc25.s390x
gcc-gdb-plugin-6.3.1-1.fc25.s390x
selinux-policy-targeted-3.13.1-225.6.fc25.noarch
perl-Time-HiRes-1.9741-1.fc25.s390x
npth-1.3-1.fc25.s390x
poppler-data-0.4.7-6.fc25.noarch
nspr-devel-4.13.1-1.fc25.s390x
libcephfs1-10.2.4-2.fc25.s390x
wayland-devel-1.12.0-1.fc25.s390x
librbd1-10.2.4-2.fc25.s390x
libxcb-devel-1.12-1.fc25.s390x
mesa-libGL-devel-13.0.3-1.fc25.s390x
perl-encoding-2.19-5.fc25.s390x
libsndfile-1.0.27-1.fc25.s390x
python3-cssselect-0.9.2-1.fc25.noarch
perl-Digest-MD5-2.55-2.fc25.s390x
texlive-tetex-bin-svn36770.0-30.20160520.fc25.noarch
texlive-etoolbox-svn38031.2.2a-30.fc25.noarch
texlive-babel-svn40706-30.fc25.noarch
texlive-fancybox-svn18304.1.4-30.fc25.noarch
texlive-xkeyval-svn35741.2.7a-30.fc25.noarch
texlive-pdftex-def-svn22653.0.06d-30.fc25.noarch
texlive-makeindex-bin-svn40473-30.20160520.fc25.s390x
texlive-pdftex-bin-svn40987-30.20160520.fc25.s390x
texlive-pst-ovl-svn40873-30.fc25.noarch
texlive-crop-svn15878.1.5-30.fc25.noarch
texlive-manfnt-font-svn35799.0-30.fc25.noarch
texlive-txfonts-svn15878.0-30.fc25.noarch
texlive-ntgclass-svn15878.2.1a-30.fc25.noarch
texlive-dvisvgm-def-svn41011-30.fc25.noarch
texlive-ec-svn25033.1.0-30.fc25.noarch
texlive-etex-svn37057.0-30.fc25.noarch
texlive-texlive-en-svn41185-30.fc25.noarch
texlive-graphics-def-svn41879-30.fc25.noarch
texlive-iftex-svn29654.0.2-30.fc25.noarch
texlive-pst-math-svn34786.0.63-30.fc25.noarch
texlive-bera-svn20031.0-30.fc25.noarch
texlive-ms-svn29849.0-30.fc25.noarch
texlive-luaotfload-bin-svn34647.0-30.20160520.fc25.noarch
texlive-listings-svn37534.1.6-30.fc25.noarch
texlive-pst-fill-svn15878.1.01-30.fc25.noarch
texlive-pst-pdf-bin-svn7838.0-30.20160520.fc25.noarch
texlive-pst-slpe-svn24391.1.31-30.fc25.noarch
texlive-seminar-svn34011.1.62-30.fc25.noarch
texlive-l3experimental-svn41163-30.fc25.noarch
texlive-collection-fontsrecommended-svn35830.0-30.20160520.fc25.noarch
gettext-libs-0.19.8.1-3.fc25.s390x
java-1.8.0-openjdk-headless-1.8.0.111-5.b16.fc25.s390x
pcre2-utf32-10.22-8.fc25.s390x
at-spi2-atk-devel-2.22.0-1.fc25.s390x
wayland-protocols-devel-1.7-1.fc25.noarch
virglrenderer-0.5.0-1.20160411git61846f92f.fc25.s390x
libcacard-2.5.2-2.fc24.s390x
pixman-devel-0.34.0-2.fc24.s390x
libacl-devel-2.2.52-11.fc24.s390x
libnfs-devel-1.9.8-2.fc24.s390x
texi2html-5.0-4.fc24.noarch
libseccomp-devel-2.3.1-1.fc25.s390x
perl-libs-5.24.1-382.fc25.s390x
libxkbcommon-0.7.1-1.fc25.s390x
git-core-2.9.3-2.fc25.s390x
nss-softokn-freebl-devel-3.28.1-1.0.fc25.s390x
gtk-update-icon-cache-3.22.7-1.fc25.s390x
vim-filesystem-8.0.206-1.fc25.s390x
libX11-common-1.6.4-4.fc25.noarch
gtk3-devel-3.22.7-1.fc25.s390x
python2-dnf-1.1.10-5.fc25.noarch
vim-minimal-8.0.206-1.fc25.s390x
GeoIP-GeoLite-data-2017.01-1.fc25.noarch
gpg-pubkey-95a43f54-5284415a
dejavu-fonts-common-2.35-3.fc24.noarch
libSM-1.2.2-4.fc24.s390x
diffutils-3.3-13.fc24.s390x
libogg-1.3.2-5.fc24.s390x
hunspell-en-US-0.20140811.1-5.fc24.noarch
libdaemon-0.14-10.fc24.s390x
patch-2.7.5-3.fc24.s390x
libsysfs-2.1.0-19.fc24.s390x
procmail-3.22-39.fc24.s390x
libXdamage-1.1.4-8.fc24.s390x
libotf-0.9.13-7.fc24.s390x
urw-fonts-2.4-22.fc24.noarch
crontabs-1.11-12.20150630git.fc24.noarch
ppp-2.4.7-9.fc24.s390x
polkit-0.113-5.fc24.s390x
cyrus-sasl-2.1.26-26.2.fc24.s390x
zlib-devel-1.2.8-10.fc24.s390x
time-1.7-49.fc24.s390x
gpg-pubkey-fdb19c98-56fd6333
fedora-release-25-1.noarch
freetype-2.6.5-1.fc25.s390x
libcap-ng-0.7.8-1.fc25.s390x
gdbm-1.12-1.fc25.s390x
binutils-2.26.1-1.fc25.s390x
lcms2-2.8-2.fc25.s390x
libcomps-0.1.7-5.fc25.s390x
less-481-6.fc25.s390x
apr-1.5.2-4.fc25.s390x
perl-constant-1.33-367.fc25.noarch
perl-Data-Dumper-2.161-1.fc25.s390x
ipcalc-0.1.8-1.fc25.s390x
perl-Pod-Perldoc-3.27-1.fc25.noarch
libteam-1.26-1.fc25.s390x
gmp-c++-6.1.1-1.fc25.s390x
fontconfig-2.12.1-1.fc25.s390x
enchant-1.6.0-14.fc25.s390x
json-glib-1.2.2-1.fc25.s390x
pyliblzma-0.5.3-16.fc25.s390x
libsepol-devel-2.5-10.fc25.s390x
python3-libs-3.5.2-4.fc25.s390x
python3-ordered-set-2.0.0-4.fc25.noarch
python3-rpmconf-1.0.18-2.fc25.noarch
python-ipaddress-1.0.16-3.fc25.noarch
python2-kerberos-1.2.5-1.fc25.s390x
python2-pysocks-1.5.6-5.fc25.noarch
fipscheck-lib-1.4.1-11.fc25.s390x
libatomic_ops-7.4.4-1.fc25.s390x
net-snmp-agent-libs-5.7.3-13.fc25.s390x
util-linux-2.28.2-1.fc25.s390x
dracut-044-78.fc25.s390x
python2-pygpgme-0.3-18.fc25.s390x
libsoup-2.56.0-2.fc25.s390x
orc-0.4.26-1.fc25.s390x
yum-utils-1.1.31-511.fc25.noarch
libXrender-0.9.10-1.fc25.s390x
libXrandr-1.5.1-1.fc25.s390x
go-srpm-macros-2-7.fc25.noarch
gnupg2-smime-2.1.13-2.fc25.s390x
guile-devel-2.0.13-1.fc25.s390x
uboot-tools-2016.09.01-2.fc25.s390x
pykickstart-2.32-1.fc25.noarch
python-bunch-1.0.1-9.fc25.noarch
perl-generators-1.10-1.fc25.noarch
perl-Mozilla-CA-20160104-3.fc25.noarch
glibc-all-langpacks-2.24-4.fc25.s390x
bzip2-libs-1.0.6-21.fc25.s390x
libpng-1.6.27-1.fc25.s390x
libtiff-4.0.7-1.fc25.s390x
desktop-file-utils-0.23-2.fc25.s390x
python2-cccolutils-1.4-1.fc25.s390x
libcurl-7.51.0-4.fc25.s390x
rpm-plugin-systemd-inhibit-4.13.0-6.fc25.s390x
cups-libs-2.2.0-5.fc25.s390x
python2-lxml-3.7.2-1.fc25.s390x
redhat-rpm-config-45-1.fc25.noarch
elfutils-libs-0.168-1.fc25.s390x
device-mapper-event-libs-1.02.136-3.fc25.s390x
lvm2-libs-2.02.167-3.fc25.s390x
elfutils-0.168-1.fc25.s390x
openssh-7.4p1-1.fc25.s390x
python2-gitdb-2.0.0-1.fc25.noarch
openssh-server-7.4p1-1.fc25.s390x
gcc-gfortran-6.3.1-1.fc25.s390x
rpm-devel-4.13.0-6.fc25.s390x
libselinux-python-2.5-13.fc25.s390x
openjpeg2-2.1.2-3.fc25.s390x
js-jquery-2.2.4-1.fc25.noarch
boost-thread-1.60.0-10.fc25.s390x
json-c-0.12-7.fc24.s390x
ghostscript-x11-9.20-5.fc25.s390x
libdrm-devel-2.4.74-1.fc25.s390x
libuuid-devel-2.28.2-1.fc25.s390x
librbd-devel-10.2.4-2.fc25.s390x
libXcursor-devel-1.1.14-6.fc24.s390x
python3-beautifulsoup4-4.5.3-1.fc25.noarch
texlive-kpathsea-svn41139-30.fc25.noarch
texlive-amsmath-svn41561-30.fc25.noarch
texlive-thumbpdf-svn34621.3.16-30.fc25.noarch
texlive-multido-svn18302.1.42-30.fc25.noarch
texlive-float-svn15878.1.3d-30.fc25.noarch
texlive-psnfss-svn33946.9.2a-30.fc25.noarch
texlive-wasy-svn35831.0-30.fc25.noarch
texlive-makeindex-svn40768-30.fc25.noarch
texlive-pdftex-svn41149-30.fc25.noarch
texlive-enumitem-svn24146.3.5.2-30.fc25.noarch
texlive-microtype-svn41127-30.fc25.noarch
texlive-helvetic-svn31835.0-30.fc25.noarch
texlive-times-svn35058.0-30.fc25.noarch
texlive-mdwtools-svn15878.1.05.4-30.fc25.noarch
texlive-babel-english-svn30264.3.3p-30.fc25.noarch
texlive-cmextra-svn32831.0-30.fc25.noarch
texlive-enctex-svn34957.0-30.fc25.noarch
texlive-texlive-docindex-svn41430-30.fc25.noarch
texlive-ifetex-svn24853.1.2-30.fc25.noarch
texlive-mparhack-svn15878.1.4-30.fc25.noarch
texlive-paralist-svn39247-30.fc25.noarch
texlive-algorithms-svn38085.0.1-30.fc25.noarch
texlive-geometry-svn19716.5.6-30.fc25.noarch
texlive-fontspec-svn41262-30.fc25.noarch
texlive-oberdiek-svn41346-30.fc25.noarch
texlive-pst-eps-svn15878.1.0-30.fc25.noarch
texlive-pstricks-svn41321-30.fc25.noarch
texlive-pst-blur-svn15878.2.0-30.fc25.noarch
texlive-jknapltx-svn19440.0-30.fc25.noarch
texlive-breqn-svn38099.0.98d-30.fc25.noarch
texlive-collection-basic-svn41149-30.20160520.fc25.noarch
latex2html-2012-7.fc24.noarch
lksctp-tools-1.0.16-5.fc24.s390x
vte291-0.46.1-1.fc25.s390x
openssl-devel-1.0.2j-3.fc25.s390x
at-spi2-core-devel-2.22.0-1.fc25.s390x
libfdt-1.4.2-1.fc25.s390x
libXft-devel-2.3.2-4.fc24.s390x
libattr-devel-2.4.47-16.fc24.s390x
libiscsi-devel-1.15.0-2.fc24.s390x
gettext-0.19.8.1-3.fc25.s390x
libjpeg-turbo-devel-1.5.1-0.fc25.s390x
glusterfs-libs-3.9.1-1.fc25.s390x
glusterfs-api-3.9.1-1.fc25.s390x
hawkey-0.6.3-6.1.fc25.s390x
nss-softokn-devel-3.28.1-1.0.fc25.s390x
glusterfs-cli-3.9.1-1.fc25.s390x
vim-common-8.0.206-1.fc25.s390x
libX11-1.6.4-4.fc25.s390x
pulseaudio-libs-devel-10.0-2.fc25.s390x
dnf-yum-1.1.10-5.fc25.noarch
tzdata-java-2016j-2.fc25.noarch
ccache-3.3.3-1.fc25.s390x
gpg-pubkey-8e1431d5-53bcbac7
zlib-1.2.8-10.fc24.s390x
sed-4.2.2-15.fc24.s390x
p11-kit-0.23.2-2.fc24.s390x
psmisc-22.21-8.fc24.s390x
gpm-libs-1.20.7-9.fc24.s390x
zip-3.0-16.fc24.s390x
hostname-3.15-7.fc24.s390x
libyubikey-1.13-2.fc24.s390x
sg3_utils-libs-1.41-3.fc24.s390x
polkit-pkla-compat-0.1-7.fc24.s390x
passwd-0.79-8.fc24.s390x
trousers-0.3.13-6.fc24.s390x
grubby-8.40-3.fc24.s390x
rootfiles-8.1-19.fc24.noarch
python-rpm-macros-3-10.fc25.noarch
info-6.1-3.fc25.s390x
libuuid-2.28.2-1.fc25.s390x
iptables-libs-1.6.0-2.fc25.s390x
nettle-3.3-1.fc25.s390x
jansson-2.9-1.fc25.s390x
libksba-1.3.5-1.fc25.s390x
perl-Text-ParseWords-3.30-365.fc25.noarch
perl-PathTools-3.63-366.fc25.s390x
perl-File-Temp-0.23.04-365.fc25.noarch
fuse-libs-2.9.7-1.fc25.s390x
perl-Pod-Escapes-1.07-365.fc25.noarch
perl-Term-ANSIColor-4.05-2.fc25.noarch
perl-URI-1.71-5.fc25.noarch
libXfont-1.5.2-1.fc25.s390x
crypto-policies-20160921-2.git75b9b04.fc25.noarch
python-six-1.10.0-3.fc25.noarch
dbus-glib-0.108-1.fc25.s390x
gobject-introspection-1.50.0-1.fc25.s390x
libpwquality-1.3.0-6.fc25.s390x
python-gobject-base-3.22.0-1.fc25.s390x
python-html5lib-0.999-9.fc25.noarch
python3-dbus-1.2.4-2.fc25.s390x
python3-chardet-2.3.0-1.fc25.noarch
python3-urllib3-1.15.1-3.fc25.noarch
python-offtrac-0.1.0-7.fc25.noarch
python2-cryptography-1.5.3-3.fc25.s390x
python2-requests-kerberos-0.10.0-2.fc25.noarch
libserf-1.3.9-1.fc25.s390x
libdatrie-0.2.9-3.fc25.s390x
s390utils-base-1.36.0-1.fc25.s390x
kpartx-0.4.9-83.fc25.s390x
s390utils-cpuplugd-1.36.0-1.fc25.s390x
rpmconf-1.0.18-2.fc25.noarch
s390utils-osasnmpd-1.36.0-1.fc25.s390x
python-dnf-plugins-extras-common-0.0.12-4.fc25.noarch
pango-1.40.3-1.fc25.s390x
fpc-srpm-macros-1.0-1.fc25.noarch
kernel-core-4.8.8-300.fc25.s390x
fedora-upgrade-25.2-1.fc25.noarch
net-tools-2.0-0.38.20160329git.fc25.s390x
libuser-0.62-4.fc25.s390x
screen-4.4.0-4.fc25.s390x
man-db-2.7.5-3.fc25.s390x
sqlite-3.14.2-1.fc25.s390x
python-systemd-doc-232-1.fc25.s390x
pcre-8.40-1.fc25.s390x
libdb-5.3.28-16.fc25.s390x
lz4-1.7.5-1.fc25.s390x
tar-1.29-3.fc25.s390x
emacs-common-25.1-3.fc25.s390x
perl-threads-shared-1.54-1.fc25.s390x
unzip-6.0-31.fc25.s390x
mesa-libglapi-13.0.3-1.fc25.s390x
rpm-libs-4.13.0-6.fc25.s390x
selinux-policy-3.13.1-225.6.fc25.noarch
pcre-utf16-8.40-1.fc25.s390x
bodhi-client-0.9.12.2-6.fc25.noarch
rpmlint-1.9-5.fc25.noarch
glibc-headers-2.24-4.fc25.s390x
dbus-1.11.8-1.fc25.s390x
kernel-core-4.9.3-200.fc25.s390x
cairo-1.14.8-1.fc25.s390x
ca-certificates-2017.2.11-1.0.fc25.noarch
openssh-clients-7.4p1-1.fc25.s390x
python2-GitPython-2.1.1-2.fc25.noarch
mariadb-libs-10.1.20-1.fc25.s390x
NetworkManager-glib-1.4.4-3.fc25.s390x
gcc-go-6.3.1-1.fc25.s390x
cracklib-dicts-2.9.6-4.fc25.s390x
iproute-tc-4.6.0-6.fc25.s390x
libselinux-python3-2.5-13.fc25.s390x
strace-4.15-1.fc25.s390x
python2-enchant-1.6.8-1.fc25.noarch
boost-iostreams-1.60.0-10.fc25.s390x
bluez-libs-5.43-1.fc25.s390x
ghostscript-9.20-5.fc25.s390x
userspace-rcu-0.9.2-2.fc25.s390x
mesa-libwayland-egl-devel-13.0.3-1.fc25.s390x
libXext-devel-1.3.3-4.fc24.s390x
libXrandr-devel-1.5.1-1.fc25.s390x
perl-XML-XPath-1.39-1.fc25.noarch
python3-lxml-3.7.2-1.fc25.s390x
texlive-texlive.infra-bin-svn40312-30.20160520.fc25.s390x
texlive-ifxetex-svn19685.0.5-30.fc25.noarch
texlive-thumbpdf-bin-svn6898.0-30.20160520.fc25.noarch
texlive-babelbib-svn25245.1.31-30.fc25.noarch
texlive-index-svn24099.4.1beta-30.fc25.noarch
texlive-caption-svn41409-30.fc25.noarch
texlive-bibtex-bin-svn40473-30.20160520.fc25.s390x
texlive-mfware-bin-svn40473-30.20160520.fc25.s390x
texlive-texconfig-svn40768-30.fc25.noarch
texlive-footmisc-svn23330.5.5b-30.fc25.noarch
texlive-psfrag-svn15878.3.04-30.fc25.noarch
texlive-eurosym-svn17265.1.4_subrfix-30.fc25.noarch
texlive-symbol-svn31835.0-30.fc25.noarch
texlive-euenc-svn19795.0.1h-30.fc25.noarch
texlive-textcase-svn15878.0-30.fc25.noarch
texlive-charter-svn15878.0-30.fc25.noarch
texlive-wasysym-svn15878.2.0-30.fc25.noarch
texlive-mflogo-svn38628-30.fc25.noarch
texlive-soul-svn15878.2.4-30.fc25.noarch
texlive-marginnote-svn41382-30.fc25.noarch
texlive-filecontents-svn24250.1.3-30.fc25.noarch
texlive-tipa-svn29349.1.3-30.fc25.noarch
texlive-xcolor-svn41044-30.fc25.noarch
texlive-breakurl-svn29901.1.40-30.fc25.noarch
texlive-attachfile-svn38830-30.fc25.noarch
texlive-pst-coil-svn37377.1.07-30.fc25.noarch
texlive-auto-pst-pdf-svn23723.0.6-30.fc25.noarch
texlive-ctable-svn38672-30.fc25.noarch
texlive-extsizes-svn17263.1.4a-30.fc25.noarch
texlive-beamer-svn36461.3.36-30.fc25.noarch
texlive-dvipdfmx-bin-svn40273-30.20160520.fc25.s390x
netpbm-progs-10.76.00-2.fc25.s390x
vte-profile-0.46.1-1.fc25.s390x
krb5-devel-1.14.4-4.fc25.s390x
dbus-devel-1.11.8-1.fc25.s390x
sqlite-devel-3.14.2-1.fc25.s390x
libiscsi-1.15.0-2.fc24.s390x
fontconfig-devel-2.12.1-1.fc25.s390x
libfdt-devel-1.4.2-1.fc25.s390x
ceph-devel-compat-10.2.4-2.fc25.s390x
zlib-static-1.2.8-10.fc24.s390x
chrpath-0.16-3.fc24.s390x
python-2.7.13-1.fc25.s390x
nss-3.28.1-1.3.fc25.s390x
python2-hawkey-0.6.3-6.1.fc25.s390x
gdk-pixbuf2-modules-2.36.4-1.fc25.s390x
perl-Git-2.9.3-2.fc25.noarch
kernel-core-4.9.5-200.fc25.s390x
publicsuffix-list-dafsa-20170116-1.fc25.noarch
perl-SelfLoader-1.23-382.fc25.noarch
perl-open-1.10-382.fc25.noarch
gpgme-1.8.0-8.fc25.s390x
=== TEST BEGIN ===
Using CC: /home/fam/bin/cc
Install prefix /var/tmp/patchew-tester-tmp-x3pbd_36/src/install
BIOS directory /var/tmp/patchew-tester-tmp-x3pbd_36/src/install/share/qemu
binary directory /var/tmp/patchew-tester-tmp-x3pbd_36/src/install/bin
library directory /var/tmp/patchew-tester-tmp-x3pbd_36/src/install/lib
module directory /var/tmp/patchew-tester-tmp-x3pbd_36/src/install/lib/qemu
libexec directory /var/tmp/patchew-tester-tmp-x3pbd_36/src/install/libexec
include directory /var/tmp/patchew-tester-tmp-x3pbd_36/src/install/include
config directory /var/tmp/patchew-tester-tmp-x3pbd_36/src/install/etc
local state directory /var/tmp/patchew-tester-tmp-x3pbd_36/src/install/var
Manual directory /var/tmp/patchew-tester-tmp-x3pbd_36/src/install/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path /var/tmp/patchew-tester-tmp-x3pbd_36/src
C compiler /home/fam/bin/cc
Host C compiler cc
C++ compiler c++
Objective-C compiler /home/fam/bin/cc
ARFLAGS rv
CFLAGS -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g
QEMU_CFLAGS -I/usr/include/pixman-1 -Werror -DHAS_LIBSSH2_SFTP_FSYNC -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -D_GNU_SOURCE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/cacard -I/usr/include/nss3 -I/usr/include/nspr4 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libusb-1.0
LDFLAGS -Wl,--warn-common -m64 -g
make make
install install
python python -B
smbd /usr/sbin/smbd
module support no
host CPU s390x
host big endian yes
target list aarch64-softmmu alpha-softmmu arm-softmmu cris-softmmu i386-softmmu lm32-softmmu m68k-softmmu microblazeel-softmmu microblaze-softmmu mips64el-softmmu mips64-softmmu mipsel-softmmu mips-softmmu moxie-softmmu nios2-softmmu or1k-softmmu ppc64-softmmu ppcemb-softmmu ppc-softmmu s390x-softmmu sh4eb-softmmu sh4-softmmu sparc64-softmmu sparc-softmmu tricore-softmmu unicore32-softmmu x86_64-softmmu xtensaeb-softmmu xtensa-softmmu aarch64-linux-user alpha-linux-user armeb-linux-user arm-linux-user cris-linux-user hppa-linux-user i386-linux-user m68k-linux-user microblazeel-linux-user microblaze-linux-user mips64el-linux-user mips64-linux-user mipsel-linux-user mips-linux-user mipsn32el-linux-user mipsn32-linux-user nios2-linux-user or1k-linux-user ppc64abi32-linux-user ppc64le-linux-user ppc64-linux-user ppc-linux-user s390x-linux-user sh4eb-linux-user sh4-linux-user sparc32plus-linux-user sparc64-linux-user sparc-linux-user tilegx-linux-user x86_64-linux-user
tcg debug enabled no
gprof enabled no
sparse enabled no
strip binaries yes
profiler no
static build no
pixman system
SDL support yes (2.0.5)
GTK support yes (3.22.7)
GTK GL support yes
VTE support yes (0.46.1)
TLS priority NORMAL
GNUTLS support yes
GNUTLS rnd yes
libgcrypt no
libgcrypt kdf no
nettle yes (3.3)
nettle kdf yes
libtasn1 yes
curses support yes
virgl support yes
curl support yes
mingw32 support no
Audio drivers oss
Block whitelist (rw)
Block whitelist (ro)
VirtFS support yes
VNC support yes
VNC SASL support yes
VNC JPEG support yes
VNC PNG support yes
xen support no
brlapi support yes
bluez support yes
Documentation yes
PIE no
vde support no
netmap support no
Linux AIO support yes
ATTR/XATTR support yes
Install blobs yes
KVM support yes
HAX support no
RDMA support no
TCG interpreter no
fdt support yes
preadv support yes
fdatasync yes
madvise yes
posix_madvise yes
libcap-ng support yes
vhost-net support yes
vhost-scsi support yes
vhost-vsock support yes
Trace backends log
spice support no
rbd support yes
xfsctl support no
smartcard support yes
libusb yes
usb net redir yes
OpenGL support yes
OpenGL dmabufs yes
libiscsi support yes
libnfs support yes
build guest agent yes
QGA VSS support no
QGA w32 disk info no
QGA MSI support no
seccomp support no
coroutine backend ucontext
coroutine pool yes
debug stack usage no
GlusterFS support yes
gcov gcov
gcov enabled no
TPM support yes
libssh2 support yes
TPM passthrough no
QOM debugging yes
lzo support yes
snappy support yes
bzip2 support yes
NUMA host support no
tcmalloc support no
jemalloc support no
avx2 optimization no
replication support yes
GEN aarch64-softmmu/config-devices.mak.tmp
GEN alpha-softmmu/config-devices.mak.tmp
GEN cris-softmmu/config-devices.mak.tmp
GEN arm-softmmu/config-devices.mak.tmp
GEN cris-softmmu/config-devices.mak
GEN alpha-softmmu/config-devices.mak
GEN arm-softmmu/config-devices.mak
GEN aarch64-softmmu/config-devices.mak
GEN i386-softmmu/config-devices.mak.tmp
GEN microblazeel-softmmu/config-devices.mak.tmp
GEN m68k-softmmu/config-devices.mak.tmp
GEN lm32-softmmu/config-devices.mak.tmp
GEN m68k-softmmu/config-devices.mak
GEN microblaze-softmmu/config-devices.mak.tmp
GEN microblazeel-softmmu/config-devices.mak
GEN lm32-softmmu/config-devices.mak
GEN mips64el-softmmu/config-devices.mak.tmp
GEN mips64-softmmu/config-devices.mak.tmp
GEN microblaze-softmmu/config-devices.mak
GEN mipsel-softmmu/config-devices.mak.tmp
GEN i386-softmmu/config-devices.mak
GEN mips-softmmu/config-devices.mak.tmp
GEN mipsel-softmmu/config-devices.mak
GEN moxie-softmmu/config-devices.mak.tmp
GEN mips64el-softmmu/config-devices.mak
GEN mips-softmmu/config-devices.mak
GEN mips64-softmmu/config-devices.mak
GEN nios2-softmmu/config-devices.mak.tmp
GEN or1k-softmmu/config-devices.mak.tmp
GEN ppc64-softmmu/config-devices.mak.tmp
GEN moxie-softmmu/config-devices.mak
GEN ppcemb-softmmu/config-devices.mak.tmp
GEN nios2-softmmu/config-devices.mak
GEN or1k-softmmu/config-devices.mak
GEN ppc-softmmu/config-devices.mak.tmp
GEN s390x-softmmu/config-devices.mak.tmp
GEN s390x-softmmu/config-devices.mak
GEN ppcemb-softmmu/config-devices.mak
GEN sh4eb-softmmu/config-devices.mak.tmp
GEN ppc64-softmmu/config-devices.mak
GEN sh4-softmmu/config-devices.mak.tmp
GEN ppc-softmmu/config-devices.mak
GEN sparc64-softmmu/config-devices.mak.tmp
GEN sparc-softmmu/config-devices.mak.tmp
GEN sh4-softmmu/config-devices.mak
GEN sh4eb-softmmu/config-devices.mak
GEN tricore-softmmu/config-devices.mak.tmp
GEN sparc-softmmu/config-devices.mak
GEN tricore-softmmu/config-devices.mak
GEN unicore32-softmmu/config-devices.mak.tmp
GEN sparc64-softmmu/config-devices.mak
GEN x86_64-softmmu/config-devices.mak.tmp
GEN xtensaeb-softmmu/config-devices.mak.tmp
GEN xtensa-softmmu/config-devices.mak.tmp
GEN unicore32-softmmu/config-devices.mak
GEN xtensa-softmmu/config-devices.mak
GEN xtensaeb-softmmu/config-devices.mak
GEN aarch64-linux-user/config-devices.mak.tmp
GEN alpha-linux-user/config-devices.mak.tmp
GEN x86_64-softmmu/config-devices.mak
GEN armeb-linux-user/config-devices.mak.tmp
GEN arm-linux-user/config-devices.mak.tmp
GEN aarch64-linux-user/config-devices.mak
GEN cris-linux-user/config-devices.mak.tmp
GEN alpha-linux-user/config-devices.mak
GEN armeb-linux-user/config-devices.mak
GEN arm-linux-user/config-devices.mak
GEN i386-linux-user/config-devices.mak.tmp
GEN m68k-linux-user/config-devices.mak.tmp
GEN hppa-linux-user/config-devices.mak.tmp
GEN i386-linux-user/config-devices.mak
GEN cris-linux-user/config-devices.mak
GEN microblazeel-linux-user/config-devices.mak.tmp
GEN microblaze-linux-user/config-devices.mak.tmp
GEN m68k-linux-user/config-devices.mak
GEN hppa-linux-user/config-devices.mak
GEN mips64el-linux-user/config-devices.mak.tmp
GEN mips64-linux-user/config-devices.mak.tmp
GEN microblaze-linux-user/config-devices.mak
GEN microblazeel-linux-user/config-devices.mak
GEN mips-linux-user/config-devices.mak.tmp
GEN mipsel-linux-user/config-devices.mak.tmp
GEN mips64-linux-user/config-devices.mak
GEN mips64el-linux-user/config-devices.mak
GEN mipsn32el-linux-user/config-devices.mak.tmp
GEN mipsn32-linux-user/config-devices.mak.tmp
GEN mipsel-linux-user/config-devices.mak
GEN mips-linux-user/config-devices.mak
GEN nios2-linux-user/config-devices.mak.tmp
GEN mipsn32el-linux-user/config-devices.mak
GEN or1k-linux-user/config-devices.mak.tmp
GEN mipsn32-linux-user/config-devices.mak
GEN ppc64abi32-linux-user/config-devices.mak.tmp
GEN ppc64le-linux-user/config-devices.mak.tmp
GEN nios2-linux-user/config-devices.mak
GEN or1k-linux-user/config-devices.mak
GEN ppc64-linux-user/config-devices.mak.tmp
GEN ppc-linux-user/config-devices.mak.tmp
GEN ppc64le-linux-user/config-devices.mak
GEN ppc64abi32-linux-user/config-devices.mak
GEN s390x-linux-user/config-devices.mak.tmp
GEN sh4eb-linux-user/config-devices.mak.tmp
GEN ppc-linux-user/config-devices.mak
GEN ppc64-linux-user/config-devices.mak
GEN sh4-linux-user/config-devices.mak.tmp
GEN s390x-linux-user/config-devices.mak
GEN sparc64-linux-user/config-devices.mak.tmp
GEN sh4eb-linux-user/config-devices.mak
GEN sparc32plus-linux-user/config-devices.mak.tmp
GEN sh4-linux-user/config-devices.mak
GEN sparc-linux-user/config-devices.mak.tmp
GEN tilegx-linux-user/config-devices.mak.tmp
GEN sparc32plus-linux-user/config-devices.mak
GEN sparc-linux-user/config-devices.mak
GEN tilegx-linux-user/config-devices.mak
GEN sparc64-linux-user/config-devices.mak
GEN config-host.h
GEN x86_64-linux-user/config-devices.mak.tmp
GEN qemu-options.def
GEN x86_64-linux-user/config-devices.mak
GEN qmp-commands.h
GEN qapi-types.h
GEN qapi-visit.h
GEN qapi-event.h
GEN qmp-marshal.c
GEN qapi-types.c
GEN qapi-visit.c
GEN qapi-event.c
GEN qmp-introspect.h
GEN qmp-introspect.c
GEN trace/generated-tcg-tracers.h
GEN trace/generated-helpers-wrappers.h
GEN trace/generated-helpers.h
GEN trace/generated-helpers.c
GEN tests/test-qapi-types.h
GEN module_block.h
GEN tests/test-qmp-commands.h
GEN tests/test-qapi-visit.h
GEN tests/test-qapi-event.h
GEN tests/test-qmp-introspect.h
GEN trace-root.h
GEN util/trace.h
GEN crypto/trace.h
GEN io/trace.h
GEN migration/trace.h
GEN block/trace.h
GEN hw/block/trace.h
GEN backends/trace.h
GEN hw/block/dataplane/trace.h
GEN hw/char/trace.h
GEN hw/intc/trace.h
GEN hw/net/trace.h
GEN hw/virtio/trace.h
GEN hw/audio/trace.h
GEN hw/misc/trace.h
GEN hw/usb/trace.h
GEN hw/scsi/trace.h
GEN hw/nvram/trace.h
GEN hw/display/trace.h
GEN hw/input/trace.h
GEN hw/timer/trace.h
GEN hw/sparc/trace.h
GEN hw/dma/trace.h
GEN hw/sd/trace.h
GEN hw/isa/trace.h
GEN hw/mem/trace.h
GEN hw/i386/trace.h
GEN hw/i386/xen/trace.h
GEN hw/9pfs/trace.h
GEN hw/ppc/trace.h
GEN hw/pci/trace.h
GEN hw/s390x/trace.h
GEN hw/vfio/trace.h
GEN hw/acpi/trace.h
GEN hw/arm/trace.h
GEN hw/alpha/trace.h
GEN hw/xen/trace.h
GEN audio/trace.h
GEN ui/trace.h
GEN net/trace.h
GEN target/arm/trace.h
GEN target/i386/trace.h
GEN target/mips/trace.h
GEN target/sparc/trace.h
GEN target/s390x/trace.h
GEN target/ppc/trace.h
GEN qom/trace.h
GEN linux-user/trace.h
GEN qapi/trace.h
GEN trace-root.c
GEN util/trace.c
GEN io/trace.c
GEN crypto/trace.c
GEN migration/trace.c
GEN block/trace.c
GEN backends/trace.c
GEN hw/block/trace.c
GEN hw/block/dataplane/trace.c
GEN hw/char/trace.c
GEN hw/intc/trace.c
GEN hw/net/trace.c
GEN hw/virtio/trace.c
GEN hw/audio/trace.c
GEN hw/usb/trace.c
GEN hw/misc/trace.c
GEN hw/scsi/trace.c
GEN hw/nvram/trace.c
GEN hw/display/trace.c
GEN hw/input/trace.c
GEN hw/timer/trace.c
GEN hw/dma/trace.c
GEN hw/sparc/trace.c
GEN hw/sd/trace.c
GEN hw/mem/trace.c
GEN hw/isa/trace.c
GEN hw/i386/trace.c
GEN hw/i386/xen/trace.c
GEN hw/ppc/trace.c
GEN hw/9pfs/trace.c
GEN hw/pci/trace.c
GEN hw/s390x/trace.c
GEN hw/vfio/trace.c
GEN hw/acpi/trace.c
GEN hw/arm/trace.c
GEN hw/alpha/trace.c
GEN hw/xen/trace.c
GEN audio/trace.c
GEN ui/trace.c
GEN net/trace.c
GEN target/i386/trace.c
GEN target/arm/trace.c
GEN target/mips/trace.c
GEN target/s390x/trace.c
GEN target/sparc/trace.c
GEN target/ppc/trace.c
GEN qom/trace.c
GEN linux-user/trace.c
GEN qapi/trace.c
GEN config-all-devices.mak
CC tests/qemu-iotests/socket_scm_helper.o
GEN qemu-options.texi
GEN qemu-monitor.texi
GEN qemu-img-cmds.texi
GEN qemu-monitor-info.texi
GEN qemu-img.1
GEN qemu-nbd.8
GEN qemu-ga.8
GEN docs/version.texi
GEN docs/qemu-qmp-qapi.texi
GEN docs/qemu-ga-qapi.texi
GEN fsdev/virtfs-proxy-helper.1
GEN qga/qapi-generated/qga-qapi-types.h
GEN qga/qapi-generated/qga-qapi-visit.h
GEN qga/qapi-generated/qga-qmp-commands.h
GEN qga/qapi-generated/qga-qapi-types.c
GEN qga/qapi-generated/qga-qapi-visit.c
GEN qga/qapi-generated/qga-qmp-marshal.c
CC trace-root.o
CC util/trace.o
CC crypto/trace.o
CC io/trace.o
CC migration/trace.o
CC block/trace.o
CC backends/trace.o
CC hw/block/trace.o
CC hw/block/dataplane/trace.o
CC hw/char/trace.o
CC hw/intc/trace.o
CC hw/net/trace.o
CC hw/virtio/trace.o
CC hw/audio/trace.o
CC hw/misc/trace.o
CC hw/usb/trace.o
CC hw/scsi/trace.o
CC hw/nvram/trace.o
CC hw/display/trace.o
CC hw/input/trace.o
CC hw/timer/trace.o
CC hw/dma/trace.o
CC hw/sparc/trace.o
CC hw/sd/trace.o
CC hw/isa/trace.o
CC hw/mem/trace.o
CC hw/i386/trace.o
CC hw/i386/xen/trace.o
CC hw/9pfs/trace.o
CC hw/ppc/trace.o
CC hw/pci/trace.o
CC hw/s390x/trace.o
CC hw/vfio/trace.o
CC hw/acpi/trace.o
CC hw/arm/trace.o
CC hw/alpha/trace.o
CC hw/xen/trace.o
CC ui/trace.o
CC audio/trace.o
CC net/trace.o
CC target/arm/trace.o
CC target/mips/trace.o
CC target/i386/trace.o
CC target/sparc/trace.o
CC target/s390x/trace.o
CC target/ppc/trace.o
CC qom/trace.o
CC qapi/trace.o
CC linux-user/trace.o
CC qmp-introspect.o
CC qapi-types.o
CC qapi-visit.o
CC qapi-event.o
CC qapi/qapi-visit-core.o
CC qapi/qapi-dealloc-visitor.o
CC qapi/qobject-input-visitor.o
CC qapi/qobject-output-visitor.o
CC qapi/qmp-registry.o
CC qapi/qmp-dispatch.o
CC qapi/string-input-visitor.o
CC qapi/string-output-visitor.o
CC qapi/opts-visitor.o
CC qapi/qapi-clone-visitor.o
CC qapi/qmp-event.o
CC qapi/qapi-util.o
CC qobject/qnull.o
CC qobject/qint.o
CC qobject/qstring.o
CC qobject/qdict.o
CC qobject/qlist.o
CC qobject/qfloat.o
CC qobject/qbool.o
CC qobject/qjson.o
CC qobject/qobject.o
CC qobject/json-streamer.o
CC qobject/json-lexer.o
CC qobject/json-parser.o
CC trace/control.o
CC trace/qmp.o
CC util/osdep.o
CC util/cutils.o
CC util/unicode.o
CC util/qemu-timer-common.o
CC util/bufferiszero.o
CC util/lockcnt.o
CC util/aiocb.o
CC util/async.o
CC util/thread-pool.o
CC util/qemu-timer.o
CC util/iohandler.o
CC util/main-loop.o
CC util/aio-posix.o
CC util/compatfd.o
CC util/event_notifier-posix.o
CC util/mmap-alloc.o
CC util/oslib-posix.o
CC util/qemu-openpty.o
CC util/qemu-thread-posix.o
CC util/memfd.o
CC util/envlist.o
CC util/path.o
CC util/module.o
CC util/host-utils.o
CC util/bitops.o
CC util/bitmap.o
CC util/hbitmap.o
CC util/fifo8.o
CC util/acl.o
CC util/error.o
CC util/qemu-error.o
CC util/id.o
CC util/iov.o
CC util/qemu-config.o
CC util/qemu-sockets.o
CC util/uri.o
CC util/notify.o
CC util/qemu-option.o
CC util/qemu-progress.o
CC util/keyval.o
CC util/hexdump.o
CC util/crc32c.o
CC util/uuid.o
CC util/throttle.o
CC util/getauxval.o
CC util/rcu.o
CC util/readline.o
CC util/qemu-coroutine.o
CC util/qemu-coroutine-lock.o
CC util/qemu-coroutine-io.o
CC util/qemu-coroutine-sleep.o
CC util/coroutine-ucontext.o
CC util/buffer.o
CC util/timed-average.o
CC util/base64.o
CC util/log.o
CC util/qdist.o
CC util/qht.o
CC util/range.o
CC util/systemd.o
CC crypto/pbkdf-stub.o
CC stubs/arch-query-cpu-def.o
CC stubs/arch-query-cpu-model-expansion.o
CC stubs/arch-query-cpu-model-comparison.o
CC stubs/arch-query-cpu-model-baseline.o
CC stubs/bdrv-next-monitor-owned.o
CC stubs/blk-commit-all.o
CC stubs/blockdev-close-all-bdrv-states.o
CC stubs/clock-warp.o
CC stubs/cpu-get-clock.o
CC stubs/cpu-get-icount.o
CC stubs/dump.o
CC stubs/error-printf.o
CC stubs/fdset.o
CC stubs/gdbstub.o
CC stubs/get-vm-name.o
CC stubs/iothread.o
CC stubs/iothread-lock.o
CC stubs/is-daemonized.o
CC stubs/linux-aio.o
CC stubs/machine-init-done.o
CC stubs/migr-blocker.o
CC stubs/monitor.o
CC stubs/notify-event.o
CC stubs/qtest.o
CC stubs/replay.o
CC stubs/runstate-check.o
CC stubs/set-fd-handler.o
CC stubs/slirp.o
CC stubs/sysbus.o
CC stubs/trace-control.o
CC stubs/uuid.o
CC stubs/vm-stop.o
CC stubs/vmstate.o
CC stubs/qmp_pc_dimm_device_list.o
CC stubs/target-monitor-defs.o
CC stubs/target-get-monitor-def.o
CC stubs/pc_madt_cpu_entry.o
CC stubs/vmgenid.o
CC contrib/ivshmem-client/ivshmem-client.o
CC contrib/ivshmem-client/main.o
CC contrib/ivshmem-server/ivshmem-server.o
CC contrib/ivshmem-server/main.o
CC qemu-nbd.o
CC block.o
CC blockjob.o
CC qemu-io-cmds.o
CC replication.o
CC block/raw-format.o
CC block/qcow.o
CC block/vdi.o
CC block/vmdk.o
/var/tmp/patchew-tester-tmp-x3pbd_36/src/block.c: In function ‘bdrv_open_inherit’:
/var/tmp/patchew-tester-tmp-x3pbd_36/src/block.c:2157:23: error: ‘bs_snapshot’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
BlockDriverState *bs_snapshot;
^~~~~~~~~~~
cc1: all warnings being treated as errors
/var/tmp/patchew-tester-tmp-x3pbd_36/src/rules.mak:69: recipe for target 'block.o' failed
make: *** [block.o] Error 1
make: *** Waiting for unfinished jobs....
=== OUTPUT END ===
Test command exited with code: 2
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic
2017-04-06 9:00 ` Kevin Wolf
@ 2017-04-06 12:52 ` Eric Blake
2017-04-06 13:22 ` Eric Blake
2017-04-06 13:27 ` Kevin Wolf
0 siblings, 2 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-06 12:52 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, armbru, Max Reitz, open list:Block layer core
[-- Attachment #1: Type: text/plain, Size: 1449 bytes --]
On 04/06/2017 04:00 AM, Kevin Wolf wrote:
> Am 05.04.2017 um 21:47 hat Eric Blake geschrieben:
>> Noticed while checking Coccinelle results. Naming a label 'out:'
>> when it is only used on error paths is weird; meanwhile we know
>> that snapshot_options is NULL on success and that QDECREF(NULL)
>> is safe. So merge the two exit paths into one.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>> block.c | 7 ++-----
>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/block.c b/block.c
>> index 9b87bf6..a13625f 100644
>> --- a/block.c
>> +++ b/block.c
>> @@ -2209,13 +2209,10 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs,
>> goto out;
>> }
>>
>> +out:
>> + QDECREF(snapshot_options);
>> g_free(tmp_filename);
>> return bs_snapshot;
>
> bs_snapshot is uninitialised or at least the wrong return value in error
> cases. (Hm... Shouldn't the compiler catch the uninitialised part?)
Odd, and I agree that I recall the compiler generally able to catch that
(maybe it's a matter of compiling with -g vs. -O2). I'm surprised the
autobuilder didn't flag it. (I think I missed it due to rebase churn on
my end). The obvious fix is to:
- BlockDriverState *bs_snapshot;
+ BlockDriverState *bs_snapshot = NULL;
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic
2017-04-06 12:52 ` Eric Blake
@ 2017-04-06 13:22 ` Eric Blake
2017-04-06 13:27 ` Kevin Wolf
1 sibling, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-06 13:22 UTC (permalink / raw)
To: Kevin Wolf; +Cc: Max Reitz, qemu-devel, open list:Block layer core, armbru
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
On 04/06/2017 07:52 AM, Eric Blake wrote:
>>> +out:
>>> + QDECREF(snapshot_options);
>>> g_free(tmp_filename);
>>> return bs_snapshot;
>>
>> bs_snapshot is uninitialised or at least the wrong return value in error
>> cases. (Hm... Shouldn't the compiler catch the uninitialised part?)
>
> Odd, and I agree that I recall the compiler generally able to catch that
> (maybe it's a matter of compiling with -g vs. -O2). I'm surprised the
> autobuilder didn't flag it.
And now the autobuilder finally replies. It is indeed a matter of
difference in CFLAGS on whether the compiler will catch it.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic
2017-04-06 12:52 ` Eric Blake
2017-04-06 13:22 ` Eric Blake
@ 2017-04-06 13:27 ` Kevin Wolf
2017-04-06 13:41 ` Eric Blake
1 sibling, 1 reply; 42+ messages in thread
From: Kevin Wolf @ 2017-04-06 13:27 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel, armbru, Max Reitz, open list:Block layer core
[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]
Am 06.04.2017 um 14:52 hat Eric Blake geschrieben:
> On 04/06/2017 04:00 AM, Kevin Wolf wrote:
> > Am 05.04.2017 um 21:47 hat Eric Blake geschrieben:
> >> Noticed while checking Coccinelle results. Naming a label 'out:'
> >> when it is only used on error paths is weird; meanwhile we know
> >> that snapshot_options is NULL on success and that QDECREF(NULL)
> >> is safe. So merge the two exit paths into one.
> >>
> >> Signed-off-by: Eric Blake <eblake@redhat.com>
> >> ---
> >> block.c | 7 ++-----
> >> 1 file changed, 2 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/block.c b/block.c
> >> index 9b87bf6..a13625f 100644
> >> --- a/block.c
> >> +++ b/block.c
> >> @@ -2209,13 +2209,10 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs,
> >> goto out;
> >> }
> >>
> >> +out:
> >> + QDECREF(snapshot_options);
> >> g_free(tmp_filename);
> >> return bs_snapshot;
> >
> > bs_snapshot is uninitialised or at least the wrong return value in error
> > cases. (Hm... Shouldn't the compiler catch the uninitialised part?)
>
> Odd, and I agree that I recall the compiler generally able to catch that
> (maybe it's a matter of compiling with -g vs. -O2). I'm surprised the
> autobuilder didn't flag it. (I think I missed it due to rebase churn on
> my end). The obvious fix is to:
>
> - BlockDriverState *bs_snapshot;
> + BlockDriverState *bs_snapshot = NULL;
That's just half of the fix. It doesn't fix the cases where bs_snapshot
is already set. We still want to return NULL on errors there.
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts
2017-04-06 7:36 ` Cornelia Huck
@ 2017-04-06 13:31 ` Eric Blake
0 siblings, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-06 13:31 UTC (permalink / raw)
To: Cornelia Huck; +Cc: qemu-devel, Alexander Graf, armbru, Richard Henderson
[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]
On 04/06/2017 02:36 AM, Cornelia Huck wrote:
> On Wed, 5 Apr 2017 14:47:31 -0500
> Eric Blake <eblake@redhat.com> wrote:
>
>> An upcoming Coccinelle cleanup script wanted to reformat the casts
>> present in this file - but on closer look, we don't need the casts
>> at all because C automatically converts void* to any other pointer.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>> target/s390x/cpu_models.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>
> Do you prefer to keep this in this series, or should we just go ahead
> and apply this via s390x?
I'm okay either way. It's trivial enough, and although I found it during
qapi cleanups, it is clearly independent enough that I don't mind
rebasing if you pick it up and apply first through a non-qapi tree.
>
> In any case,
>
> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
>
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic
2017-04-06 13:27 ` Kevin Wolf
@ 2017-04-06 13:41 ` Eric Blake
0 siblings, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-06 13:41 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, armbru, Max Reitz, open list:Block layer core
[-- Attachment #1: Type: text/plain, Size: 2192 bytes --]
On 04/06/2017 08:27 AM, Kevin Wolf wrote:
>>>> @@ -2209,13 +2209,10 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs,
More context:
> bs_snapshot = bdrv_open(NULL, NULL, snapshot_options, flags, errp);
> snapshot_options = NULL;
> if (!bs_snapshot) {
> ret = -EINVAL;
> goto out;
> }
Up to here, bs_snapshot is NULL if we return. What is the deal with
ret? Setting it to -EINVAL has no purpose, as we don't reference ret in
the out label.
>
> /* bdrv_append() consumes a strong reference to bs_snapshot (i.e. it will
> * call bdrv_unref() on it), so in order to be able to return one, we have
> * to increase bs_snapshot's refcount here */
> bdrv_ref(bs_snapshot);
> bdrv_append(bs_snapshot, bs, &local_err);
> if (local_err) {
> error_propagate(errp, local_err);
> ret = -EINVAL;
> goto out;
> }
Again, what's with setting ret? But you are right that this is a place
where bs_snapshot would be non-null when we want to return an error.
The goto out looks a bit funny with no further code (although it's okay
to leave it as a defensive measure for code added later, as that's what
bdrv_append() does).
>>>>
>>>> +out:
>>>> + QDECREF(snapshot_options);
>>>> g_free(tmp_filename);
>>>> return bs_snapshot;
>>>
>>> bs_snapshot is uninitialised or at least the wrong return value in error
>>> cases. (Hm... Shouldn't the compiler catch the uninitialised part?)
>>
>> Odd, and I agree that I recall the compiler generally able to catch that
>> (maybe it's a matter of compiling with -g vs. -O2). I'm surprised the
>> autobuilder didn't flag it. (I think I missed it due to rebase churn on
>> my end). The obvious fix is to:
>>
>> - BlockDriverState *bs_snapshot;
>> + BlockDriverState *bs_snapshot = NULL;
>
> That's just half of the fix. It doesn't fix the cases where bs_snapshot
> is already set. We still want to return NULL on errors there.
Thanks for calling it to my attention.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts Eric Blake
2017-04-05 19:57 ` Philippe Mathieu-Daudé
2017-04-06 7:36 ` Cornelia Huck
@ 2017-04-06 13:53 ` Cornelia Huck
2 siblings, 0 replies; 42+ messages in thread
From: Cornelia Huck @ 2017-04-06 13:53 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel, Alexander Graf, armbru, Richard Henderson
On Wed, 5 Apr 2017 14:47:31 -0500
Eric Blake <eblake@redhat.com> wrote:
> An upcoming Coccinelle cleanup script wanted to reformat the casts
> present in this file - but on closer look, we don't need the casts
> at all because C automatically converts void* to any other pointer.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> target/s390x/cpu_models.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index 1434d15..ce461cc 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -376,12 +376,12 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
>
> static void qdict_add_disabled_feat(const char *name, void *opaque)
> {
> - qdict_put((QDict *) opaque, name, qbool_from_bool(false));
> + qdict_put(opaque, name, qbool_from_bool(false));
> }
>
> static void qdict_add_enabled_feat(const char *name, void *opaque)
> {
> - qdict_put((QDict *) opaque, name, qbool_from_bool(true));
> + qdict_put(opaque, name, qbool_from_bool(true));
> }
>
> /* convert S390CPUDef into a static CpuModelInfo */
Thanks, applied to s390-next.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 05/13] qobject: Drop useless QObject casts
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 05/13] qobject: Drop " Eric Blake
@ 2017-04-07 9:04 ` Stefan Hajnoczi
0 siblings, 0 replies; 42+ messages in thread
From: Stefan Hajnoczi @ 2017-04-07 9:04 UTC (permalink / raw)
To: Eric Blake
Cc: qemu-devel, armbru, Kevin Wolf, Max Reitz, Stefan Weil,
Alberto Garcia, Michael Roth, open list:Block layer core
[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]
On Wed, Apr 05, 2017 at 02:47:33PM -0500, Eric Blake wrote:
> We have macros in place to make it less verbose to add a subtype
> of QObject to both QDict and QList. While we have made cleanups
> like this in the past (see commit fcfcd8ffc, for example), having
> it be automated by Coccinelle makes it easier to maintain.
>
> Patch created mechanically via:
> spatch --sp-file scripts/coccinelle/qobject.cocci \
> --macro-file scripts/cocci-macro-file.h --dir . --in-place
> then I verified that no manual touchups were required.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> block.c | 12 ++++--------
> block/blkdebug.c | 4 ++--
> block/blkverify.c | 7 +++----
> block/file-posix.c | 6 +++---
> block/file-win32.c | 4 ++--
> block/quorum.c | 16 ++++++----------
> tests/check-qdict.c | 20 ++++++++++----------
> tests/test-qmp-commands.c | 24 ++++++++++++------------
> 8 files changed, 42 insertions(+), 51 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 07/13] block: Use simpler QDict/QList scalar insertion macros
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 07/13] block: Use simpler QDict/QList scalar insertion macros Eric Blake
2017-04-05 19:51 ` Richard W.M. Jones
@ 2017-04-07 9:04 ` Stefan Hajnoczi
1 sibling, 0 replies; 42+ messages in thread
From: Stefan Hajnoczi @ 2017-04-07 9:04 UTC (permalink / raw)
To: Eric Blake
Cc: qemu-devel, armbru, Kevin Wolf, Max Reitz, Jeff Cody,
Stefan Weil, Ronnie Sahlberg, Paolo Bonzini, Peter Lieven,
Fam Zheng, Alberto Garcia, Josh Durgin, Richard W.M. Jones,
open list:blkdebug
[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]
On Wed, Apr 05, 2017 at 02:47:35PM -0500, Eric Blake wrote:
> 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 block --in-place
> then touched up manually to fix a couple of '?:' back to original spacing.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> block/blkdebug.c | 6 +++---
> block/blkverify.c | 6 +++---
> block/curl.c | 2 +-
> block/file-posix.c | 8 ++++----
> block/file-win32.c | 4 ++--
> block/iscsi.c | 2 +-
> block/nbd.c | 41 ++++++++++++++++++++---------------------
> block/nfs.c | 43 +++++++++++++++++--------------------------
> block/null.c | 2 +-
> block/qcow2.c | 4 ++--
> block/quorum.c | 8 ++++----
> block/rbd.c | 16 ++++++++--------
> block/ssh.c | 16 +++++++---------
> block/vvfat.c | 10 +++++-----
> 14 files changed, 78 insertions(+), 90 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 06/13] qobject: Add helper macros for common scalar insertions
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 06/13] qobject: Add helper macros for common scalar insertions Eric Blake
@ 2017-04-11 17:06 ` Markus Armbruster
2017-04-11 17:43 ` Eric Blake
0 siblings, 1 reply; 42+ messages in thread
From: Markus Armbruster @ 2017-04-11 17:06 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel
Eric Blake <eblake@redhat.com> writes:
> Rather than making lots of callers wrap a scalar in a QInt, QString,
> or QBool, provide helper macros that do the wrapping automatically.
>
> Update the Coccinelle script to make mass conversions easy, although
> the conversion itself will be done as a separate patches to ease
> review and backport efforts.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> include/qapi/qmp/qdict.h | 8 ++++++++
> include/qapi/qmp/qlist.h | 8 ++++++++
> scripts/coccinelle/qobject.cocci | 22 ++++++++++++++++++++++
> 3 files changed, 38 insertions(+)
>
> diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h
> index fe9a4c5..9d9f9a3 100644
> --- a/include/qapi/qmp/qdict.h
> +++ b/include/qapi/qmp/qdict.h
> @@ -52,6 +52,14 @@ void qdict_destroy_obj(QObject *obj);
> #define qdict_put(qdict, key, obj) \
> qdict_put_obj(qdict, key, QOBJECT(obj))
>
> +/* Helpers for int, bool, and const char*. */
"char *." looks awkward. What about
/* Helpers for int, bool, and const char * */
or
/* Helpers for int, bool, string */
or no comment?
> +#define qdict_put_int(qdict, key, value) \
> + qdict_put(qdict, key, qint_from_int(value))
> +#define qdict_put_bool(qdict, key, value) \
> + qdict_put(qdict, key, qbool_from_bool(value))
> +#define qdict_put_str(qdict, key, value) \
> + qdict_put(qdict, key, qstring_from_str(value))
> +
> /* High level helpers */
> double qdict_get_double(const QDict *qdict, const char *key);
> int64_t qdict_get_int(const QDict *qdict, const char *key);
> diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h
> index a84117e..659325a 100644
> --- a/include/qapi/qmp/qlist.h
> +++ b/include/qapi/qmp/qlist.h
> @@ -29,6 +29,14 @@ typedef struct QList {
> #define qlist_append(qlist, obj) \
> qlist_append_obj(qlist, QOBJECT(obj))
>
> +/* Helpers for int, bool, and const char*. */
Likewise.
> +#define qlist_append_int(qlist, value) \
> + qlist_append(qlist, qint_from_int(value))
> +#define qlist_append_bool(qlist, value) \
> + qlist_append(qlist, qbool_from_bool(value))
> +#define qlist_append_str(qlist, value) \
> + qlist_append(qlist, qstring_from_str(value))
> +
> #define QLIST_FOREACH_ENTRY(qlist, var) \
> for ((var) = ((qlist)->head.tqh_first); \
> (var); \
> diff --git a/scripts/coccinelle/qobject.cocci b/scripts/coccinelle/qobject.cocci
> index aa899e2..97703a4 100644
> --- a/scripts/coccinelle/qobject.cocci
> +++ b/scripts/coccinelle/qobject.cocci
> @@ -2,12 +2,34 @@
> @@
> expression Obj, Key, E;
> @@
> +(
> - qdict_put_obj(Obj, Key, QOBJECT(E));
> + qdict_put(Obj, Key, E);
> +|
> +- qdict_put(Obj, Key, qint_from_int(E));
> ++ qdict_put_int(Obj, Key, E);
> +|
> +- qdict_put(Obj, Key, qbool_from_bool(E));
> ++ qdict_put_bool(Obj, Key, E);
> +|
> +- qdict_put(Obj, Key, qstring_from_str(E));
> ++ qdict_put_str(Obj, Key, E);
> +)
>
> // Use QList macros where they make sense
> @@
> expression Obj, E;
> @@
> +(
> - qlist_append_obj(Obj, QOBJECT(E));
> + qlist_append(Obj, E);
> +|
> +- qlist_append(Obj, qint_from_int(E));
> ++ qlist_append_int(Obj, E);
> +|
> +- qlist_append(Obj, qbool_from_bool(E));
> ++ qlist_append_bool(Obj, E);
> +|
> +- qlist_append(Obj, qstring_from_str(E));
> ++ qlist_append_str(Obj, E);
> +)
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 09/13] qobject: Use simpler QDict/QList scalar insertion macros
2017-04-05 19:47 ` Eric Blake
(?)
@ 2017-04-11 17:12 ` Markus Armbruster
2017-04-11 17:44 ` Eric Blake
2017-04-11 17:44 ` Eric Blake
-1 siblings, 2 replies; 42+ messages in thread
From: Markus Armbruster @ 2017-04-11 17:12 UTC (permalink / raw)
To: Eric Blake
Cc: qemu-devel, Kevin Wolf, Alexander Graf, Stefano Stabellini,
Michael Roth, open list:Block layer core, Max Reitz,
Gerd Hoffmann, open list:X86, Anthony Perard, Paolo Bonzini,
Dr. David Alan Gilbert, Richard Henderson
Eric Blake <eblake@redhat.com> writes:
> We now have macros in place to make it less verbose to add a scalar
> to QDict and QList, so use them. To make this patch smaller to
> review, a couple of subdirectories were done in earlier patches.
>
> Patch created mechanically via:
> spatch --sp-file scripts/coccinelle/qobject.cocci \
> --macro-file scripts/cocci-macro-file.h --dir . --in-place
> and needed only one touch-up in monitor.c to avoid a long line.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> block.c | 45 +++++++++++++++++++--------------------------
> blockdev.c | 30 +++++++++++++-----------------
> hw/block/xen_disk.c | 2 +-
> hw/usb/xen-usb.c | 12 ++++++------
> monitor.c | 23 +++++++++++------------
> qapi/qmp-event.c | 2 +-
> qemu-img.c | 6 +++---
> qemu-io.c | 2 +-
> qemu-nbd.c | 2 +-
> qobject/qdict.c | 2 +-
> target/s390x/cpu_models.c | 4 ++--
> util/qemu-option.c | 2 +-
> 12 files changed, 60 insertions(+), 72 deletions(-)
Looks like you intent is to split the application of qobject.cocci into
block [PATCH 07], tests [PATCH 08] and rest [PATCH 09, i.e. this one].
Okay, although everything on one patch would also be okay for me.
However, this patch also contains block stuff: block.c blockdev.c
qemu-{img,io,nbd}.c. Move to PATCH 07?
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 09/13] qobject: Use simpler QDict/QList scalar insertion macros
2017-04-05 19:47 ` Eric Blake
(?)
(?)
@ 2017-04-11 17:12 ` Markus Armbruster
-1 siblings, 0 replies; 42+ messages in thread
From: Markus Armbruster @ 2017-04-11 17:12 UTC (permalink / raw)
To: Eric Blake
Cc: Kevin Wolf, Alexander Graf, Stefano Stabellini,
open list:Block layer core, Michael Roth, qemu-devel,
Gerd Hoffmann, Paolo Bonzini, Anthony Perard, open list:X86,
Max Reitz, Dr. David Alan Gilbert, Richard Henderson
Eric Blake <eblake@redhat.com> writes:
> We now have macros in place to make it less verbose to add a scalar
> to QDict and QList, so use them. To make this patch smaller to
> review, a couple of subdirectories were done in earlier patches.
>
> Patch created mechanically via:
> spatch --sp-file scripts/coccinelle/qobject.cocci \
> --macro-file scripts/cocci-macro-file.h --dir . --in-place
> and needed only one touch-up in monitor.c to avoid a long line.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> block.c | 45 +++++++++++++++++++--------------------------
> blockdev.c | 30 +++++++++++++-----------------
> hw/block/xen_disk.c | 2 +-
> hw/usb/xen-usb.c | 12 ++++++------
> monitor.c | 23 +++++++++++------------
> qapi/qmp-event.c | 2 +-
> qemu-img.c | 6 +++---
> qemu-io.c | 2 +-
> qemu-nbd.c | 2 +-
> qobject/qdict.c | 2 +-
> target/s390x/cpu_models.c | 4 ++--
> util/qemu-option.c | 2 +-
> 12 files changed, 60 insertions(+), 72 deletions(-)
Looks like you intent is to split the application of qobject.cocci into
block [PATCH 07], tests [PATCH 08] and rest [PATCH 09, i.e. this one].
Okay, although everything on one patch would also be okay for me.
However, this patch also contains block stuff: block.c blockdev.c
qemu-{img,io,nbd}.c. Move to PATCH 07?
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
` (13 preceding siblings ...)
2017-04-06 12:38 ` [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups no-reply
@ 2017-04-11 17:23 ` Markus Armbruster
14 siblings, 0 replies; 42+ messages in thread
From: Markus Armbruster @ 2017-04-11 17:23 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel
Eric Blake <eblake@redhat.com> writes:
> This is a subset of my earlier post "Rip out dynamic JSON parsing"[1],
> and then a rebase of that work onto master. It is available here:
>
> git fetch git://repo.or.cz/qemu/ericb.git qapi-dynamic-json-v3
>
> the tag name is a bit of a misnomer for the current series, but is
> historically accurate.
>
> Since v2 [2], I've split up the original patches 2-3 (done manually,
> and mixing multiple cleanups into one) into a much longer sequence of
> patches 2-11 (separate cleanups in 2, 3, 10, 11, and use of Coccinelle
> instead of manual for the bulk of the work); I've also dropped the
> original patch 6. I've also addressed some of the comments left by
> Markus on v2, although I still couldn't figure out how to use an 'id'
> instead of "device":"floppy0" in 12.
>
> This is 2.10 material, and will probably be a conflict magnet the
> longer it is not applied (conversely, since it is now generated by
> Coccinelle, it will be a lot easier to regenerate the series if
> another round of rebasing is needed).
I'm happy to stage this work in my tree for quick merging into 2.10.
Looking forward to v4.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 06/13] qobject: Add helper macros for common scalar insertions
2017-04-11 17:06 ` Markus Armbruster
@ 2017-04-11 17:43 ` Eric Blake
0 siblings, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-11 17:43 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]
On 04/11/2017 12:06 PM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> Rather than making lots of callers wrap a scalar in a QInt, QString,
>> or QBool, provide helper macros that do the wrapping automatically.
>>
>> Update the Coccinelle script to make mass conversions easy, although
>> the conversion itself will be done as a separate patches to ease
>> review and backport efforts.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>> include/qapi/qmp/qdict.h | 8 ++++++++
>> include/qapi/qmp/qlist.h | 8 ++++++++
>> scripts/coccinelle/qobject.cocci | 22 ++++++++++++++++++++++
>> 3 files changed, 38 insertions(+)
>>
>> diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h
>> index fe9a4c5..9d9f9a3 100644
>> --- a/include/qapi/qmp/qdict.h
>> +++ b/include/qapi/qmp/qdict.h
>> @@ -52,6 +52,14 @@ void qdict_destroy_obj(QObject *obj);
>> #define qdict_put(qdict, key, obj) \
>> qdict_put_obj(qdict, key, QOBJECT(obj))
>>
>> +/* Helpers for int, bool, and const char*. */
>
> "char *." looks awkward. What about
>
> /* Helpers for int, bool, and const char * */
>
> or
>
> /* Helpers for int, bool, string */
That does look nicer.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 09/13] qobject: Use simpler QDict/QList scalar insertion macros
2017-04-11 17:12 ` [Qemu-devel] " Markus Armbruster
2017-04-11 17:44 ` Eric Blake
@ 2017-04-11 17:44 ` Eric Blake
1 sibling, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-11 17:44 UTC (permalink / raw)
To: Markus Armbruster
Cc: qemu-devel, Kevin Wolf, Alexander Graf, Stefano Stabellini,
Michael Roth, open list:Block layer core, Max Reitz,
Gerd Hoffmann, open list:X86, Anthony Perard, Paolo Bonzini,
Dr. David Alan Gilbert, Richard Henderson
[-- Attachment #1: Type: text/plain, Size: 2036 bytes --]
On 04/11/2017 12:12 PM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> We now have macros in place to make it less verbose to add a scalar
>> to QDict and QList, so use them. To make this patch smaller to
>> review, a couple of subdirectories were done in earlier patches.
>>
>> Patch created mechanically via:
>> spatch --sp-file scripts/coccinelle/qobject.cocci \
>> --macro-file scripts/cocci-macro-file.h --dir . --in-place
>> and needed only one touch-up in monitor.c to avoid a long line.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>> block.c | 45 +++++++++++++++++++--------------------------
>> blockdev.c | 30 +++++++++++++-----------------
>> hw/block/xen_disk.c | 2 +-
>> hw/usb/xen-usb.c | 12 ++++++------
>> monitor.c | 23 +++++++++++------------
>> qapi/qmp-event.c | 2 +-
>> qemu-img.c | 6 +++---
>> qemu-io.c | 2 +-
>> qemu-nbd.c | 2 +-
>> qobject/qdict.c | 2 +-
>> target/s390x/cpu_models.c | 4 ++--
>> util/qemu-option.c | 2 +-
>> 12 files changed, 60 insertions(+), 72 deletions(-)
>
> Looks like you intent is to split the application of qobject.cocci into
> block [PATCH 07], tests [PATCH 08] and rest [PATCH 09, i.e. this one].
> Okay, although everything on one patch would also be okay for me.
> However, this patch also contains block stuff: block.c blockdev.c
> qemu-{img,io,nbd}.c. Move to PATCH 07?
Can do either way, although I'd have to tweak the commit message's
sample command lines I used for the split if you like it kept separate.
Maybe even just a comment in patch 07 that 'only files under block/ are
touched here; other block-related patches will be fixed in the remaining
global cleanup'.
Do you have a preference?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH v3 09/13] qobject: Use simpler QDict/QList scalar insertion macros
2017-04-11 17:12 ` [Qemu-devel] " Markus Armbruster
@ 2017-04-11 17:44 ` Eric Blake
2017-04-11 17:44 ` Eric Blake
1 sibling, 0 replies; 42+ messages in thread
From: Eric Blake @ 2017-04-11 17:44 UTC (permalink / raw)
To: Markus Armbruster
Cc: Kevin Wolf, Alexander Graf, Stefano Stabellini,
open list:Block layer core, Michael Roth, qemu-devel,
Gerd Hoffmann, Paolo Bonzini, Anthony Perard, open list:X86,
Max Reitz, Dr. David Alan Gilbert, Richard Henderson
[-- Attachment #1.1.1: Type: text/plain, Size: 2036 bytes --]
On 04/11/2017 12:12 PM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> We now have macros in place to make it less verbose to add a scalar
>> to QDict and QList, so use them. To make this patch smaller to
>> review, a couple of subdirectories were done in earlier patches.
>>
>> Patch created mechanically via:
>> spatch --sp-file scripts/coccinelle/qobject.cocci \
>> --macro-file scripts/cocci-macro-file.h --dir . --in-place
>> and needed only one touch-up in monitor.c to avoid a long line.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>> block.c | 45 +++++++++++++++++++--------------------------
>> blockdev.c | 30 +++++++++++++-----------------
>> hw/block/xen_disk.c | 2 +-
>> hw/usb/xen-usb.c | 12 ++++++------
>> monitor.c | 23 +++++++++++------------
>> qapi/qmp-event.c | 2 +-
>> qemu-img.c | 6 +++---
>> qemu-io.c | 2 +-
>> qemu-nbd.c | 2 +-
>> qobject/qdict.c | 2 +-
>> target/s390x/cpu_models.c | 4 ++--
>> util/qemu-option.c | 2 +-
>> 12 files changed, 60 insertions(+), 72 deletions(-)
>
> Looks like you intent is to split the application of qobject.cocci into
> block [PATCH 07], tests [PATCH 08] and rest [PATCH 09, i.e. this one].
> Okay, although everything on one patch would also be okay for me.
> However, this patch also contains block stuff: block.c blockdev.c
> qemu-{img,io,nbd}.c. Move to PATCH 07?
Can do either way, although I'd have to tweak the commit message's
sample command lines I used for the split if you like it kept separate.
Maybe even just a comment in patch 07 that 'only files under block/ are
touched here; other block-related patches will be fixed in the remaining
global cleanup'.
Do you have a preference?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 42+ messages in thread
end of thread, other threads:[~2017-04-11 17:44 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 19:47 [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 01/13] pci: Use struct instead of QDict to pass back parameters Eric Blake
2017-04-05 22:04 ` Michael S. Tsirkin
2017-04-06 5:41 ` Marcel Apfelbaum
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 02/13] pci: Reduce scope of error injection Eric Blake
2017-04-05 19:57 ` Philippe Mathieu-Daudé
2017-04-05 22:04 ` Michael S. Tsirkin
2017-04-06 5:42 ` Marcel Apfelbaum
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts Eric Blake
2017-04-05 19:57 ` Philippe Mathieu-Daudé
2017-04-06 7:36 ` Cornelia Huck
2017-04-06 13:31 ` Eric Blake
2017-04-06 13:53 ` Cornelia Huck
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 04/13] coccinelle: Add script to remove useless QObject casts Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 05/13] qobject: Drop " Eric Blake
2017-04-07 9:04 ` Stefan Hajnoczi
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 06/13] qobject: Add helper macros for common scalar insertions Eric Blake
2017-04-11 17:06 ` Markus Armbruster
2017-04-11 17:43 ` Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 07/13] block: Use simpler QDict/QList scalar insertion macros Eric Blake
2017-04-05 19:51 ` Richard W.M. Jones
2017-04-07 9:04 ` Stefan Hajnoczi
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 08/13] tests: " Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 09/13] qobject: " Eric Blake
2017-04-05 19:47 ` Eric Blake
2017-04-11 17:12 ` [Qemu-devel] " Markus Armbruster
2017-04-11 17:44 ` Eric Blake
2017-04-11 17:44 ` Eric Blake
2017-04-11 17:12 ` Markus Armbruster
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic Eric Blake
2017-04-06 9:00 ` Kevin Wolf
2017-04-06 12:52 ` Eric Blake
2017-04-06 13:22 ` Eric Blake
2017-04-06 13:27 ` Kevin Wolf
2017-04-06 13:41 ` Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 11/13] QemuOpts: Simplify qemu_opts_to_qdict() Eric Blake
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 12/13] fdc-test: Avoid deprecated 'change' command Eric Blake
2017-04-05 20:52 ` John Snow
2017-04-06 8:56 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2017-04-05 19:47 ` [Qemu-devel] [PATCH v3 13/13] test-qga: Actually test 0xff sync bytes Eric Blake
2017-04-06 12:38 ` [Qemu-devel] [PATCH v3 00/13] qapi-related cleanups no-reply
2017-04-11 17:23 ` Markus Armbruster
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.