summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2011-09-06 18:58:57 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-12 15:17:22 +0200
commitf96d49eb194ca55160b4c5cfa7a33112056cab63 (patch)
tree052961f88f886dc55f2dcc4485b9120195a05282 /block.c
parent668499f2894c9eb4784263ea753406083cc5f313 (diff)
downloadqemu-f96d49eb194ca55160b4c5cfa7a33112056cab63.tar.gz
qemu-f96d49eb194ca55160b4c5cfa7a33112056cab63.tar.bz2
qemu-f96d49eb194ca55160b4c5cfa7a33112056cab63.zip
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 <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block.c b/block.c
index e9869863d1..b006e586c7 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 */