aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/vhost.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/virtio/vhost.c')
-rw-r--r--hw/virtio/vhost.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 6e17d63..2a01662 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1388,18 +1388,16 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
error_report("vhost backend memory slots limit is less"
" than current number of present memory slots");
r = -1;
- if (busyloop_timeout) {
- goto fail_busyloop;
- } else {
- goto fail;
- }
+ goto fail_busyloop;
}
return 0;
fail_busyloop:
- while (--i >= 0) {
- vhost_virtqueue_set_busyloop_timeout(hdev, hdev->vq_index + i, 0);
+ if (busyloop_timeout) {
+ while (--i >= 0) {
+ vhost_virtqueue_set_busyloop_timeout(hdev, hdev->vq_index + i, 0);
+ }
}
fail:
hdev->nvqs = n_initialized_vqs;