Skip to contentSkip to conversation

Modify qemu_opt_rename to realize renaming all items in opts

PATCH New Jun Li 1 participant 1 message Sep 24, 2014

lore
Share & tools
lore

Jun Li

author
#0 lore raw

PATCH v2 1/1 Modify qemu_opt_rename to realize renaming all items in opts

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

---
 blockdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
blockdev.c +2 -2
index b361fbb..ed95b76 100644
@@ -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);
     }
Signature · 1 line
1.9.3