From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaVt8-0005SH-BO for qemu-devel@nongnu.org; Sat, 04 Oct 2014 16:25:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XaVt2-0004O1-24 for qemu-devel@nongnu.org; Sat, 04 Oct 2014 16:25:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaVt1-0004NS-Rc for qemu-devel@nongnu.org; Sat, 04 Oct 2014 16:25:04 -0400 From: Stefan Hajnoczi Date: Sat, 4 Oct 2014 21:24:31 +0100 Message-Id: <1412454289-1789-6-git-send-email-stefanha@redhat.com> In-Reply-To: <1412454289-1789-1-git-send-email-stefanha@redhat.com> References: <1412454289-1789-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 05/23] Modify qemu_opt_rename to realize renaming all items in opts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell From: Jun Li 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 5abbf0ee4d87c695deb1c3fca9bb994b93a3e3be ("block: Catch simultaneous usage of options and their aliases"). Check for simultaneous use first, and then loop over all options. --Stefan] Signed-off-by: Jun Li Reviewed-by: Eric Blake Message-id: 1411537527-16715-1-git-send-email-junmuzi@gmail.com Signed-off-by: Stefan Hajnoczi --- blockdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blockdev.c b/blockdev.c index 2f441c5..dc94ad3 100644 --- a/blockdev.c +++ b/blockdev.c @@ -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); } -- 1.9.3