All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anthony PERARD" <anthony.perard@vates.tech>
To: qemu-devel@nongnu.org
Cc: "David Woodhouse" <dwmw@amazon.co.uk>,
	"Anthony PERARD" <anthony.perard@vates.tech>
Subject: [PULL 2/3] hw/xen: Add "mode" parameter to xen-block devices
Date: Mon, 10 Mar 2025 14:45:34 +0000	[thread overview]
Message-ID: <20250310144516.28828-3-anthony.perard@vates.tech> (raw)
In-Reply-To: <20250310144516.28828-1-anthony.perard@vates.tech>

From: David Woodhouse <dwmw@amazon.co.uk>

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>
---
 hw/block/xen-block.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 2098286b5f..ec04102b66 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);
-- 


Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


  parent reply	other threads:[~2025-03-10 15:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 14:45 [PULL 0/3] xen queue 2025-03-10 Anthony PERARD
2025-03-10 14:45 ` [PULL 1/3] xen/passthrough: use gsi to map pirq when dom0 is PVH Anthony PERARD
2025-03-10 14:45 ` Anthony PERARD [this message]
2025-03-10 14:45 ` [PULL 3/3] xen: No need to flush the mapcache for grants Anthony PERARD
2025-03-11  5:04 ` [PULL 0/3] xen queue 2025-03-10 Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250310144516.28828-3-anthony.perard@vates.tech \
    --to=anthony.perard@vates.tech \
    --cc=dwmw@amazon.co.uk \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.