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

[Xen-changelog] [linux-2.6.18-xen] block backends: adjust protocol negotiation



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1332940071 -7200
# Node ID 56e7b5175d61e16d4da6ad89c2929513da479f6c
# Parent  f8805d3fc263d247e1e27666a8c2e092956ccf21
block backends: adjust protocol negotiation

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>
---


diff -r f8805d3fc263 -r 56e7b5175d61 drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c      Mon Mar 26 11:50:02 2012 +0200
+++ b/drivers/xen/blkback/xenbus.c      Wed Mar 28 15:07:51 2012 +0200
@@ -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);
diff -r f8805d3fc263 -r 56e7b5175d61 drivers/xen/blktap/xenbus.c
--- a/drivers/xen/blktap/xenbus.c       Mon Mar 26 11:50:02 2012 +0200
+++ b/drivers/xen/blktap/xenbus.c       Wed Mar 28 15:07:51 2012 +0200
@@ -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);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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