Commit 20d6cd47 authored by Jun Li's avatar Jun Li Committed by Stefan Hajnoczi
Browse files

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



[Resolved conflict with commit 5abbf0ee
("block: Catch simultaneous usage of options and their aliases").  Check
for simultaneous use first, and then loop over all options.
--Stefan]

Signed-off-by: default avatarJun Li <junmuzi@gmail.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-id: 1411537527-16715-1-git-send-email-junmuzi@gmail.com
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent d1319b07
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -548,6 +548,10 @@ static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
                       "same time", to, from);
            return;
        }
    }

    /* rename all items in opts */
    while ((value = qemu_opt_get(opts, from))) {
        qemu_opt_set(opts, to, value);
        qemu_opt_unset(opts, from);
    }