Skip to content
  • Kevin Wolf's avatar
    f27a9bb3
    qmp: Fail gracefully if chardev is already in use · f27a9bb3
    Kevin Wolf authored
    
    
    Trying to attach a QMP monitor to a chardev that is already in use
    results in a crash because monitor_init_qmp() passes &error_abort to
    qemu_chr_fe_init():
    
    $ ./x86_64-softmmu/qemu-system-x86_64 --chardev stdio,id=foo --mon foo,mode=control --mon foo,mode=control
    Unexpected error in qemu_chr_fe_init() at chardev/char-fe.c:220:
    qemu-system-x86_64: --mon foo,mode=control: Device 'foo' is in use
    Abgebrochen (Speicherabzug geschrieben)
    
    Fix this by allowing monitor_init_qmp() to return an error and passing
    any error in qemu_chr_fe_init() to its caller instead of aborting.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Message-Id: <20200224143008.13362-18-kwolf@redhat.com>
    Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    f27a9bb3
    qmp: Fail gracefully if chardev is already in use
    Kevin Wolf authored
    
    
    Trying to attach a QMP monitor to a chardev that is already in use
    results in a crash because monitor_init_qmp() passes &error_abort to
    qemu_chr_fe_init():
    
    $ ./x86_64-softmmu/qemu-system-x86_64 --chardev stdio,id=foo --mon foo,mode=control --mon foo,mode=control
    Unexpected error in qemu_chr_fe_init() at chardev/char-fe.c:220:
    qemu-system-x86_64: --mon foo,mode=control: Device 'foo' is in use
    Abgebrochen (Speicherabzug geschrieben)
    
    Fix this by allowing monitor_init_qmp() to return an error and passing
    any error in qemu_chr_fe_init() to its caller instead of aborting.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Message-Id: <20200224143008.13362-18-kwolf@redhat.com>
    Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading