[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/2] vhost-user: add reply for set_mem_table
From: |
linhaifeng |
Subject: |
[Qemu-devel] [PATCH 2/2] vhost-user: add reply for set_mem_table |
Date: |
Tue, 10 Feb 2015 11:24:47 +0800 |
From: Linhaifeng <address@hidden>
If u64 is not 0 we should return -1 to tell qemu not going on.
Signed-off-by: Linhaifeng <address@hidden>
---
hw/virtio/vhost-user.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index aefe0bb..a68ce36 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -243,7 +243,7 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned
long int request,
msg.size = sizeof(m.memory.nregions);
msg.size += sizeof(m.memory.padding);
msg.size += fd_num * sizeof(VhostUserMemoryRegion);
-
+ need_reply = 1;
break;
case VHOST_SET_LOG_FD:
@@ -315,6 +315,17 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned
long int request,
}
memcpy(arg, &msg.state, sizeof(struct vhost_vring_state));
break;
+ case VHOST_SET_MEM_TABLE:
+ if (msg.size != sizeof(m.u64)) {
+ error_report("Received bad msg size.\n");
+ return -1;
+ } else {
+ if (m.u64) {
+ error_report("Failed to set memory table.\n");
+ return -1;
+ }
+ }
+ break;
default:
error_report("Received unexpected msg type.\n");
return -1;
--
1.7.12.4