From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QobHh-0005NE-L2 for qemu-devel@nongnu.org; Wed, 03 Aug 2011 09:14:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QobHf-0002Wb-Md for qemu-devel@nongnu.org; Wed, 03 Aug 2011 09:14:53 -0400 Received: from oxygen.pond.sub.org ([78.46.104.156]:36894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QobHf-0002Vn-HZ for qemu-devel@nongnu.org; Wed, 03 Aug 2011 09:14:51 -0400 From: Markus Armbruster Date: Wed, 3 Aug 2011 15:08:21 +0200 Message-Id: <1312376904-16115-43-git-send-email-armbru@redhat.com> In-Reply-To: <1312376904-16115-1-git-send-email-armbru@redhat.com> References: <1312376904-16115-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 42/45] block: Reset buffer alignment on detach List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, quintela@redhat.com, stefano.stabellini@eu.citrix.com, lcapitulino@redhat.com, hare@suse.de, amit.shah@redhat.com, hch@lst.de BlockDriverState member buffer_alignment is initially 512. The device model may set them, with bdrv_set_buffer_alignment(). If the device model gets detached (hot unplug), the device's alignment is left behind. Only okay because device hot unplug automatically destroys the BlockDriverState. But that's a questionable feature, best not to rely on it. Signed-off-by: Markus Armbruster --- block.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 67d9429..b0e54ef 100644 --- a/block.c +++ b/block.c @@ -761,6 +761,7 @@ void bdrv_detach_dev(BlockDriverState *bs, void *dev) bs->dev = NULL; bs->dev_ops = NULL; bs->dev_opaque = NULL; + bs->buffer_alignment = 512; } /* TODO change to return DeviceState * when all users are qdevified */ -- 1.7.6