diff options
author | Gonglei <arei.gonglei@huawei.com> | 2016-12-22 11:12:38 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2017-01-10 07:02:52 +0200 |
commit | 46fd17054548b15b3b8a5991492f5f0dc37957d4 (patch) | |
tree | 7590dc9d3f7208e1976d6461f3373ef60c9709eb /hw/virtio | |
parent | c159a4d1d0434fcf670f8684273bce0eca117a27 (diff) | |
download | qemu-46fd17054548b15b3b8a5991492f5f0dc37957d4.zip qemu-46fd17054548b15b3b8a5991492f5f0dc37957d4.tar.gz qemu-46fd17054548b15b3b8a5991492f5f0dc37957d4.tar.bz2 |
cryptodev: introduce a new is_used property
This property is used to Tag the cryptodev backend
is used by virtio-crypto or not. Making cryptodev
can't be hot unplugged when it's in use. Cleanup
resources when cryptodev is finalized.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio')
-rw-r--r-- | hw/virtio/virtio-crypto.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index f872c87..6318fcf 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -799,6 +799,7 @@ static void virtio_crypto_device_realize(DeviceState *dev, Error **errp) } virtio_crypto_init_config(vdev); + cryptodev_backend_set_used(vcrypto->cryptodev, true); } static void virtio_crypto_device_unrealize(DeviceState *dev, Error **errp) @@ -818,6 +819,7 @@ static void virtio_crypto_device_unrealize(DeviceState *dev, Error **errp) g_free(vcrypto->vqs); virtio_cleanup(vdev); + cryptodev_backend_set_used(vcrypto->cryptodev, false); } static const VMStateDescription vmstate_virtio_crypto = { |