[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block/stream: Don't stream unbacked devices
From: |
Wenchao Xia |
Subject: |
Re: [Qemu-devel] [PATCH] block/stream: Don't stream unbacked devices |
Date: |
Thu, 14 Nov 2013 11:00:57 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 |
δΊ 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 <address@hidden>
> ---
> 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 <address@hidden>