mirror of
https://github.com/xemu-project/xemu.git
synced 2025-03-05 11:07:29 +00:00
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>
This commit is contained in:
parent
7b6f9300d5
commit
29e05f2022
1
block.c
1
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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user