[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 00/53] Error reporting patches patches for 2020-07-07
From: |
Markus Armbruster |
Subject: |
Re: [PULL 00/53] Error reporting patches patches for 2020-07-07 |
Date: |
Fri, 10 Jul 2020 14:47:15 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
This now conflicts with master (b6d7e9b66f5).
Conflict #1: include/hw/audio/pcspk.h
2336172d9b "audio: set default value for pcspk.iobase property"
2336172d9b audio: set default value for pcspk.iobase property
diff --git a/include/hw/audio/pcspk.h b/include/hw/audio/pcspk.h
index 8b48560267..06cba00b83 100644
--- a/include/hw/audio/pcspk.h
+++ b/include/hw/audio/pcspk.h
@@ -33,11 +33,7 @@
static inline void pcspk_init(ISADevice *isadev, ISABus *bus, ISADevice
*pit)
{
- DeviceState *dev;
-
- dev = DEVICE(isadev);
- qdev_prop_set_uint32(dev, "iobase", 0x61);
- object_property_set_link(OBJECT(dev), OBJECT(pit), "pit", NULL);
+ object_property_set_link(OBJECT(isadev), OBJECT(pit), "pit", NULL);
isa_realize_and_unref(isadev, bus, &error_fatal);
}
9eb2af7743 qom: Put name parameter before value / visitor parameter
diff --git a/include/hw/audio/pcspk.h b/include/hw/audio/pcspk.h
index 7e7f5f49dc..6386491288 100644
--- a/include/hw/audio/pcspk.h
+++ b/include/hw/audio/pcspk.h
@@ -39,7 +39,7 @@ static inline ISADevice *pcspk_init(ISABus *bus,
ISADevice *pit)
isadev = isa_new(TYPE_PC_SPEAKER);
dev = DEVICE(isadev);
qdev_prop_set_uint32(dev, "iobase", 0x61);
- object_property_set_link(OBJECT(dev), OBJECT(pit), "pit", NULL);
+ object_property_set_link(OBJECT(dev), "pit", OBJECT(pit), NULL);
isa_realize_and_unref(isadev, bus, &error_fatal);
return isadev;
Resolution is trivial, just redo 9eb2af7743's swap of the arguments:
static inline void pcspk_init(ISADevice *isadev, ISABus *bus, ISADevice
*pit)
{
object_property_set_link(OBJECT(isadev), "pit", OBJECT(pit), NULL);
isa_realize_and_unref(isadev, bus, &error_fatal);
}
Conflict #2: qemu-img.c
0b6786a9c1 block/amend: refactor qcow2 amend options
diff --git a/qemu-img.c b/qemu-img.c
index 1a0a85089b..7f4938a5ef 100644
--- a/qemu-img.c
+++ b/qemu-img.c
[...]
@@ -4219,7 +4218,22 @@ static int img_amend(int argc, char **argv)
amend_opts = qemu_opts_append(amend_opts, bs->drv->amend_opts);
opts = qemu_opts_create(amend_opts, NULL, 0, &error_abort);
qemu_opts_do_parse(opts, options, NULL, &err);
+
if (err) {
+ /* Try to parse options using the create options */
+ Error *err1 = NULL;
+ amend_opts = qemu_opts_append(amend_opts, bs->drv->create_opts);
+ qemu_opts_del(opts);
+ opts = qemu_opts_create(amend_opts, NULL, 0, &error_abort);
+ qemu_opts_do_parse(opts, options, NULL, &err1);
+
+ if (!err1) {
+ error_append_hint(&err,
+ "This option is only supported for image
creation\n");
+ } else {
+ error_free(err1);
+ }
+
error_report_err(err);
ret = -1;
goto out;
0bc2a50e17 qemu-option: Use returned bool to check for failure
diff --git a/qemu-img.c b/qemu-img.c
index bdb9f6aa46..fc405ee171 100644
--- a/qemu-img.c
+++ b/qemu-img.c
[...]
@@ -4212,8 +4209,7 @@ static int img_amend(int argc, char **argv)
create_opts = qemu_opts_append(create_opts, bs->drv->create_opts);
opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
- qemu_opts_do_parse(opts, options, NULL, &err);
- if (err) {
+ if (!qemu_opts_do_parse(opts, options, NULL, &err)) {
error_report_err(err);
ret = -1;
goto out;
Simply rerunning latter commit' Coccinelle script on master's version
would be possible, but suboptimal, because the former commit adds an
awkward error ignore a rebase would clean up. Manual resolution:
amend_opts = qemu_opts_append(amend_opts, bs->drv->amend_opts);
opts = qemu_opts_create(amend_opts, NULL, 0, &error_abort);
if (!qemu_opts_do_parse(opts, options, NULL, &err)) {
/* Try to parse options using the create options */
amend_opts = qemu_opts_append(amend_opts, bs->drv->create_opts);
qemu_opts_del(opts);
opts = qemu_opts_create(amend_opts, NULL, 0, &error_abort);
if (qemu_opts_do_parse(opts, options, NULL, NULL)) {
error_append_hint(&err,
"This option is only supported for image
creation\n");
}
error_report_err(err);
ret = -1;
goto out;
}
If you'd prefer a rebased pull request, let me know.
Tests are still running.
- [PULL 10/53] qemu-option: Simplify around find_default_by_name(), (continued)
- [PULL 10/53] qemu-option: Simplify around find_default_by_name(), Markus Armbruster, 2020/07/08
- [PULL 17/53] qapi: Make visitor functions taking Error ** return bool, not void, Markus Armbruster, 2020/07/08
- [PULL 37/53] error: Reduce unnecessary error propagation, Markus Armbruster, 2020/07/08
- [PULL 15/53] block: Avoid error accumulation in bdrv_img_create(), Markus Armbruster, 2020/07/08
- [PULL 48/53] sd: Use ERRP_GUARD(), Markus Armbruster, 2020/07/08
- [PULL 14/53] qemu-option: Use returned bool to check for failure, Markus Armbruster, 2020/07/08
- [PULL 21/53] qom: Use error_reportf_err() instead of g_printerr() in examples, Markus Armbruster, 2020/07/08
- [PULL 20/53] s390x/pci: Fix harmless mistake in zpci's property fid's setter, Markus Armbruster, 2020/07/08
- [PULL 29/53] qom: Use returned bool to check for failure, manual part, Markus Armbruster, 2020/07/08
- [PULL 03/53] error: Document Error API usage rules, Markus Armbruster, 2020/07/08
- Re: [PULL 00/53] Error reporting patches patches for 2020-07-07,
Markus Armbruster <=