aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-09-06 11:43:18 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-09-06 11:43:18 +0100
commit1fd66154fdf8305e6668a96046a22b863b4d7320 (patch)
treec91f14180ed9641e7d4833268dfd339e858a908a
parente87d397e5ef66276ccc49b829527d605ca07d0ad (diff)
parent4ada797b05a52ac824a710c67216b37739026a64 (diff)
Merge remote-tracking branch 'remotes/sstabellini/tags/xen-20160905' into staging
Xen 2016/09/05 # gpg: Signature made Mon 05 Sep 2016 19:59:47 BST # gpg: using RSA key 0x894F8F4870E1AE90 # gpg: Good signature from "Stefano Stabellini <stefano.stabellini@eu.citrix.com>" # Primary key fingerprint: D04E 33AB A51F 67BA 07D3 0AEA 894F 8F48 70E1 AE90 * remotes/sstabellini/tags/xen-20160905: xen: use native disk xenbus protocol if possible Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/block/xen_disk.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 3b8ad33fc5..342868904d 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -976,14 +976,16 @@ static int blk_connect(struct XenDevice *xendev)
blkdev->feature_persistent = !!pers;
}
- blkdev->protocol = BLKIF_PROTOCOL_NATIVE;
- if (blkdev->xendev.protocol) {
- if (strcmp(blkdev->xendev.protocol, XEN_IO_PROTO_ABI_X86_32) == 0) {
- blkdev->protocol = BLKIF_PROTOCOL_X86_32;
- }
- if (strcmp(blkdev->xendev.protocol, XEN_IO_PROTO_ABI_X86_64) == 0) {
- blkdev->protocol = BLKIF_PROTOCOL_X86_64;
- }
+ if (!blkdev->xendev.protocol) {
+ blkdev->protocol = BLKIF_PROTOCOL_NATIVE;
+ } else if (strcmp(blkdev->xendev.protocol, XEN_IO_PROTO_ABI_NATIVE) == 0) {
+ blkdev->protocol = BLKIF_PROTOCOL_NATIVE;
+ } else if (strcmp(blkdev->xendev.protocol, XEN_IO_PROTO_ABI_X86_32) == 0) {
+ blkdev->protocol = BLKIF_PROTOCOL_X86_32;
+ } else if (strcmp(blkdev->xendev.protocol, XEN_IO_PROTO_ABI_X86_64) == 0) {
+ blkdev->protocol = BLKIF_PROTOCOL_X86_64;
+ } else {
+ blkdev->protocol = BLKIF_PROTOCOL_NATIVE;
}
blkdev->sring = xengnttab_map_grant_ref(blkdev->xendev.gnttabdev,