aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2025-02-07 14:37:24 +0000
committerAnthony PERARD <anthony.perard@vates.tech>2025-03-10 13:27:30 +0100
commit4173b3d83752d9547c188db0d99ade08a1adb1fc (patch)
tree6c6c882a80c8c2c92d733a9c2f7180467f60393d
parentcfcacbab38e43200264c06135946b1c5096c393a (diff)
downloadqemu-4173b3d83752d9547c188db0d99ade08a1adb1fc.zip
qemu-4173b3d83752d9547c188db0d99ade08a1adb1fc.tar.gz
qemu-4173b3d83752d9547c188db0d99ade08a1adb1fc.tar.bz2
hw/xen: Add "mode" parameter to xen-block devices
Block devices don't work in PV Grub (0.9x) if there is no mode specified. It complains: "Error ENOENT when reading the mode" Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Message-Id: <20250207143724.30792-2-dwmw2@infradead.org> Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
-rw-r--r--hw/block/xen-block.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 2098286..ec04102 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -408,6 +408,8 @@ static void xen_block_realize(XenDevice *xendev, Error **errp)
}
xen_device_backend_printf(xendev, "info", "%u", blockdev->info);
+ xen_device_backend_printf(xendev, "mode",
+ (blockdev->info & VDISK_READONLY) ? "r" : "w");
xen_device_frontend_printf(xendev, "virtual-device", "%lu",
vdev->number);