Re: [Qemu-devel] [PATCH v2] xen_disk: cope with missing xenstore "params" node

2011-06-27 Thread Stefano Stabellini
On Sat, 25 Jun 2011, Peter Maydell wrote: > On 24 June 2011 17:35, wrote: > > +out_error: > > +    qemu_free(blkdev->params); > > +    qemu_free(blkdev->mode); > > +    qemu_free(blkdev->type); > > +    qemu_free(blkdev->dev); > > +    qemu_free(blkdev->devtype); > > +    return -1; > > It occur

Re: [Qemu-devel] [PATCH v2] xen_disk: cope with missing xenstore "params" node

2011-06-25 Thread Peter Maydell
On 24 June 2011 17:35, wrote: > +out_error: > +    qemu_free(blkdev->params); > +    qemu_free(blkdev->mode); > +    qemu_free(blkdev->type); > +    qemu_free(blkdev->dev); > +    qemu_free(blkdev->devtype); > +    return -1; It occured to me that could result in a double-free if it's possible t

[Qemu-devel] [PATCH v2] xen_disk: cope with missing xenstore "params" node

2011-06-24 Thread stefano.stabellini
From: Stefano Stabellini When disk is a cdrom and the drive is empty the "params" node in xenstore might be missing completely: cope with it instead of segfaulting. Updated in v2: - actually removed the strchr(blkdev->params, ':') that caused the segfault; - free all the allocated strings fro