qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Add readonly flag to -drive command


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] Add readonly flag to -drive command
Date: Mon, 12 Oct 2009 09:06:44 -0500
User-agent: Thunderbird 2.0.0.23 (X11/20090825)

Kevin Wolf wrote:
Am 12.10.2009 14:47, schrieb Naphtali Sprei:
In order to safely share an image between guests (as read only drive), add a 
'readonly' flag
to the -drive command (qemu command line and monitor).

Still missing passing the read only attribute to the guest, where possible. I 
don't know which device types supports
read only, and don't know how to pass this information to guests.

Also not sure what to do when qemu cannot open the file as writeable. Currently 
it opens it as read only.
We might change it to give a warning or even an error.

From 6e297da79a4c015555e3927e6d28744933a31ebe Mon Sep 17 00:00:00 2001
From: Naphtali Sprei <address@hidden>
Date: Mon, 12 Oct 2009 14:25:25 +0200
Subject: [PATCH] Added readonly flag to -drive command.
 This enables sharing same image between guests, with readonly access.
 Implementaion mark the drive as read_only and changes the flags when actually 
opening the file.

Is this enough? Basically none of the block drivers know that their
image could be read-only, so we'll likely trigger some unexpected error
cases there. For a simple write I guess we'll be okay (not sure if we'll
return the right error code, though), but I have no idea what, say,
savevm would do with a read-only image.

Yes, this is why patches like this have been rejected in the past. This concept needs to be plumbed to the device emulation so that a guest realizes it has a read-only disk. Throwing away writes without telling the guest is a recipe for disaster.

Regards,

Anthony Liguori




reply via email to

[Prev in Thread] Current Thread [Next in Thread]