From 140e065d72a2301b0b5f769be664e10ebe223888 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 6 Apr 2010 16:55:52 +0200 Subject: monitor: Cleanup ID assignment for compat switch 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 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vl.c b/vl.c index 9ef6f2cbef..20d24be9d0 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); -- cgit v1.2.3