= bdrv_open(bs_ro, filename, open_flags & ~BDRV_O_RDWR, NULL);
> +ret = bdrv_open(bs_ro, filename, open_flags & ~BDRV_O_RDWR, drv);
> if (ret < 0) {
> bdrv_delete(bs_ro);
> /* drive not functional anymore */
Acked-by: Naphtali Sprei
Current code of monitor command: 'change', used to open file for read-write
uncoditionally. Change to open it as read-only for CDROM, and read-write for
all others.
Signed-off-by: Naphtali Sprei
---
monitor.c |4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a
v1 -> v2
cosmetic change of if block arrangement
Signed-off-by: Naphtali Sprei
---
vl.c | 13 +
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/vl.c b/vl.c
index d69250c..11c68f2 100644
--- a/vl.c
+++ b/vl.c
@@ -1222,19 +1222,16 @@ DriveInfo *drive_init(QemuO
Signed-off-by: Naphtali Sprei
---
vl.c | 13 +
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/vl.c b/vl.c
index 2e38b77..d3863d7 100644
--- a/vl.c
+++ b/vl.c
@@ -1255,19 +1255,16 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
bdrv_flags
Really use read-only flags for opening the file when asked for read-only
Signed-off-by: Naphtali Sprei
---
qemu-nbd.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/qemu-nbd.c b/qemu-nbd.c
index eac0c21..a393583 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -258,6 +258,7
Don't rely on CDROM hint for read_only attribute
Signed-off-by: Naphtali Sprei
---
hw/scsi-disk.c |3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 8f7ffc1..5cd6ae6 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -612,8 +
Really use read-only flags for opening the file when asked for read-only
Signed-off-by: Naphtali Sprei
---
qemu-nbd.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/qemu-nbd.c b/qemu-nbd.c
index eac0c21..d803bfd 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -258,6 +258,7
Stefan Weil wrote:
> This command used to work, but fails now:
>
> $ i386-softmmu/qemu -snapshot /dev/sda
> qemu: could not open disk image /dev/sda: Permission denied
>
> $ ls -l /dev/sda
> brw-rw-r-- 1 root disk 8, 0 13. Feb 08:55 /dev/sda
>
> The original file of a snapshot needs only read ac
Open backing file read-only where possible
Upgrade backing file to read-write during commit, back to read-only after commit
If upgrade fail, back to read-only. If also fail, "disconnect" the drive.
Signed-off-by: Naphtali Sprei
---
block.c
Anthony Liguori wrote:
> On 01/28/2010 08:15 PM, Sheng Yang wrote:
>> Commit 03cbdac7 "Disable fall-back to read-only when cannot open drive's
>> file for read-write" result in read-only image can't be used as backed
>> image in qemu-img.
>>
>
option for qemu-img.c bdrv_new_open() to open file as read-only
Signed-off-by: Naphtali Sprei
---
block.c | 80 +++---
block_int.h |2 +
qemu-img.c | 15 +++---
3 files changed, 82 insertions(+), 15 deletions(-)
diff --git a
patch by Sheng Yang
Signed-off-by: Naphtali Sprei
---
block.c | 75 +++
block_int.h |2 +
qemu-img.c | 15
3 files changed, 77 insertions(+), 15 deletions(-)
diff --git a/block.c b/block.c
index 1919d19..be5f000
Open image file read-only where possible
Patch originally written by Sheng Yang
Signed-off-by: Naphtali Sprei
---
qemu-img.c | 15 ++-
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index cbba4fc..b0ac9eb 100644
--- a/qemu-img.c
+++ b/qemu
Open backing file for read-only
During commit upgrade to read-write and back at end to read-only
Signed-off-by: Naphtali Sprei
---
block.c | 68 ---
block_int.h |1 +
2 files changed, 61 insertions(+), 8 deletions(-)
diff --git
Signed-off-by: Naphtali Sprei
---
block.c | 10 +-
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/block.c b/block.c
index 4a9df91..780cea9 100644
--- a/block.c
+++ b/block.c
@@ -483,19 +483,11 @@ int bdrv_open2(BlockDriverState *bs, const char
*filename, int flags
Signed-off-by: Naphtali Sprei
---
block.c |1 +
block_int.h |1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/block.c b/block.c
index 1919d19..66564de 100644
--- a/block.c
+++ b/block.c
@@ -363,6 +363,7 @@ int bdrv_open2(BlockDriverState *bs, const char *filename
This is version 2. The change between previous patch (only 3/4) is the order of
closing/re-opening the image.
Naphtali Sprei (4):
Add open_flags to BlockDriverState Will be used later
qemu-img: Fix qemu-img can't create qcow image based on read-only
image
Block: readonly changes
Open image file read-only where possible
Patch originally written by Sheng Yang
Signed-off-by: Naphtali Sprei
---
qemu-img.c | 15 ++-
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index cbba4fc..b0ac9eb 100644
--- a/qemu-img.c
+++ b/qemu
Naphtali Sprei wrote:
> This is version 2. The change between previous patch (only 3/4) is the order
> of closing/re-opening the image.
Sorry,
patch sent without the change of version 2 (in 3/4).
Will send later.
Naphtali
Signed-off-by: Naphtali Sprei
---
block.c | 10 +-
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/block.c b/block.c
index 527b146..1db9961 100644
--- a/block.c
+++ b/block.c
@@ -483,19 +483,11 @@ int bdrv_open2(BlockDriverState *bs, const char
*filename, int flags
Open backing file for read-only
During commit upgrade to read-write and back at end to read-only
Signed-off-by: Naphtali Sprei
---
block.c | 64 +++---
block_int.h |1 +
2 files changed, 57 insertions(+), 8 deletions(-)
diff --git a
Signed-off-by: Naphtali Sprei
---
block.c |1 +
block_int.h |1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/block.c b/block.c
index 1919d19..66564de 100644
--- a/block.c
+++ b/block.c
@@ -363,6 +363,7 @@ int bdrv_open2(BlockDriverState *bs, const char *filename
-write only for commit, and back to read-only when done.
Naphtali Sprei (4):
Add open_flags to BlockDriverState Will be used later
qemu-img: Fix qemu-img can't create qcow image based on read-only
image
Block: readonly changes
Open backing file read-only also for snapshot mode
Open image file read-only where possible
Patch originally written by Sheng Yang
Signed-off-by: Naphtali Sprei
---
qemu-img.c | 15 ++-
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index cbba4fc..b0ac9eb 100644
--- a/qemu-img.c
+++ b/qemu
Jamie Lokier wrote:
> Naphtali Sprei wrote:
>> Open backing file for read-only
>> During commit upgrade to read-write and back at end to read-only
>
>> +if (ro) { /* re-open as RO */
>> +bs_ro = bdrv_new("");
>> +ret = bdrv_
Signed-off-by: Naphtali Sprei
---
block.c | 10 +-
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/block.c b/block.c
index 527b146..1db9961 100644
--- a/block.c
+++ b/block.c
@@ -483,19 +483,11 @@ int bdrv_open2(BlockDriverState *bs, const char
*filename, int flags
Open backing file for read-only
During commit upgrade to read-write and back at end to read-only
Signed-off-by: Naphtali Sprei
---
block.c | 64 +++---
block_int.h |1 +
2 files changed, 57 insertions(+), 8 deletions(-)
diff --git a
Open image file read-only where possible
Patch originally written by Sheng Yang
Signed-off-by: Naphtali Sprei
---
qemu-img.c | 15 ++-
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index cbba4fc..b0ac9eb 100644
--- a/qemu-img.c
+++ b/qemu
Signed-off-by: Naphtali Sprei
---
block.c |1 +
block_int.h |1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/block.c b/block.c
index 1919d19..66564de 100644
--- a/block.c
+++ b/block.c
@@ -363,6 +363,7 @@ int bdrv_open2(BlockDriverState *bs, const char *filename
The read-only changes broke qemu-img create with read-only base image
These changes fix it.
It also make things a little safer, opening the backing file for read-only,
upgrading to read-write only for commit, and back to read-only when done.
Naphtali Sprei (4):
Add open_flags to
Hi,
when I use a qcow2 image based on a base image, what should happen when I
invoke the commit command from the qemu monitor ?
Is it expected/intended to "flush" the data into the base image ?
IIUC, that is what happening in the released qemu (0.12).
I would expect it not to touch the base image.
file with read-only mode ? this will be
more consistent/predictable ?
Or is it better not to fall-back to read-only ? Will a warning message help ?
TIA,
Naphtali
>From 4a10750f5c91b1383118e4421f6b8d3ff3e79b2f Mon Sep 17 00:00:00 2001
From: Naphtali Sprei
Date: Sun, 31 Jan 2010 18:2
Sheng Yang wrote:
> Commit 03cbdac7 "Disable fall-back to read-only when cannot open drive's
> file for read-write" result in read-only image can't be used as backed
> image in qemu-img.
>
> Cc: Naphtali Sprei
> Signed-off-by: Sheng Yang
Acked-by: Napht
Sheng Yang wrote:
> Commit 03cbdac7 "Disable fall-back to read-only when cannot open drive's
> file for read-write" result in read-only image can't be used as backed
> image in qemu-img.
>
> CC: Naphtali Sprei
> Signed-off-by: Sheng Yang
> ---
>
&g
Christoph Hellwig wrote:
> Looking at the version of this that landed in git I don't think the
> read-only handling is entirely clean after this.
I fixed what I could, still I got some questions below.
>
> - we now normally set the read_only flag from bdrv_open2 when we do
>not have the O_R
Signed-off-by: Naphtali Sprei
---
block/bochs.c |6 ++
block/parallels.c |6 ++
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/block/bochs.c b/block/bochs.c
index 3489258..fb83594 100644
--- a/block/bochs.c
+++ b/block/bochs.c
@@ -116,11 +116,9 @@ static int
Found some places that seems needs this explicitly, now that
read-write is not the default.
Signed-off-by: Naphtali Sprei
---
block/qcow2.c |2 +-
block/vvfat.c |2 +-
qemu-img.c|4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
Found some places that seems needs this explicitly, now that
read-write is not the default.
Signed-off-by: Naphtali Sprei
---
block/qcow2.c |2 +-
block/vvfat.c |2 +-
qemu-img.c|4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
Signed-off-by: Naphtali Sprei
---
block.c |7 ---
block.h |1 -
2 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/block.c b/block.c
index 73c26ec..8378c18 100644
--- a/block.c
+++ b/block.c
@@ -1009,13 +1009,6 @@ int bdrv_is_read_only(BlockDriverState *bs)
return
Signed-off-by: Naphtali Sprei
---
block.c |7 ---
block.h |1 -
2 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/block.c b/block.c
index 73c26ec..8378c18 100644
--- a/block.c
+++ b/block.c
@@ -1009,13 +1009,6 @@ int bdrv_is_read_only(BlockDriverState *bs)
return
*** BLURB HERE ***
Naphtali Sprei (3):
No need anymore for bdrv_set_read_only
Ask for read-write permissions when opening files where needed
Read-only device changed to opens it's file for read-only.
block.c |7 ---
block.h |1 -
block/bochs.c |
*** BLURB HERE ***
Naphtali Sprei (3):
No need anymoe for bdrv_set_read_only
Ask for read-write permissions when opening files
Read-only device changed to opens it's file for read-only.
block.c |7 ---
block.h |1 -
block/bochs.c |6 ++
o
check return value.
Naphtali Sprei (3):
No need anymore for bdrv_set_read_only
Ask for read-write permissions when opening files where needed
Read-only device changed to opens it's file for read-only.
block.c |7 ---
block.h |1 -
block/bochs.c
Michael S. Tsirkin wrote:
> On Sun, Jan 17, 2010 at 04:48:15PM +0200, Naphtali Sprei wrote:
>> Signed-off-by: Naphtali Sprei
>> ---
>> block.c |6 --
>> 1 files changed, 0 insertions(+), 6 deletions(-)
>>
>> diff --git a/block.c b/block.c
>> i
Michael S. Tsirkin wrote:
> On Sun, Jan 17, 2010 at 04:48:13PM +0200, Naphtali Sprei wrote:
>> Instead of using the field 'readonly' of the BlockDriverState struct for
>> passing the request,
>> pass the request in the flags parameter to the function.
>
Signed-off-by: Naphtali Sprei
---
block.c |6 --
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/block.c b/block.c
index 8def3c4..f90e983 100644
--- a/block.c
+++ b/block.c
@@ -444,8 +444,6 @@ int bdrv_open2(BlockDriverState *bs, const char *filename,
int flags,
if
Signed-off-by: Naphtali Sprei
---
qemu-options.hx |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index e2edd71..4617867 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -103,7 +103,7 @@ DEF("drive", HAS_ARG, QEMU_OP
Instead of using the field 'readonly' of the BlockDriverState struct for
passing the request,
pass the request in the flags parameter to the function.
Signed-off-by: Naphtali Sprei
---
block.c | 31 +--
block.h |2 --
block/r
Signed-off-by: Naphtali Sprei
---
vl.c |7 +++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/vl.c b/vl.c
index 06cb40d..76ef8ca 100644
--- a/vl.c
+++ b/vl.c
@@ -2233,6 +2233,13 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
}
(void
This is version 2, to replace previous set.
Addresses all Kevin comments.
Naphtali Sprei (4):
Make CDROM a read-only drive
Clean-up a little bit the RW related bits of BDRV_O_FLAGS.
BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for
bdrv_flags (0/zero) is READ-ONLY. Need
Signed-off-by: Naphtali Sprei
---
block.c |4
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index cbd72cc..0b4b9ad 100644
--- a/block.c
+++ b/block.c
@@ -457,10 +457,6 @@ int bdrv_open2(BlockDriverState *bs, const char *filename,
int flags
uest,
pass the request in the flags parameter to the function.
Signed-off-by: Naphtali Sprei
---
block.c | 33 +
block.h |4 ++--
block/raw-posix.c |2 +-
block/raw-win32.c |4 ++--
block/vmdk.c |9 +
hw/
Signed-off-by: Naphtali Sprei
---
vl.c |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/vl.c b/vl.c
index 06cb40d..4f19505 100644
--- a/vl.c
+++ b/vl.c
@@ -2234,6 +2234,10 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
(void)bdrv_set_read_only(dinfo
Naphtali Sprei (3):
Make CDROM a read-only drive
Switch to bit-flags based read-only drive option implementation
Disable fall-back to read-only when cannot open drive's file for
read-write
block.c | 29 +
block.h |4 ++--
bloc
Jamie Lokier wrote:
> Anthony Liguori wrote:
>> On 12/24/2009 03:09 AM, Markus Armbruster wrote:
>>> Naphtali Sprei writes:
>>>
>>>> Added 'access' option to -drive flag
>>>>
>>>> The new option is: access=[rw|ro|auto]
>
The new option is: access=[rw|ro|auto]
rw: open the drive's file with Read and Write permission, don't continue if
failed
ro: open the file only with Read permission
auto: open the file with Read and Write permission, if failed, try only Read
permision
For compatibility reasons, the default is
Simon Horman wrote:
> On Wed, Dec 23, 2009 at 02:12:23PM +0200, Naphtali Sprei wrote:
>> Added 'access' option to -drive flag
>>
>> The new option is: access=[rw|ro|auto]
>> rw: open the drive's file with Read and Write permission, don't continue if
st in the flags parameter to the function.
Signed-off-by: Naphtali Sprei
---
block.c | 27 +++
block.h |6 --
block/raw-posix.c |2 +-
block/raw-win32.c |4 ++--
hw/xen_disk.c |3 ++-
monitor.c |2 +-
qemu-
write permission and if fails, fall-back to
read-only (the default if nothing specified)
Suggestions for better naming for flag/values welcomed.
I've tried to explicitly pass the required flags for the bdrv_open function in
callers, but probably missed some.
Naphtali
Signed-off-by: N
UNIT ATTENTION state upon reset (as per spec)
o always print the file-name in info block command (if applicable)
Relevant Spec: Mt. Fuji Commands for Multimedia Devices Version 7:
ftp://ftp.seagate.com/sff/INF-8090.PDF
Signed-off-by: Naphtali Sprei
---
block.c |
Kevin O'Connor wrote:
> Hi,
>
> On Thu, Nov 12, 2009 at 01:20:58PM +0200, Naphtali Sprei wrote:
>> I've found a problem with the usage of SeaBIOS/gPXE in Qemu. The
>> scenario is when failing to boot from network and falling back to
>> booting from hard-disk
,
Naphtali
Patch against current SeaBIOS git
Signed-off-by: Naphtali Sprei
---
src/arch/i386/prefix/pxeprefix.S |2 +-
src/arch/i386/prefix/romprefix.S |2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/arch/i386/prefix/pxeprefix.S b/src/arch/i386/prefix/pxepr
aging tree, nor committed.
So here is the missing patch again, against current head.
Naphtali
Subject: [PATCH] Pass the drive's readonly attribute to the guest OS
Implemented for virtio-blk and for scsi
Signed-off-by: Naphtali Sprei
---
hw/scsi-disk.c |3 ++-
hw/virtio-blk.c |3 ++
Now qemu_error can be called also from shared files, e.g. block.c.
Signed-off-by: Naphtali Sprei
---
qemu-tool.c |9 +
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/qemu-tool.c b/qemu-tool.c
index ba24aa2..186c4f7 100644
--- a/qemu-tool.c
+++ b/qemu-tool.c
@@ -88,3
Hi,
I've added a call to qemu_error in block.c file, and got a link error on the
qemu-utilities: qemu-img, qemu-nbd and qemu-io.
Should there be a stub that implements a qemu_error to be linked with those
apps ? Am I missing something ?
In my case, I couldn't let the caller report the error (and
nly flag.
Also, return error code from bdrv_truncate for readonly drive.
Signed-off-by: Naphtali Sprei
---
block.c | 19 +++
block.h |1 +
qemu-config.c |3 +++
vl.c | 10 ++
4 files changed, 29 insertions(+), 4 deletions(-)
diff --
66 matches
Mail list logo