From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R37K3-0001ry-Fj for qemu-devel@nongnu.org; Mon, 12 Sep 2011 10:17:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R37K1-0007AC-VJ for qemu-devel@nongnu.org; Mon, 12 Sep 2011 10:17:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R37K1-00079w-Du for qemu-devel@nongnu.org; Mon, 12 Sep 2011 10:17:17 -0400 From: Kevin Wolf Date: Mon, 12 Sep 2011 16:19:27 +0200 Message-Id: <1315837174-15327-29-git-send-email-kwolf@redhat.com> In-Reply-To: <1315837174-15327-1-git-send-email-kwolf@redhat.com> References: <1315837174-15327-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 28/35] block: Reset buffer alignment on detach List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Markus Armbruster 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 Signed-off-by: Kevin Wolf --- block.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index e986986..b006e58 100644 --- a/block.c +++ b/block.c @@ -788,6 +788,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