From: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
To: mst@redhat.com, virtualization@lists.linux-foundation.org
Cc: borntraeger@de.ibm.com
Subject: [PATCH v3 RFC 1/4] virtio: add surprize_removal to virtio_device
Date: Wed, 27 Nov 2013 11:32:37 +0100 [thread overview]
Message-ID: <1385548360-31943-2-git-send-email-graalfs@linux.vnet.ibm.com> (raw)
In-Reply-To: <1385548360-31943-1-git-send-email-graalfs@linux.vnet.ibm.com>
Add new entry surprize_removal to struct virtio_device.
When a virtio transport driver is notified about a lost device
it should set surprize_removal to true.
A backend driver can test this flag in order to perform specific
actions that might be appropriate wrt the device loss.
Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
---
drivers/virtio/virtio.c | 1 +
include/linux/virtio.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index ee59b74..290d1e2 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -115,6 +115,7 @@ static int virtio_dev_probe(struct device *_d)
/* We have a driver! */
add_status(dev, VIRTIO_CONFIG_S_DRIVER);
+ dev->surprize_removal = false;
/* Figure out what features the device supports. */
device_features = dev->config->get_features(dev);
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index f15f6e7..131404a 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -98,6 +98,7 @@ struct virtio_device {
struct list_head vqs;
/* Note that this is a Linux set_bit-style bitmap. */
unsigned long features[1];
+ bool surprize_removal;
void *priv;
};
--
1.8.3.1
next prev parent reply other threads:[~2013-11-27 10:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-27 10:32 [PATCH v3 RFC 0/4] virtio: add 'surprize_removal' to virtio_device Heinz Graalfs
2013-11-27 10:32 ` Heinz Graalfs [this message]
2013-11-27 10:32 ` [PATCH v3 RFC 2/4] virtio_blk: avoid further request queueing on device loss Heinz Graalfs
2013-12-04 4:04 ` Rusty Russell
2013-11-27 10:32 ` [PATCH v3 RFC 3/4] virtio_blk: avoid calling blk_cleanup_queue() " Heinz Graalfs
2013-11-27 10:47 ` Michael S. Tsirkin
2013-11-27 11:37 ` Heinz Graalfs
2013-11-27 12:28 ` Michael S. Tsirkin
2013-11-27 12:49 ` Michael S. Tsirkin
2013-11-27 14:15 ` Heinz Graalfs
2013-11-27 14:37 ` Michael S. Tsirkin
2013-11-27 10:32 ` [PATCH v3 RFC 4/4] virtio_ccw: set surprize_removal in virtio_device if a device was lost Heinz Graalfs
2013-11-27 10:49 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385548360-31943-2-git-send-email-graalfs@linux.vnet.ibm.com \
--to=graalfs@linux.vnet.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).