From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ab8XX-0003lK-7j for qemu-devel@nongnu.org; Wed, 02 Mar 2016 10:18:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ab8XT-0001S7-Dm for qemu-devel@nongnu.org; Wed, 02 Mar 2016 10:18:15 -0500 Date: Wed, 2 Mar 2016 10:18:00 -0500 From: Jeff Cody Message-ID: <20160302151800.GE26318@localhost.localdomain> References: <1456776532-1008-1-git-send-email-jcody@redhat.com> <1456776532-1008-3-git-send-email-jcody@redhat.com> <56D6F48F.7080404@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56D6F48F.7080404@redhat.com> Subject: Re: [Qemu-devel] [PULL 02/12] sheepdog: allow to delete snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, famz@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org On Wed, Mar 02, 2016 at 03:11:27PM +0100, Paolo Bonzini wrote: > > > On 29/02/2016 21:08, Jeff Cody wrote: > > From: Vasiliy Tolstov > > > > This patch implements a blockdriver function bdrv_snapshot_delete() in > > the sheepdog driver. With the new function, snapshots of sheepdog can > > be deleted from libvirt. > > > > Cc: Jeff Cody > > Signed-off-by: Hitoshi Mitake > > Signed-off-by: Vasiliy Tolstov > > Message-id: 1450873346-22334-1-git-send-email-mitake.hitoshi@lab.ntt.co.jp > > Signed-off-by: Jeff Cody > > --- > > block/sheepdog.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- > > 1 file changed, 123 insertions(+), 2 deletions(-) [...] > + memset(buf, 0, sizeof(buf)); > > + memset(snap_tag, 0, sizeof(snap_tag)); > > + pstrcpy(buf, SD_MAX_VDI_LEN, s->name); > > + if (qemu_strtoul(snapshot_id, NULL, 10, (unsigned long *)&snap_id)) { > > This cast seems like a very bad idea, and in fact it is. qemu_strtoul > will access 8 bytes on 64-bit machines. Please change snap_id to be an > unsigned long instead. > Thanks Paolo, I missed that. I just sent a patch to fix this. -Jeff