Received: from eggs.gnu.org ([2001:4830:134:3::10]:40383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eg8DE-0004Lr-4p for qemu-devel@nongnu.org; Mon, 29 Jan 2018 07:07:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eg8D9-00071S-FG for qemu-devel@nongnu.org; Mon, 29 Jan 2018 07:07:00 -0500 From: Alberto Garcia In-Reply-To: <1e32b96c-b65a-eba3-9d8e-7d0ec9bad741@redhat.com> References: <7d8d80bfde60d29e8a0abe04db8241b754714329.1516978645.git.berto@igalia.com> <1e32b96c-b65a-eba3-9d8e-7d0ec9bad741@redhat.com> Date: Mon, 29 Jan 2018 13:06:16 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v3 30/39] qcow2: Update expand_zero_clusters_in_l1() to support L2 slices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Max Reitz , Kevin Wolf , Anton Nefedov , "Denis V . Lunev" On Fri 26 Jan 2018 08:46:19 PM CET, Eric Blake wrote: >> - ret = qcow2_cache_get(bs, s->l2_table_cache, l2_offset, >> - (void **)&l2_table); >> + ret = qcow2_cache_get(bs, s->l2_table_cache, slice_offset, >> + (void **)&l2_slice); > > The (void **) cast is probably still necessary (anything can go to > void*, but C gets pickier when going to void**), but... > >> } else { >> /* load inactive L2 tables from disk */ >> - ret = bdrv_read(bs->file, l2_offset / BDRV_SECTOR_SIZE, >> - (void *)l2_table, s->cluster_sectors); >> + ret = bdrv_pread(bs->file, slice_offset, >> + (void *)l2_slice, slice_size2); > > ...do we still need this cast to void*? > > >> >> - ret = bdrv_write(bs->file, l2_offset / BDRV_SECTOR_SIZE, >> - (void *)l2_table, s->cluster_sectors); >> + ret = bdrv_pwrite(bs->file, slice_offset, >> + (void *)l2_slice, slice_size2); > > and again here Good idea, I'll remove the void * casts. Berto