mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
block: Support passing NULL ops to blk_set_dev_ops()
This supports passing NULL ops to blk_set_dev_ops() so that we can remove stale ops in some cases. Signed-off-by: Xie Yongji <xieyongji@bytedance.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20220523084611.91-2-xieyongji@bytedance.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
618af89e55
commit
ac1fc3a3a9
1 changed files with 1 additions and 1 deletions
|
@ -1058,7 +1058,7 @@ void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops,
|
||||||
blk->dev_opaque = opaque;
|
blk->dev_opaque = opaque;
|
||||||
|
|
||||||
/* Are we currently quiesced? Should we enforce this right now? */
|
/* Are we currently quiesced? Should we enforce this right now? */
|
||||||
if (blk->quiesce_counter && ops->drained_begin) {
|
if (blk->quiesce_counter && ops && ops->drained_begin) {
|
||||||
ops->drained_begin(opaque);
|
ops->drained_begin(opaque);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue