From: Markus Armbruster Date: Tue, 6 Sep 2011 16:58:57 +0000 (+0200) Subject: block: Reset buffer alignment on detach X-Git-Tag: v1.0-rc0~248 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29e05f202238fe0efee4a0ecccc3fd348448a37c;p=thirdparty%2Fqemu.git block: Reset buffer alignment on detach 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 --- diff --git a/block.c b/block.c index e9869863d1f..b006e586c77 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 */