* [Qemu-devel] [PATCH] Fix COR by disabling BDRV_O_COPY_ON_READ before opening the backing_file.
@ 2013-10-25 0:15 Thibaut LAURENT
2013-10-26 13:31 ` Max Reitz
2013-10-28 15:08 ` Benoît Canet
0 siblings, 2 replies; 4+ messages in thread
From: Thibaut LAURENT @ 2013-10-25 0:15 UTC (permalink / raw)
To: qemu-devel; +Cc: Thibaut LAURENT
Since commit 0ebd24e0a203cf2852c310b59fbe050190dc6c8c,
bdrv_open_common will throw an error when trying to open a file
read-only with the BDRV_O_COPY_ON_READ flag set.
Although BDRV_O_RDWR is unset for the backing files,
BDRV_O_COPY_ON_READ is still passed on if copy-on-read was requested
for the drive. Let's unset this flag too before opening the backing
file, or bdrv_open_common will fail.
Signed-off-by: Thibaut LAURENT <thibaut.laurent@gmail.com>
---
block.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index fd05a80..4474012 100644
--- a/block.c
+++ b/block.c
@@ -999,7 +999,8 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
}
/* backing files always opened read-only */
- back_flags = bs->open_flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT);
+ back_flags = bs->open_flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT |
+ BDRV_O_COPY_ON_READ);
ret = bdrv_open(bs->backing_hd,
*backing_filename ? backing_filename : NULL, options,
--
1.8.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix COR by disabling BDRV_O_COPY_ON_READ before opening the backing_file.
2013-10-25 0:15 [Qemu-devel] [PATCH] Fix COR by disabling BDRV_O_COPY_ON_READ before opening the backing_file Thibaut LAURENT
@ 2013-10-26 13:31 ` Max Reitz
2013-10-29 11:56 ` Kevin Wolf
2013-10-28 15:08 ` Benoît Canet
1 sibling, 1 reply; 4+ messages in thread
From: Max Reitz @ 2013-10-26 13:31 UTC (permalink / raw)
To: Thibaut LAURENT, qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi
Am 25.10.2013 02:15, schrieb Thibaut LAURENT:
> Since commit 0ebd24e0a203cf2852c310b59fbe050190dc6c8c,
> bdrv_open_common will throw an error when trying to open a file
> read-only with the BDRV_O_COPY_ON_READ flag set.
> Although BDRV_O_RDWR is unset for the backing files,
> BDRV_O_COPY_ON_READ is still passed on if copy-on-read was requested
> for the drive. Let's unset this flag too before opening the backing
> file, or bdrv_open_common will fail.
>
> Signed-off-by: Thibaut LAURENT <thibaut.laurent@gmail.com>
> ---
> block.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Max Reitz <mreitz@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix COR by disabling BDRV_O_COPY_ON_READ before opening the backing_file.
2013-10-25 0:15 [Qemu-devel] [PATCH] Fix COR by disabling BDRV_O_COPY_ON_READ before opening the backing_file Thibaut LAURENT
2013-10-26 13:31 ` Max Reitz
@ 2013-10-28 15:08 ` Benoît Canet
1 sibling, 0 replies; 4+ messages in thread
From: Benoît Canet @ 2013-10-28 15:08 UTC (permalink / raw)
To: Thibaut LAURENT; +Cc: qemu-devel
Le Friday 25 Oct 2013 à 02:15:07 (+0200), Thibaut LAURENT a écrit :
> Since commit 0ebd24e0a203cf2852c310b59fbe050190dc6c8c,
> bdrv_open_common will throw an error when trying to open a file
> read-only with the BDRV_O_COPY_ON_READ flag set.
> Although BDRV_O_RDWR is unset for the backing files,
> BDRV_O_COPY_ON_READ is still passed on if copy-on-read was requested
> for the drive. Let's unset this flag too before opening the backing
> file, or bdrv_open_common will fail.
>
> Signed-off-by: Thibaut LAURENT <thibaut.laurent@gmail.com>
> ---
> block.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/block.c b/block.c
> index fd05a80..4474012 100644
> --- a/block.c
> +++ b/block.c
> @@ -999,7 +999,8 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
> }
>
> /* backing files always opened read-only */
> - back_flags = bs->open_flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT);
> + back_flags = bs->open_flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT |
> + BDRV_O_COPY_ON_READ);
>
> ret = bdrv_open(bs->backing_hd,
> *backing_filename ? backing_filename : NULL, options,
> --
> 1.8.4.1
>
>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix COR by disabling BDRV_O_COPY_ON_READ before opening the backing_file.
2013-10-26 13:31 ` Max Reitz
@ 2013-10-29 11:56 ` Kevin Wolf
0 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2013-10-29 11:56 UTC (permalink / raw)
To: Max Reitz; +Cc: Thibaut LAURENT, qemu-devel, Stefan Hajnoczi
Am 26.10.2013 um 15:31 hat Max Reitz geschrieben:
> Am 25.10.2013 02:15, schrieb Thibaut LAURENT:
> > Since commit 0ebd24e0a203cf2852c310b59fbe050190dc6c8c,
> > bdrv_open_common will throw an error when trying to open a file
> > read-only with the BDRV_O_COPY_ON_READ flag set.
> > Although BDRV_O_RDWR is unset for the backing files,
> > BDRV_O_COPY_ON_READ is still passed on if copy-on-read was requested
> > for the drive. Let's unset this flag too before opening the backing
> > file, or bdrv_open_common will fail.
> >
> > Signed-off-by: Thibaut LAURENT <thibaut.laurent@gmail.com>
> > ---
> > block.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Reviewed-by: Max Reitz <mreitz@redhat.com>
Thanks, applied to the block branch. (And thanks for CCing me, Max, I
would have missed the patch otherwise.)
Kevin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-29 11:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-25 0:15 [Qemu-devel] [PATCH] Fix COR by disabling BDRV_O_COPY_ON_READ before opening the backing_file Thibaut LAURENT
2013-10-26 13:31 ` Max Reitz
2013-10-29 11:56 ` Kevin Wolf
2013-10-28 15:08 ` Benoît Canet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).