mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
qemu-char: Call fe_claim / fe_release when not using qdev chr properties
chardev-frontends need to explictly check, increase and decrement the avail_connections "property" of the chardev when they are not using a qdev-chardev-property for the chardev. This fixes things like: qemu-kvm -chardev stdio,id=foo -device isa-serial,chardev=foo \ -mon chardev=foo Working, where they should fail. Most of the changes here are due to old hardware emulation code which is using serial_hds directly rather then a qdev-chardev-property. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Message-id: 1364412581-3672-3-git-send-email-hdegoede@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
committed by
Anthony Liguori
parent
44c473decd
commit
456d606923
10
qemu-char.c
10
qemu-char.c
@@ -3411,6 +3411,7 @@ CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*in
|
||||
error_free(err);
|
||||
}
|
||||
if (chr && qemu_opt_get_bool(opts, "mux", 0)) {
|
||||
qemu_chr_fe_claim_no_fail(chr);
|
||||
monitor_init(chr, MONITOR_USE_READLINE);
|
||||
}
|
||||
return chr;
|
||||
@@ -3523,9 +3524,16 @@ CharDriverState *qemu_chr_find(const char *name)
|
||||
CharDriverState *qemu_char_get_next_serial(void)
|
||||
{
|
||||
static int next_serial;
|
||||
CharDriverState *chr;
|
||||
|
||||
/* FIXME: This function needs to go away: use chardev properties! */
|
||||
return serial_hds[next_serial++];
|
||||
|
||||
while (next_serial < MAX_SERIAL_PORTS && serial_hds[next_serial]) {
|
||||
chr = serial_hds[next_serial++];
|
||||
qemu_chr_fe_claim_no_fail(chr);
|
||||
return chr;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
QemuOptsList qemu_chardev_opts = {
|
||||
|
||||
Reference in New Issue
Block a user