[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2] Modify qemu_opt_rename to realize renaming all i

From: Jun Li
Subject: [Qemu-devel] [PATCH v2] Modify qemu_opt_rename to realize renaming all items in opts
Date: Wed, 24 Sep 2014 13:45:27 +0800

Add realization of rename all items in opts for qemu_opt_rename.
When add bps twice in command line, need to rename all bps to

This patch solved following bug:
Bug 1145586 - qemu-kvm will give strange hint when add bps twice for a drive

Signed-off-by: Jun Li <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
 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);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]