[PATCH 4/4] lguest: GET_ID "support"

From: Rusty Russell
Date: Tue Sep 29 2009 - 13:19:04 EST



We advertise the feature for testing, then promptly fail when the guest
uses it.

Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
---
Documentation/lguest/lguest.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -1654,7 +1654,11 @@ static void blk_request(struct virtqueue
* In general the virtio block driver is allowed to try SCSI commands.
* It'd be nice if we supported eject, for example, but we don't.
*/
- if (out->type & VIRTIO_BLK_T_SCSI_CMD) {
+ if (out->type == VIRTIO_BLK_T_GET_ID) {
+ fprintf(stderr, "GET ID command unsupported\n");
+ *in = VIRTIO_BLK_S_UNSUPP;
+ wlen = sizeof(*in);
+ } else if (out->type & VIRTIO_BLK_T_SCSI_CMD) {
fprintf(stderr, "Scsi commands unsupported\n");
*in = VIRTIO_BLK_S_UNSUPP;
wlen = sizeof(*in);
@@ -1751,6 +1755,9 @@ static void setup_block_file(const char
add_feature(dev, VIRTIO_BLK_F_SEG_MAX);
conf.seg_max = cpu_to_le32(VIRTQUEUE_NUM - 2);

+ /* We have GET_ID, at least for testing! */
+ add_feature(dev, VIRTIO_BLK_F_GET_ID);
+
/*
* We only have 8 bits of configuration space for each device. But a
* new feature for virtio_blk added a 1k 'identify' field to struct

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/