Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6QYB-0000vX-0k for qemu-devel@nongnu.org; Mon, 26 Apr 2010 11:48:47 -0400 Received: from [140.186.70.92] (port=34785 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6QY9-0000ux-LJ for qemu-devel@nongnu.org; Mon, 26 Apr 2010 11:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6QY7-0007I8-R5 for qemu-devel@nongnu.org; Mon, 26 Apr 2010 11:48:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58288) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6QY7-0007Hx-JT for qemu-devel@nongnu.org; Mon, 26 Apr 2010 11:48:43 -0400 From: Luiz Capitulino Date: Mon, 26 Apr 2010 12:47:30 -0300 Message-Id: <1272296853-30285-7-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1272296853-30285-1-git-send-email-lcapitulino@redhat.com> References: <1272296853-30285-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 6/9] monitor: Cleanup ID assignment for compat switch List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com Cc: Jan Kiszka , qemu-devel@nongnu.org From: Jan Kiszka Canonicalize the ID assignment when creating monitor devices via the legacy switch and use less easily colliding names. Signed-off-by: Jan Kiszka Signed-off-by: Luiz Capitulino --- vl.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/vl.c b/vl.c index 9ef6f2c..20d24be 100644 --- a/vl.c +++ b/vl.c @@ -2348,11 +2348,9 @@ static void monitor_parse(const char *optarg, const char *mode) if (strstart(optarg, "chardev:", &p)) { snprintf(label, sizeof(label), "%s", p); } else { - if (monitor_device_index) { - snprintf(label, sizeof(label), "monitor%d", - monitor_device_index); - } else { - snprintf(label, sizeof(label), "monitor"); + snprintf(label, sizeof(label), "compat_monitor%d", + monitor_device_index); + if (monitor_device_index == 0) { def = 1; } opts = qemu_chr_parse_compat(label, optarg); -- 1.7.1.rc1.12.ga6018