[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] linux-2.6.18/block backends: adjust protocol negotiation


  • To: "xen-devel" <xen-devel@xxxxxxxxxxxxx>
  • From: "Jan Beulich" <JBeulich@xxxxxxxx>
  • Date: Mon, 26 Mar 2012 15:06:04 +0100
  • Delivery-date: Mon, 26 Mar 2012 14:05:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

The changes in c/s 1168:8940ccd0a425 resulted in the native not getting
selected anymore, resulting in more involved copying of individual
requests. Adjust the negotiation code so that it'll pick the native one
again if the frontend matches.

The initialization code can be considerably shrunk by using a macro to
abstract out the code common for all variants.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/drivers/xen/blkback/xenbus.c
+++ b/drivers/xen/blkback/xenbus.c
@@ -497,10 +497,14 @@ static int connect_ring(struct backend_i
        protocol = xenbus_read(XBT_NIL, dev->otherend, "protocol", NULL);
        if (IS_ERR(protocol))
                protocol = NULL;
+#ifndef CONFIG_X86_32
        else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
                be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
+#endif
+#ifndef CONFIG_X86_64
        else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
                be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_64;
+#endif
        else if (0 != strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) {
                xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
                kfree(protocol);
--- a/drivers/xen/blktap/xenbus.c
+++ b/drivers/xen/blktap/xenbus.c
@@ -450,10 +450,14 @@ static int connect_ring(struct backend_i
        protocol = xenbus_read(XBT_NIL, dev->otherend, "protocol", NULL);
        if (IS_ERR(protocol))
                protocol = NULL;
+#ifndef CONFIG_X86_32
        else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
                be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
+#endif
+#ifndef CONFIG_X86_64
        else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
                be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_64;
+#endif
        else if (0 != strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) {
                xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
                kfree(protocol);



Attachment: xen-blk-backends-protocol-adjust.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.