From: wyang <w90p710@gmail.com>
To: Vasiliy Tolstov <v.tolstov@selfip.ru>
Cc: qemu-devel@nongnu.org, jcody@redhat.com, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block/mirror: enable detect zeroes when driving mirror
Date: Tue, 22 Nov 2016 10:31:56 +0800 [thread overview]
Message-ID: <5833AE1C.2050708@gmail.com> (raw)
In-Reply-To: <CACaajQvCKxWib9E=a-k-3Bb0yWkP39CMb+95QaSQ-eq0+62HUQ@mail.gmail.com>
On 2016年11月21日 14:51, Vasiliy Tolstov wrote:
>
> 21 Ноя 2016 г. 4:27 пользователь "Yang Wei" <w90p710@gmail.com
> <mailto:w90p710@gmail.com>> написал:
> >
> > In order to preserve sparse disk image, detect_zeroes
> > should also be enabled when bdrv_get_block_status_above()
> > returns BDRV_BLOCK_DATA
> >
> > Signed-off-by: Yang Wei <w90p710@gmail.com <mailto:w90p710@gmail.com>>
> > ---
>
> Hi, does this patch fixes bug
> https://bugzilla.redhat.com/show_bug.cgi?id=1219541 ? Or it unrelated
> to this issue?
>
yes, you also need to backport the functionality of NBD's write
zeroes( fa778f and 1f4d6d)
Thanks
Wei
>
>
> > block/mirror.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/block/mirror.c b/block/mirror.c
> > index b2c1fb8..8b20b7a 100644
> > --- a/block/mirror.c
> > +++ b/block/mirror.c
> > @@ -76,6 +76,7 @@ typedef struct MirrorOp {
> > QEMUIOVector qiov;
> > int64_t sector_num;
> > int nb_sectors;
> > + BlockdevDetectZeroesOptions backup_detect_zeroes;
> > } MirrorOp;
> >
> > static BlockErrorAction mirror_error_action(MirrorBlockJob *s, bool
> read,
> > @@ -132,6 +133,8 @@ static void mirror_write_complete(void *opaque,
> int ret)
> > {
> > MirrorOp *op = opaque;
> > MirrorBlockJob *s = op->s;
> > + BlockDriverState *target = s->target;
> > + target->detect_zeroes = op->backup_detect_zeroes;
> > if (ret < 0) {
> > BlockErrorAction action;
> >
> > @@ -148,6 +151,7 @@ static void mirror_read_complete(void *opaque,
> int ret)
> > {
> > MirrorOp *op = opaque;
> > MirrorBlockJob *s = op->s;
> > + BlockDriverState *target = s->target;
> > if (ret < 0) {
> > BlockErrorAction action;
> >
> > @@ -160,6 +164,9 @@ static void mirror_read_complete(void *opaque,
> int ret)
> > mirror_iteration_done(op, ret);
> > return;
> > }
> > + op->backup_detect_zeroes = target->detect_zeroes;
> > + target->detect_zeroes = s->unmap ?
> BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP :
> > + BLOCKDEV_DETECT_ZEROES_OPTIONS_ON;
> > blk_aio_pwritev(s->target, op->sector_num * BDRV_SECTOR_SIZE,
> &op->qiov,
> > 0, mirror_write_complete, op);
> > }
> > --
> > 2.10.2
> >
> >
>
next prev parent reply other threads:[~2016-11-22 2:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-21 1:24 [Qemu-devel] [PATCH] block/mirror: enable detect zeroes when driving mirror Yang Wei
2016-11-21 1:34 ` no-reply
2016-11-21 6:51 ` Vasiliy Tolstov
2016-11-22 2:31 ` wyang [this message]
2016-11-22 13:44 ` Eric Blake
2016-11-23 3:14 ` wyang
2016-11-21 11:34 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2016-11-22 3:45 ` wyang
2016-11-22 10:09 ` Kevin Wolf
2016-11-23 3:12 ` wyang
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=5833AE1C.2050708@gmail.com \
--to=w90p710@gmail.com \
--cc=jcody@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=v.tolstov@selfip.ru \
/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.