qemu-devel
[Top][All Lists]
Advanced

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

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


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] Do not delete BlockDriverState when deleting the drive
Date: Thu, 3 Mar 2011 10:19:57 +0000

On Wed, Mar 2, 2011 at 3:03 PM, Ryan Harper <address@hidden> 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() call bdrv_remove(), could it be
invoked twice?  A quick fix is to set bs->device_name[0] = '\0' to
prevent the second removal.

Stefan



reply via email to

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