[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 2/5] qcow: QCowAIOCB field cleanup
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [RFC PATCH 2/5] qcow: QCowAIOCB field cleanup |
Date: |
Fri, 22 Jul 2011 09:01:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc15 Thunderbird/3.1.11 |
Am 20.07.2011 15:56, schrieb Frediano Ziglio:
> remove unused field from this structure and put some of them in
> qcow_aio_read_cb and qcow_aio_write_cb
>
> Signed-off-by: Frediano Ziglio <address@hidden>
> qemu_co_mutex_lock(&s->lock);
> if (ret < 0) {
> return ret;
> }
> }
>
> - return 1;
> + goto redo;
> }
>
> static int qcow_co_readv(BlockDriverState *bs, int64_t sector_num,
> @@ -623,9 +612,7 @@ static int qcow_co_readv(BlockDriverState *bs, int64_t
> sector_num,
> qcow_aio_setup(bs, sector_num, qiov, nb_sectors, 0, &acb);
>
> qemu_co_mutex_lock(&s->lock);
> - do {
> - ret = qcow_aio_read_cb(&acb);
> - } while (ret > 0);
> + ret = qcow_aio_read_cb(&acb);
> qemu_co_mutex_unlock(&s->lock);
>
> if (acb.qiov->niov > 1) {
What was wrong with the loop and return 1?
I think the old state was closer to what it should look like:
qcow_aio_read_cb should become a function that reads as much as it can
from a given offset to a given pointer and returns how much that was.
qcow_co_readv should contain the loop that calls it with the right
parameters.
Kevin
- [Qemu-devel] [RFC PATCH 0/5] qcow: coroutines cleanup, Frediano Ziglio, 2011/07/20
- [Qemu-devel] [RFC PATCH 1/5] qcow: allocate QCowAIOCB structure using stack, Frediano Ziglio, 2011/07/20
- [Qemu-devel] [RFC PATCH 4/5] avoid dandling pointers, Frediano Ziglio, 2011/07/20
- [Qemu-devel] [RFC PATCH 5/5] qcow: small optimization initializing QCowAIOCB, Frediano Ziglio, 2011/07/20
- [Qemu-devel] [RFC PATCH 2/5] qcow: QCowAIOCB field cleanup, Frediano Ziglio, 2011/07/20
- Re: [Qemu-devel] [RFC PATCH 2/5] qcow: QCowAIOCB field cleanup,
Kevin Wolf <=
- [Qemu-devel] [RFC PATCH 3/5] qcow: move some blocks of code to avoid useless variable initialization, Frediano Ziglio, 2011/07/20
- Re: [Qemu-devel] [RFC PATCH 0/5] qcow: coroutines cleanup, Kevin Wolf, 2011/07/22
- Re: [Qemu-devel] [RFC PATCH 0/5] qcow: coroutines cleanup, Frediano Ziglio, 2011/07/22
- Re: [Qemu-devel] [RFC PATCH 0/5] qcow: coroutines cleanup, Kevin Wolf, 2011/07/22
- Re: [Qemu-devel] [RFC PATCH 0/5] qcow: coroutines cleanup, Stefan Hajnoczi, 2011/07/22
- Re: [Qemu-devel] [RFC PATCH 0/5] qcow: coroutines cleanup, Frediano Ziglio, 2011/07/22
- Re: [Qemu-devel] [RFC PATCH 0/5] qcow: coroutines cleanup, Kevin Wolf, 2011/07/22
- Re: [Qemu-devel] [RFC PATCH 0/5] qcow: coroutines cleanup, Gerd Hoffmann, 2011/07/22
- Re: [Qemu-devel] [RFC PATCH 0/5] qcow: coroutines cleanup, Frediano Ziglio, 2011/07/22
- Re: [Qemu-devel] [RFC PATCH 0/5] qcow: coroutines cleanup, Kevin Wolf, 2011/07/25