From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Max Reitz <mreitz@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] block/stream: Don't stream unbacked devices
Date: Thu, 14 Nov 2013 11:00:57 +0800 [thread overview]
Message-ID: <52843CE9.40102@linux.vnet.ibm.com> (raw)
In-Reply-To: <1384371478-20021-1-git-send-email-mreitz@redhat.com>
于 2013/11/14 3:37, Max Reitz 写道:
> If a block device is unbacked, a streaming blockjob should immediately
> finish instead of beginning to try to stream, then noticing the backing
> file does not contain even the first sector (since it does not exist)
> and then finishing normally.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> block/stream.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/block/stream.c b/block/stream.c
> index 694fd42..46bec7d 100644
> --- a/block/stream.c
> +++ b/block/stream.c
> @@ -88,6 +88,11 @@ static void coroutine_fn stream_run(void *opaque)
> int n = 0;
> void *buf;
>
> + if (!bs->backing_hd) {
> + block_job_completed(&s->common, 0);
> + return;
> + }
> +
> s->common.len = bdrv_getlength(bs);
> if (s->common.len < 0) {
> block_job_completed(&s->common, s->common.len);
>
Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
next prev parent reply other threads:[~2013-11-14 3:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 19:37 [Qemu-devel] [PATCH] block/stream: Don't stream unbacked devices Max Reitz
2013-11-14 3:00 ` Wenchao Xia [this message]
2013-11-14 12:15 ` Kevin Wolf
2013-11-14 13:41 ` Stefan Hajnoczi
2013-11-14 14:00 ` Eric Blake
2013-11-14 14:07 ` Paolo Bonzini
2013-11-15 8:18 ` Stefan Hajnoczi
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=52843CE9.40102@linux.vnet.ibm.com \
--to=xiawenc@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).