[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/41] vhost: add missing VHOST_OPS_DEBUG
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 22/41] vhost: add missing VHOST_OPS_DEBUG |
Date: |
Fri, 29 Jul 2016 06:16:22 +0300 |
From: Marc-André Lureau <address@hidden>
Add missing VHOST_OPS_DEBUG() logs, for completeness.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/vhost.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 1ece1ef..5a29eb3 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -668,6 +668,7 @@ static int vhost_virtqueue_set_addr(struct vhost_dev *dev,
};
int r = dev->vhost_ops->vhost_set_vring_addr(dev, &addr);
if (r < 0) {
+ VHOST_OPS_DEBUG("vhost_set_vring_addr failed");
return -errno;
}
return 0;
@@ -681,6 +682,9 @@ static int vhost_dev_set_features(struct vhost_dev *dev,
bool enable_log)
features |= 0x1ULL << VHOST_F_LOG_ALL;
}
r = dev->vhost_ops->vhost_set_features(dev, features);
+ if (r < 0) {
+ VHOST_OPS_DEBUG("vhost_set_features failed");
+ }
return r < 0 ? -errno : 0;
}
@@ -804,6 +808,7 @@ static int vhost_virtqueue_set_vring_endian_legacy(struct
vhost_dev *dev,
return 0;
}
+ VHOST_OPS_DEBUG("vhost_set_vring_endian failed");
if (errno == ENOTTY) {
error_report("vhost does not support cross-endian");
return -ENOSYS;
@@ -832,12 +837,14 @@ static int vhost_virtqueue_start(struct vhost_dev *dev,
vq->num = state.num = virtio_queue_get_num(vdev, idx);
r = dev->vhost_ops->vhost_set_vring_num(dev, &state);
if (r) {
+ VHOST_OPS_DEBUG("vhost_set_vring_num failed");
return -errno;
}
state.num = virtio_queue_get_last_avail_idx(vdev, idx);
r = dev->vhost_ops->vhost_set_vring_base(dev, &state);
if (r) {
+ VHOST_OPS_DEBUG("vhost_set_vring_base failed");
return -errno;
}
@@ -889,6 +896,7 @@ static int vhost_virtqueue_start(struct vhost_dev *dev,
file.fd = event_notifier_get_fd(virtio_queue_get_host_notifier(vvq));
r = dev->vhost_ops->vhost_set_vring_kick(dev, &file);
if (r) {
+ VHOST_OPS_DEBUG("vhost_set_vring_kick failed");
r = -errno;
goto fail_kick;
}
@@ -936,8 +944,7 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev,
r = dev->vhost_ops->vhost_get_vring_base(dev, &state);
if (r < 0) {
- fprintf(stderr, "vhost VQ %d ring restore failed: %d\n", idx, r);
- fflush(stderr);
+ VHOST_OPS_DEBUG("vhost VQ %d ring restore failed: %d", idx, r);
}
virtio_queue_set_last_avail_idx(vdev, idx, state.num);
virtio_queue_invalidate_signalled_used(vdev, idx);
@@ -989,6 +996,7 @@ static int vhost_virtqueue_set_busyloop_timeout(struct
vhost_dev *dev,
r = dev->vhost_ops->vhost_set_vring_busyloop_timeout(dev, &state);
if (r) {
+ VHOST_OPS_DEBUG("vhost_set_vring_busyloop_timeout failed");
return r;
}
@@ -1010,6 +1018,7 @@ static int vhost_virtqueue_init(struct vhost_dev *dev,
file.fd = event_notifier_get_fd(&vq->masked_notifier);
r = dev->vhost_ops->vhost_set_vring_call(dev, &file);
if (r) {
+ VHOST_OPS_DEBUG("vhost_set_vring_call failed");
r = -errno;
goto fail_call;
}
@@ -1049,11 +1058,13 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
r = hdev->vhost_ops->vhost_set_owner(hdev);
if (r < 0) {
+ VHOST_OPS_DEBUG("vhost_set_owner failed");
goto fail;
}
r = hdev->vhost_ops->vhost_get_features(hdev, &features);
if (r < 0) {
+ VHOST_OPS_DEBUG("vhost_get_features failed");
goto fail;
}
@@ -1286,6 +1297,7 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice
*vdev)
}
r = hdev->vhost_ops->vhost_set_mem_table(hdev, hdev->mem);
if (r < 0) {
+ VHOST_OPS_DEBUG("vhost_set_mem_table failed");
r = -errno;
goto fail_mem;
}
@@ -1310,6 +1322,7 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice
*vdev)
hdev->log_size ? log_base : 0,
hdev->log);
if (r < 0) {
+ VHOST_OPS_DEBUG("vhost_set_log_base failed");
r = -errno;
goto fail_log;
}
--
MST
- [Qemu-devel] [PULL 11/41] misc: indentation, (continued)
- [Qemu-devel] [PULL 11/41] misc: indentation, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 12/41] vhost-user: minor simplification, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 13/41] vhost-user: disconnect on HUP, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 15/41] vhost: make vhost_log_put() idempotent, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 14/41] vhost: don't assume opaque is a fd, use backend cleanup, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 16/41] vhost: assert the log was cleaned up, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 17/41] vhost: fix cleanup on not fully initialized device, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 18/41] vhost: make vhost_dev_cleanup() idempotent, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 19/41] vhost-net: always call vhost_dev_cleanup() on failure, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 20/41] vhost: fix calling vhost_dev_cleanup() after vhost_dev_init(), Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 22/41] vhost: add missing VHOST_OPS_DEBUG,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 21/41] vhost: do not assert() on vhost_ops failure, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 23/41] vhost: use error_report() instead of fprintf(stderr, ...), Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 24/41] qemu-char: fix qemu_chr_fe_set_msgfds() crash when disconnected, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 25/41] vhost-user: call set_msgfds unconditionally, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 26/41] vhost-user: check qemu_chr_fe_set_msgfds() return value, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 27/41] vhost-user: check vhost_user_{read, write}() return value, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 28/41] vhost-user: keep vhost_net after a disconnection, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 29/41] vhost-user: add get_vhost_net() assertions, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 30/41] Revert "vhost-net: do not crash if backend is not present", Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 31/41] vhost-net: vhost_migration_done is vhost-user specific, Michael S. Tsirkin, 2016/07/28