mirror of https://github.com/xemu-project/xemu.git
dataplane: print why starting failed
Setting up guest or host notifiers may fail, but the user will have no idea why: Let's print the error returned by the callback. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
16b38080e3
commit
267e1a204c
|
@ -218,6 +218,7 @@ void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s)
|
||||||
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
|
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
|
||||||
VirtIOBlock *vblk = VIRTIO_BLK(s->vdev);
|
VirtIOBlock *vblk = VIRTIO_BLK(s->vdev);
|
||||||
VirtQueue *vq;
|
VirtQueue *vq;
|
||||||
|
int r;
|
||||||
|
|
||||||
if (s->started) {
|
if (s->started) {
|
||||||
return;
|
return;
|
||||||
|
@ -236,16 +237,18 @@ void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set up guest notifier (irq) */
|
/* Set up guest notifier (irq) */
|
||||||
if (k->set_guest_notifiers(qbus->parent, 1, true) != 0) {
|
r = k->set_guest_notifiers(qbus->parent, 1, true);
|
||||||
fprintf(stderr, "virtio-blk failed to set guest notifier, "
|
if (r != 0) {
|
||||||
"ensure -enable-kvm is set\n");
|
fprintf(stderr, "virtio-blk failed to set guest notifier (%d), "
|
||||||
|
"ensure -enable-kvm is set\n", r);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
s->guest_notifier = virtio_queue_get_guest_notifier(vq);
|
s->guest_notifier = virtio_queue_get_guest_notifier(vq);
|
||||||
|
|
||||||
/* Set up virtqueue notify */
|
/* Set up virtqueue notify */
|
||||||
if (k->set_host_notifier(qbus->parent, 0, true) != 0) {
|
r = k->set_host_notifier(qbus->parent, 0, true);
|
||||||
fprintf(stderr, "virtio-blk failed to set host notifier\n");
|
if (r != 0) {
|
||||||
|
fprintf(stderr, "virtio-blk failed to set host notifier (%d)\n", r);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
s->host_notifier = *virtio_queue_get_host_notifier(vq);
|
s->host_notifier = *virtio_queue_get_host_notifier(vq);
|
||||||
|
|
Loading…
Reference in New Issue