qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: kwolf@redhat.com, hangaohuai@huawei.com,
	zhang.zhanghailiang@huawei.com, lizhijian@cn.fujitsu.com,
	mst@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com,
	arei.gonglei@huawei.com, stefanha@redhat.com,
	amit.shah@redhat.com, dgibson@redhat.com,
	peter.huangpeng@huawei.com
Subject: Re: [Qemu-devel] [PATCH] virtio-blk: correctly dirty guest memory
Date: Thu, 02 Apr 2015 17:21:05 +0200	[thread overview]
Message-ID: <551D5E61.7090305@redhat.com> (raw)
In-Reply-To: <20150402151650.GK15412@fam-t430.nay.redhat.com>



On 02/04/2015 17:16, Fam Zheng wrote:
>>>> > >> After qemu_iovec_destroy, the QEMUIOVector's size is zeroed and
>>>> > >> the zero size ultimately is used to compute virtqueue_push's len
>>>> > >> argument.  Therefore, reads from virtio-blk devices did not
>>>> > >> migrate their results correctly.  (Writes were okay).
>>> > > 
>>> > > Can't we move qemu_iovec_destroy to virtio_blk_free_request?
>> > 
>> > You would still have to add more code to differentiate reads and
>> > writes---I think.
> Yeah, but the extra field will not be needed.

Can you post an alternative patch?  One small complication is that
is_write is in mrb but not in mrb->reqs[x].  virtio_blk_rw_complete is
already doing

    int p = virtio_ldl_p(VIRTIO_DEVICE(req->dev), &req->out.type);
    bool is_read = !(p & VIRTIO_BLK_T_OUT);

but only in a slow path.

Paolo

  reply	other threads:[~2015-04-02 15:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 13:37 [Qemu-devel] [PATCH] virtio-blk: correctly dirty guest memory Paolo Bonzini
2015-04-02 14:39 ` Fam Zheng
2015-04-02 14:51   ` Paolo Bonzini
2015-04-02 15:16     ` Fam Zheng
2015-04-02 15:21       ` Paolo Bonzini [this message]
2015-04-02 16:26         ` Fam Zheng
2015-04-02 16:36           ` Paolo Bonzini
2015-04-03  1:22           ` Wen Congyang
2015-04-03  2:47           ` Bin Wu

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=551D5E61.7090305@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=dgibson@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=famz@redhat.com \
    --cc=hangaohuai@huawei.com \
    --cc=kwolf@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=mst@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /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 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).