* [Qemu-devel] [PATCH v2] Modify qemu_opt_rename to realize renaming all items in opts
@ 2014-09-24 5:45 Jun Li
0 siblings, 0 replies; only message in thread
From: Jun Li @ 2014-09-24 5:45 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, famz, Jun Li, juli, stefanha
Add realization of rename all items in opts for qemu_opt_rename.
e.g:
When add bps twice in command line, need to rename all bps to
throttling.bps-total.
This patch solved following bug:
Bug 1145586 - qemu-kvm will give strange hint when add bps twice for a drive
ref:https://bugzilla.redhat.com/show_bug.cgi?id=1145586
Signed-off-by: Jun Li <junmuzi@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
blockdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index b361fbb..ed95b76 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -536,8 +536,8 @@ static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to)
{
const char *value;
- value = qemu_opt_get(opts, from);
- if (value) {
+ /* rename all items in opts */
+ while ((value = qemu_opt_get(opts, from))) {
qemu_opt_set(opts, to, value);
qemu_opt_unset(opts, from);
}
--
1.9.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-09-24 5:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 5:45 [Qemu-devel] [PATCH v2] Modify qemu_opt_rename to realize renaming all items in opts Jun Li
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).