mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 13:22:57 +00:00
virtio: reenable config if freezing device failed
[ Upstream commit310227f428
] Currently, we don't reenable the config if freezing the device failed. For example, virtio-mem currently doesn't support suspend+resume, and trying to freeze the device will always fail. Afterwards, the device will no longer respond to resize requests, because it won't get notified about config changes. Let's fix this by re-enabling the config if freezing fails. Fixes:22b7050a02
("virtio: defer config changed notifications") Cc: <stable@kernel.org> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20240213135425.795001-1-david@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0c5541b4c9
commit
ac16beecbb
1 changed files with 3 additions and 1 deletions
|
@ -510,9 +510,11 @@ int virtio_device_freeze(struct virtio_device *dev)
|
|||
|
||||
if (drv && drv->freeze) {
|
||||
ret = drv->freeze(dev);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
virtio_config_enable(dev);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->config->destroy_avq)
|
||||
dev->config->destroy_avq(dev);
|
||||
|
|
Loading…
Reference in a new issue