diff options
-rw-r--r-- | drivers/block/xen-blkback/common.h | 9 | ||||
-rw-r--r-- | drivers/block/xen-blkback/xenbus.c | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index f65b807e3236..78b0411e5ed5 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h | |||
@@ -214,6 +214,15 @@ enum blkif_protocol { | |||
214 | BLKIF_PROTOCOL_X86_64 = 3, | 214 | BLKIF_PROTOCOL_X86_64 = 3, |
215 | }; | 215 | }; |
216 | 216 | ||
217 | /* | ||
218 | * Default protocol if the frontend doesn't specify one. | ||
219 | */ | ||
220 | #ifdef CONFIG_X86 | ||
221 | # define BLKIF_PROTOCOL_DEFAULT BLKIF_PROTOCOL_X86_32 | ||
222 | #else | ||
223 | # define BLKIF_PROTOCOL_DEFAULT BLKIF_PROTOCOL_NATIVE | ||
224 | #endif | ||
225 | |||
217 | struct xen_vbd { | 226 | struct xen_vbd { |
218 | /* What the domain refers to this vbd as. */ | 227 | /* What the domain refers to this vbd as. */ |
219 | blkif_vdev_t handle; | 228 | blkif_vdev_t handle; |
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index 630a489e757d..e3afe97280b1 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c | |||
@@ -868,11 +868,11 @@ static int connect_ring(struct backend_info *be) | |||
868 | return err; | 868 | return err; |
869 | } | 869 | } |
870 | 870 | ||
871 | be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE; | 871 | be->blkif->blk_protocol = BLKIF_PROTOCOL_DEFAULT; |
872 | err = xenbus_gather(XBT_NIL, dev->otherend, "protocol", | 872 | err = xenbus_gather(XBT_NIL, dev->otherend, "protocol", |
873 | "%63s", protocol, NULL); | 873 | "%63s", protocol, NULL); |
874 | if (err) | 874 | if (err) |
875 | strcpy(protocol, "unspecified, assuming native"); | 875 | strcpy(protocol, "unspecified, assuming default"); |
876 | else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) | 876 | else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) |
877 | be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE; | 877 | be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE; |
878 | else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32)) | 878 | else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32)) |