|
@@ -923,8 +923,10 @@ void xen_device_unbind_event_channel(XenDevice *xendev,
|
|
|
|
|
|
QLIST_REMOVE(channel, list);
|
|
QLIST_REMOVE(channel, list);
|
|
|
|
|
|
- aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh),
|
|
|
|
- NULL, NULL, NULL, NULL, NULL);
|
|
|
|
|
|
+ if (channel->ctx) {
|
|
|
|
+ aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh),
|
|
|
|
+ NULL, NULL, NULL, NULL, NULL);
|
|
|
|
+ }
|
|
|
|
|
|
if (qemu_xen_evtchn_unbind(channel->xeh, channel->local_port) < 0) {
|
|
if (qemu_xen_evtchn_unbind(channel->xeh, channel->local_port) < 0) {
|
|
error_setg_errno(errp, errno, "xenevtchn_unbind failed");
|
|
error_setg_errno(errp, errno, "xenevtchn_unbind failed");
|