From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ab9l7-0006Bd-K5 for qemu-devel@nongnu.org; Wed, 02 Mar 2016 11:36:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ab9l6-0002Mb-Pf for qemu-devel@nongnu.org; Wed, 02 Mar 2016 11:36:21 -0500 Date: Wed, 2 Mar 2016 11:36:09 -0500 From: Jeff Cody Message-ID: <20160302163609.GI26318@localhost.localdomain> References: <56D7158B.5050107@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56D7158B.5050107@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 1/1] block/sheepdog: fix argument passed to qemu_strtoul() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: kwolf@redhat.com, qemu-block@nongnu.org, mitake.hitoshi@lab.ntt.co.jp, qemu-devel@nongnu.org, v.tolstov@selfip.ru, pbonzini@redhat.com, namei.unix@gmail.com On Wed, Mar 02, 2016 at 05:32:11PM +0100, Max Reitz wrote: > On 02.03.2016 17:24, Jeff Cody wrote: > > The function qemu_strtoul() reads 'unsigned long' sized data, > > which is larger than uint32_t on 64-bit machines. > > > > Even though the snap_id field in the header is 32-bits, we must > > accomodate the full size in qemu_strtoul(). > > > > This patch also adds more meaningful error handling to the > > qemu_strtoul() call, and subsequent results. > > > > Reported-by: Paolo Bonzini > > Signed-off-by: Jeff Cody > > --- > > block/sheepdog.c | 11 +++++++---- > > 1 file changed, 7 insertions(+), 4 deletions(-) > > Another problem with this function is that it doesn't always set errp on > error. Actually, this patch introduces the first instance where it does. > > qemu-img will not print an error if errp is not set; it actually ignores > bdrv_snapshot_delete_by_id_or_name()'s return value. So this is a real > issue that should be fixed as well. > I'll (or perhaps one of the sheepdog maintainers?) will handle that in subsequent patch(es).