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