提交 140e065d 编写于 作者: J Jan Kiszka 提交者: Luiz Capitulino

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: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 0e8d2b55
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册