* [Qemu-trivial] [PATCH] ivshmem, qdev-monitor: fix order of qerror parameters
@ 2012-08-14 11:41 Alberto Garcia
2012-08-14 13:42 ` Luiz Capitulino
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Alberto Garcia @ 2012-08-14 11:41 UTC (permalink / raw)
To: qemu-trivial; +Cc: Luiz Capitulino
Now that the QERR_ macros no longer contain a json dictionary,
the order of some parameters needs to be fixed for them to appear
correctly.
---
hw/ivshmem.c | 3 ++-
hw/qdev-monitor.c | 2 +-
2 ficheiros modificados, 3 adições(+), 2 eliminados(-)
diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index 0c58161..b4d65a6 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -677,7 +677,8 @@ static int pci_ivshmem_init(PCIDevice *dev)
}
if (s->role_val == IVSHMEM_PEER) {
- error_set(&s->migration_blocker, QERR_DEVICE_FEATURE_BLOCKS_MIGRATION, "ivshmem", "peer mode");
+ error_set(&s->migration_blocker, QERR_DEVICE_FEATURE_BLOCKS_MIGRATION,
+ "peer mode", "ivshmem");
migrate_add_blocker(s->migration_blocker);
}
diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index b22a37a..018b386 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -443,7 +443,7 @@ DeviceState *qdev_device_add(QemuOpts *opts)
bus = qbus_find_recursive(sysbus_get_default(), NULL, k->bus_type);
if (!bus) {
qerror_report(QERR_NO_BUS_FOR_DEVICE,
- driver, k->bus_type);
+ k->bus_type, driver);
return NULL;
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [Qemu-trivial] [PATCH] ivshmem, qdev-monitor: fix order of qerror parameters 2012-08-14 11:41 [Qemu-trivial] [PATCH] ivshmem, qdev-monitor: fix order of qerror parameters Alberto Garcia @ 2012-08-14 13:42 ` Luiz Capitulino 2012-08-14 14:15 ` Alberto Garcia 2012-08-15 14:30 ` Stefan Hajnoczi 2012-08-15 14:37 ` Stefan Hajnoczi 2 siblings, 1 reply; 6+ messages in thread From: Luiz Capitulino @ 2012-08-14 13:42 UTC (permalink / raw) To: Alberto Garcia; +Cc: qemu-trivial, qemu-devel On Tue, 14 Aug 2012 14:41:28 +0300 Alberto Garcia <agarcia@igalia.com> wrote: > Now that the QERR_ macros no longer contain a json dictionary, > the order of some parameters needs to be fixed for them to appear > correctly. > --- > hw/ivshmem.c | 3 ++- > hw/qdev-monitor.c | 2 +- > 2 ficheiros modificados, 3 adições(+), 2 eliminados(-) > > diff --git a/hw/ivshmem.c b/hw/ivshmem.c > index 0c58161..b4d65a6 100644 > --- a/hw/ivshmem.c > +++ b/hw/ivshmem.c > @@ -677,7 +677,8 @@ static int pci_ivshmem_init(PCIDevice *dev) > } > > if (s->role_val == IVSHMEM_PEER) { > - error_set(&s->migration_blocker, QERR_DEVICE_FEATURE_BLOCKS_MIGRATION, "ivshmem", "peer mode"); > + error_set(&s->migration_blocker, QERR_DEVICE_FEATURE_BLOCKS_MIGRATION, > + "peer mode", "ivshmem"); Good catch, Alberto. Here's the real problem. The original QERR_DEVICE_FEATURE_BLOCKS_MIGRATION was: "{ 'class': 'DeviceFeatureBlocksMigration', 'data': { 'device': %s, 'feature': %s } }" This is what was used in a error_set() call, so ordering was device name, feature name. However, the human error message format was: "Migration is disabled when using feature '%(feature)' in device '%(device)'" So, when constructing the error message, ordering was feature name, device name. However, my script that moved all error messages from qerror.c to the QERR_ just did (as a final result): error_set(errp, "Migration is disabled when using feature '%s' in device '%s'", device_name, feature_name); Sh?t. Now, I think that the best way to fix this is to change the error message instead of fixing callers. For example, we could have: "Migration is disabled when device '%s' is using feature '%s'" Additionally, we should check all old QERR_ macros to see if anyone else swaps parameters like this and change them too. I'll do it. > migrate_add_blocker(s->migration_blocker); > } > > diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c > index b22a37a..018b386 100644 > --- a/hw/qdev-monitor.c > +++ b/hw/qdev-monitor.c > @@ -443,7 +443,7 @@ DeviceState *qdev_device_add(QemuOpts *opts) > bus = qbus_find_recursive(sysbus_get_default(), NULL, k->bus_type); > if (!bus) { > qerror_report(QERR_NO_BUS_FOR_DEVICE, > - driver, k->bus_type); > + k->bus_type, driver); > return NULL; > } > } ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-trivial] [PATCH] ivshmem, qdev-monitor: fix order of qerror parameters 2012-08-14 13:42 ` Luiz Capitulino @ 2012-08-14 14:15 ` Alberto Garcia 2012-08-14 14:43 ` Luiz Capitulino 0 siblings, 1 reply; 6+ messages in thread From: Alberto Garcia @ 2012-08-14 14:15 UTC (permalink / raw) To: Luiz Capitulino; +Cc: qemu-trivial, qemu-devel On Tue, Aug 14, 2012 at 10:42:30AM -0300, Luiz Capitulino wrote: > Additionally, we should check all old QERR_ macros to see if anyone > else swaps parameters like this and change them too. Yes, I also noticed the problem and checked all QERR_ macros, I only found the two that I corrected in the patch, but double checking the list won't hurt I guess :) Berto ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-trivial] [PATCH] ivshmem, qdev-monitor: fix order of qerror parameters 2012-08-14 14:15 ` Alberto Garcia @ 2012-08-14 14:43 ` Luiz Capitulino 0 siblings, 0 replies; 6+ messages in thread From: Luiz Capitulino @ 2012-08-14 14:43 UTC (permalink / raw) To: Alberto Garcia; +Cc: qemu-trivial, qemu-devel On Tue, 14 Aug 2012 16:15:37 +0200 Alberto Garcia <agarcia@igalia.com> wrote: > On Tue, Aug 14, 2012 at 10:42:30AM -0300, Luiz Capitulino wrote: > > > Additionally, we should check all old QERR_ macros to see if anyone > > else swaps parameters like this and change them too. > > Yes, I also noticed the problem and checked all QERR_ macros, I only > found the two that I corrected in the patch, but double checking the > list won't hurt I guess :) Yes, you're right. I've just double checked it and these are the only two cases and both have only one single user. This patch is fine then: Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-trivial] [PATCH] ivshmem, qdev-monitor: fix order of qerror parameters 2012-08-14 11:41 [Qemu-trivial] [PATCH] ivshmem, qdev-monitor: fix order of qerror parameters Alberto Garcia 2012-08-14 13:42 ` Luiz Capitulino @ 2012-08-15 14:30 ` Stefan Hajnoczi 2012-08-15 14:37 ` Stefan Hajnoczi 2 siblings, 0 replies; 6+ messages in thread From: Stefan Hajnoczi @ 2012-08-15 14:30 UTC (permalink / raw) To: Alberto Garcia; +Cc: qemu-trivial, Luiz Capitulino On Tue, Aug 14, 2012 at 02:41:28PM +0300, Alberto Garcia wrote: > Now that the QERR_ macros no longer contain a json dictionary, > the order of some parameters needs to be fixed for them to appear > correctly. > --- > hw/ivshmem.c | 3 ++- > hw/qdev-monitor.c | 2 +- > 2 ficheiros modificados, 3 adições(+), 2 eliminados(-) Looks good but missing Signed-off-by:. You can just reply with your Signed-off-by: line and I'll merge it, no need to resend the patch. For information on Signed-off-by:, please see "12) Sign your work": http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/SubmittingPatches;h=689e2371095cc5dfea9927120009341f369159aa;hb=f6f94e2ab1b33f0082ac22d71f66385a60d8157f#l297 Stefan ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-trivial] [PATCH] ivshmem, qdev-monitor: fix order of qerror parameters 2012-08-14 11:41 [Qemu-trivial] [PATCH] ivshmem, qdev-monitor: fix order of qerror parameters Alberto Garcia 2012-08-14 13:42 ` Luiz Capitulino 2012-08-15 14:30 ` Stefan Hajnoczi @ 2012-08-15 14:37 ` Stefan Hajnoczi 2 siblings, 0 replies; 6+ messages in thread From: Stefan Hajnoczi @ 2012-08-15 14:37 UTC (permalink / raw) To: Alberto Garcia; +Cc: qemu-trivial, Luiz Capitulino On Tue, Aug 14, 2012 at 02:41:28PM +0300, Alberto Garcia wrote: > Now that the QERR_ macros no longer contain a json dictionary, > the order of some parameters needs to be fixed for them to appear > correctly. > --- > hw/ivshmem.c | 3 ++- > hw/qdev-monitor.c | 2 +- > 2 ficheiros modificados, 3 adições(+), 2 eliminados(-) Thanks, applied to the trivial patches tree: https://github.com/stefanha/qemu/commits/trivial-patches Stefan ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-08-15 14:37 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-08-14 11:41 [Qemu-trivial] [PATCH] ivshmem, qdev-monitor: fix order of qerror parameters Alberto Garcia 2012-08-14 13:42 ` Luiz Capitulino 2012-08-14 14:15 ` Alberto Garcia 2012-08-14 14:43 ` Luiz Capitulino 2012-08-15 14:30 ` Stefan Hajnoczi 2012-08-15 14:37 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).