From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn96K-0000BS-Or for qemu-devel@nongnu.org; Tue, 28 Apr 2015 13:15:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yn96J-0002de-Ee for qemu-devel@nongnu.org; Tue, 28 Apr 2015 13:15:16 -0400 Message-ID: <553FC01B.5030802@redhat.com> Date: Tue, 28 Apr 2015 11:15:07 -0600 From: Eric Blake MIME-Version: 1.0 References: <1430233258-31807-1-git-send-email-kwolf@redhat.com> <1430233258-31807-77-git-send-email-kwolf@redhat.com> In-Reply-To: <1430233258-31807-77-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TwkPWJ2JqBHmxL316dJwXBdq8jH4OxwOA" Subject: Re: [Qemu-devel] [Qemu-block] [PULL 76/76] block: move I/O request processing to block/io.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TwkPWJ2JqBHmxL316dJwXBdq8jH4OxwOA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/28/2015 09:00 AM, Kevin Wolf wrote: > From: Stefan Hajnoczi >=20 > The block.c file has grown to over 6000 lines. It is time to split thi= s > file so there are fewer conflicts and the code is easier to maintain. >=20 > Extract I/O request processing code: > * Read > * Write > * Zero writes and making the image empty > * Flush > * Discard > * ioctl > * Tracked requests and queuing > * Throttling and copy-on-read > * Block status and allocated functions > * Refreshing block limits > * Reading/writing vmstate > * qemu_blockalign() and friends >=20 > The patch simply moves code from block.c into block/io.c. >=20 > Signed-off-by: Stefan Hajnoczi > Signed-off-by: Kevin Wolf > --- > block.c | 3394 +++++++------------------------------------= -------- > block/Makefile.objs | 2 +- > block/io.c | 2540 ++++++++++++++++++++++++++++++++++++++ > 3 files changed, 2982 insertions(+), 2954 deletions(-) > create mode 100644 block/io.c Kevin, compare your diff to Stefan's: > --- > block.c | 2512 -------------------------------------------= ------- > block/Makefile.objs | 2 +- > block/io.c | 2540 +++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 3 files changed, 2541 insertions(+), 2513 deletions(-) > create mode 100644 block/io.c The difference is that Stefan has done 'git config diff.algorithm patience', which makes for MUCH more legible diffs on a code motion patch. http://wiki.qemu.org/Contribute/SubmitAPatch mentions this as a hint for a nicer setup. At any rate, you've already sent the pull request, so I'm probably too late; but for the record, here's why I would add: Reviewed-by: Eric Blake when reviewing Stefan's version of the patch (the two versions give the same end result, but my review technique falls flat on Kevin's replay of the patch) $ diff -u <(sed -n 's/^-//p' patch) <(sed -n 's/^+//p' patch) --- /dev/fd/63 2015-04-28 11:13:24.696901797 -0600 +++ /dev/fd/62 2015-04-28 11:13:24.697901792 -0600 @@ -1,6 +1,38 @@ --- --- a/block.c +++ b/block.c +++ b/block/Makefile.objs +block-obj-y +=3D null.o mirror.o io.o +++ b/block/io.c +/* + * Block layer I/O functions + * + * Copyright (c) 2003 Fabrice Bellard + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is= + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHA= LL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "trace.h" #include "sysemu/qtest.h" +#include "block/blockjob.h" +#include "block/block_int.h" + +#define NOT_DONE 0x7fffffff /* used while emulated sync operation in progress */ + static BlockAIOCB *bdrv_aio_readv_em(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockCompletionFunc *cb, void *opaque); @@ -465,7 +497,6 @@ return waited; } - static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset,= size_t size) { @@ -2511,8 +2542,3 @@ bdrv_flush_io_queue(bs->file); } } - --- a/block/Makefile.objs -block-obj-y +=3D null.o mirror.o --- /dev/null --=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --TwkPWJ2JqBHmxL316dJwXBdq8jH4OxwOA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVP8AbAAoJEKeha0olJ0NqLgQH/irKDHpAcUzS/iXp9QxIF4r0 XhWBootETuD/cgjsJZYBQ5GsoHXps5VVA7fGAFzP8H0tpuNBzAP7wD3QYGYMtb1u mJi57JqhjSUP2mkiOq+A8f9huhb7Vaeo99wojBk2h6PXAi8rjwaHvx3QpPGAOyS+ twlmLpDEhoqHcA/80bmD7+R7gj5d73IO0rJGs7L08F2wC9tybP9e0+JU+sZ1AAtR 3vo3PaiYXKFPTd9FDeSt8WzZIoLIJcIz+r3lhAw7KCHuAQBJ1KPxe5g9zlFgISKz sRMazZyoi+HldSSiF0b9LTLVzdDkefrnRekjnDByfas3UlNrMXS0zSfds8RhcY8= =taPw -----END PGP SIGNATURE----- --TwkPWJ2JqBHmxL316dJwXBdq8jH4OxwOA--