Skip to content

Commit 4173b3d

Browse files
dwmw2tperard
authored andcommitted
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 <[email protected]> Message-Id: <[email protected]> Signed-off-by: Anthony PERARD <[email protected]>
1 parent cfcacba commit 4173b3d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hw/block/xen-block.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ static void xen_block_realize(XenDevice *xendev, Error **errp)
408408
}
409409

410410
xen_device_backend_printf(xendev, "info", "%u", blockdev->info);
411+
xen_device_backend_printf(xendev, "mode",
412+
(blockdev->info & VDISK_READONLY) ? "r" : "w");
411413

412414
xen_device_frontend_printf(xendev, "virtual-device", "%lu",
413415
vdev->number);

0 commit comments

Comments
 (0)