Re: [Qemu-devel] [PATCH] Do not delete BlockDriverState when deleting the drive

2011-03-03 Thread Stefan Hajnoczi
On Wed, Mar 2, 2011 at 3:03 PM, Ryan Harper wrote: > +void bdrv_remove(BlockDriverState *bs) > +{ > +    if (bs->device_name[0] != '\0') { > +        QTAILQ_REMOVE(&bdrv_states, bs, list); > +    } > +} It's not safe to invoke QTAILQ_REMOVE() twice. Since both do_drive_del() and bdrv_delete() ca

[Qemu-devel] [PATCH] Do not delete BlockDriverState when deleting the drive

2011-03-02 Thread Ryan Harper
When removing a drive from the host-side via drive_del we currently have the following path: drive_del qemu_aio_flush() bdrv_close() drive_uninit() bdrv_delete() When we bdrv_delete() we end up qemu_free()'ing the BlockDriverState pointer however, the block devices retain a copy of this pointer,