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 <jan.kiszka@siemens.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
0e8d2b5575
commit
140e065d72
8
vl.c
8
vl.c
|
@ -2348,11 +2348,9 @@ static void monitor_parse(const char *optarg, const char *mode)
|
||||||
if (strstart(optarg, "chardev:", &p)) {
|
if (strstart(optarg, "chardev:", &p)) {
|
||||||
snprintf(label, sizeof(label), "%s", p);
|
snprintf(label, sizeof(label), "%s", p);
|
||||||
} else {
|
} else {
|
||||||
if (monitor_device_index) {
|
snprintf(label, sizeof(label), "compat_monitor%d",
|
||||||
snprintf(label, sizeof(label), "monitor%d",
|
monitor_device_index);
|
||||||
monitor_device_index);
|
if (monitor_device_index == 0) {
|
||||||
} else {
|
|
||||||
snprintf(label, sizeof(label), "monitor");
|
|
||||||
def = 1;
|
def = 1;
|
||||||
}
|
}
|
||||||
opts = qemu_chr_parse_compat(label, optarg);
|
opts = qemu_chr_parse_compat(label, optarg);
|
||||||
|
|
Loading…
Reference in New Issue