[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/24] virtio-scsi: dataplane: stop trying on notifie
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 04/24] virtio-scsi: dataplane: stop trying on notifier error |
Date: |
Thu, 23 Oct 2014 15:33:52 +0200 |
From: Cornelia Huck <address@hidden>
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 <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi/virtio-scsi-dataplane.c | 8 ++++++++
include/hw/virtio/virtio-scsi.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c
index c8e63b9..b2399b2 100644
--- a/hw/scsi/virtio-scsi-dataplane.c
+++ b/hw/scsi/virtio-scsi-dataplane.c
@@ -52,6 +52,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);
@@ -197,6 +198,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;
}
@@ -210,6 +212,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;
}
@@ -261,6 +264,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;
}
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index 1ce0858..9e1a49c 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -195,6 +195,7 @@ typedef struct VirtIOSCSI {
bool dataplane_starting;
bool dataplane_stopping;
bool dataplane_disabled;
+ bool dataplane_fenced;
Error *blocker;
Notifier migration_state_notifier;
} VirtIOSCSI;
--
1.8.3.1
- [Qemu-devel] [PULL 00/24] SCSI, maintainers and more - 2014-10-17, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 01/24] virtio-scsi-dataplane: Add op blocker, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 06/24] qom: Demote already-has-a-parent to a regular error, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 02/24] virtio-scsi: dataplane: print why starting failed, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 05/24] qom: Allow clearing of a Link property, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 07/24] qdev: gpio: Re-implement qdev_connect_gpio QOM style, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 03/24] virtio-scsi: dataplane: fail setup gracefully, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 08/24] qdev: gpio: Add API for intercepting a GPIO, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 09/24] qtest/irq: Rework IRQ interception, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 10/24] irq: Remove qemu_irq_intercept_out, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 04/24] virtio-scsi: dataplane: stop trying on notifier error,
Paolo Bonzini <=
- [Qemu-devel] [PULL 11/24] qdev: gpio: delete NamedGPIOList::out, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 12/24] qdev: gpio: Remove qdev_init_gpio_out x1 restriction, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 13/24] qdev: gpio: Define qdev_pass_gpios(), Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 14/24] sysbus: Use TYPE_DEVICE GPIO functionality, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 16/24] MAINTAINERS: grab more files from Anthony's pile, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 17/24] MAINTAINERS: add Samuel Thibault as usb-serial.c and baum.c maintainer, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 18/24] MAINTAINERS: add myself for X86, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 19/24] MAINTAINERS: Add more TCG files, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 20/24] MAINTAINERS: add some tests directories, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 15/24] target-i386: warns users when CPU threads>1 for non-Intel CPUs, Paolo Bonzini, 2014/10/23