aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/vhost-shadow-virtqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/virtio/vhost-shadow-virtqueue.c')
-rw-r--r--hw/virtio/vhost-shadow-virtqueue.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
index 264ddc166d..3b05bab44d 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -715,43 +715,18 @@ void vhost_svq_stop(VhostShadowVirtqueue *svq)
* @iova_tree: Tree to perform descriptors translations
* @ops: SVQ owner callbacks
* @ops_opaque: ops opaque pointer
- *
- * Returns the new virtqueue or NULL.
- *
- * In case of error, reason is reported through error_report.
*/
VhostShadowVirtqueue *vhost_svq_new(VhostIOVATree *iova_tree,
const VhostShadowVirtqueueOps *ops,
void *ops_opaque)
{
- g_autofree VhostShadowVirtqueue *svq = g_new0(VhostShadowVirtqueue, 1);
- int r;
-
- r = event_notifier_init(&svq->hdev_kick, 0);
- if (r != 0) {
- error_report("Couldn't create kick event notifier: %s (%d)",
- g_strerror(errno), errno);
- goto err_init_hdev_kick;
- }
-
- r = event_notifier_init(&svq->hdev_call, 0);
- if (r != 0) {
- error_report("Couldn't create call event notifier: %s (%d)",
- g_strerror(errno), errno);
- goto err_init_hdev_call;
- }
+ VhostShadowVirtqueue *svq = g_new0(VhostShadowVirtqueue, 1);
event_notifier_init_fd(&svq->svq_kick, VHOST_FILE_UNBIND);
svq->iova_tree = iova_tree;
svq->ops = ops;
svq->ops_opaque = ops_opaque;
- return g_steal_pointer(&svq);
-
-err_init_hdev_call:
- event_notifier_cleanup(&svq->hdev_kick);
-
-err_init_hdev_kick:
- return NULL;
+ return svq;
}
/**
@@ -763,7 +738,5 @@ void vhost_svq_free(gpointer pvq)
{
VhostShadowVirtqueue *vq = pvq;
vhost_svq_stop(vq);
- event_notifier_cleanup(&vq->hdev_kick);
- event_notifier_cleanup(&vq->hdev_call);
g_free(vq);
}