mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
virtio-blk: fix disabled mode
We must not call virtio_blk_data_plane_notify if dataplane is disabled: we would hit a segmentation fault in notify_guest_bh as s->guest_notifier has not been setup and is NULL. Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
2b2cbcadc1
commit
eb41cf78fc
3 changed files with 5 additions and 5 deletions
|
@ -29,7 +29,6 @@
|
|||
struct VirtIOBlockDataPlane {
|
||||
bool starting;
|
||||
bool stopping;
|
||||
bool disabled;
|
||||
|
||||
VirtIOBlkConf *conf;
|
||||
|
||||
|
@ -234,7 +233,7 @@ void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s)
|
|||
fail_host_notifier:
|
||||
k->set_guest_notifiers(qbus->parent, 1, false);
|
||||
fail_guest_notifiers:
|
||||
s->disabled = true;
|
||||
vblk->dataplane_disabled = true;
|
||||
s->starting = false;
|
||||
vblk->dataplane_started = true;
|
||||
}
|
||||
|
@ -251,8 +250,8 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s)
|
|||
}
|
||||
|
||||
/* Better luck next time. */
|
||||
if (s->disabled) {
|
||||
s->disabled = false;
|
||||
if (vblk->dataplane_disabled) {
|
||||
vblk->dataplane_disabled = false;
|
||||
vblk->dataplane_started = false;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue