qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PULL 02/12] sheepdog: allow to delete snapshot


From: Jeff Cody
Subject: Re: [Qemu-block] [PULL 02/12] sheepdog: allow to delete snapshot
Date: Wed, 2 Mar 2016 10:18:00 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

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 <address@hidden>
> > 
> > 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 <address@hidden>
> > Signed-off-by: Hitoshi Mitake <address@hidden>
> > Signed-off-by: Vasiliy Tolstov <address@hidden>
> > Message-id: address@hidden
> > Signed-off-by: Jeff Cody <address@hidden>
> > ---
> >  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]