diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2014-10-15 15:15:26 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-10-23 16:41:25 +0200 |
commit | 4adea8042f880dd9bd7cb5c191a781ec86fdc587 (patch) | |
tree | 0d75f8c4c20c17e37cf0e96d1f8dcc2484020a3b /hw/scsi/virtio-scsi-dataplane.c | |
parent | 361dcc790db8c87b2e46ab610739191ced894c44 (diff) | |
download | qemu-4adea8042f880dd9bd7cb5c191a781ec86fdc587.tar.gz qemu-4adea8042f880dd9bd7cb5c191a781ec86fdc587.tar.bz2 qemu-4adea8042f880dd9bd7cb5c191a781ec86fdc587.zip |
virtio-scsi: dataplane: stop trying on notifier error
There's no use to constantly trying to enable dataplane if we failed
to set up guest or host notifiers, so fence it off in that case.
We'll try again if the device is reinitialized.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/virtio-scsi-dataplane.c')
-rw-r--r-- | hw/scsi/virtio-scsi-dataplane.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c index 243a4765e9..3097d544b4 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi/virtio-scsi-dataplane.c @@ -53,6 +53,7 @@ static VirtIOSCSIVring *virtio_scsi_vring_init(VirtIOSCSI *s, if (rc != 0) { fprintf(stderr, "virtio-scsi: Failed to set host notifier (%d)\n", rc); + s->dataplane_fenced = true; return NULL; } r->host_notifier = *virtio_queue_get_host_notifier(vq); @@ -198,6 +199,7 @@ void virtio_scsi_dataplane_start(VirtIOSCSI *s) if (s->dataplane_started || s->dataplane_starting || + s->dataplane_fenced || s->ctx != iothread_get_aio_context(vs->conf.iothread)) { return; } @@ -211,6 +213,7 @@ void virtio_scsi_dataplane_start(VirtIOSCSI *s) if (rc != 0) { fprintf(stderr, "virtio-scsi: Failed to set guest notifiers (%d), " "ensure -enable-kvm is set\n", rc); + s->dataplane_fenced = true; goto fail_guest_notifiers; } @@ -262,6 +265,11 @@ void virtio_scsi_dataplane_stop(VirtIOSCSI *s) VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s); int i; + /* Better luck next time. */ + if (s->dataplane_fenced) { + s->dataplane_fenced = false; + return; + } if (!s->dataplane_started || s->dataplane_stopping) { return; } |