qemu-char: fix qemu_chr_fe_set_msgfds() crash when disconnected
commit5c7eaabf65ba936f718ef4dfcfc551ffc9d4f35c
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 26 Jul 2016 21:15:08 +0000 (27 01:15 +0400)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 28 Jul 2016 21:33:47 +0000 (29 00:33 +0300)
treed7dfff9fa9ba04abb1e2fce99ee754a3688556c2
parent4afba631206d302303499edc22a8f3fc7a1816ee
qemu-char: fix qemu_chr_fe_set_msgfds() crash when disconnected

Calling qemu_chr_fe_set_msgfds() on unconnected socket leads to crash
since s->ioc is NULL in this case. Return an error earlier instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
qemu-char.c