[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 12/14] contrib/ivshmem-*: various fixes
From: |
David Marchand |
Subject: |
[Qemu-devel] [PATCH v4 12/14] contrib/ivshmem-*: various fixes |
Date: |
Tue, 2 Sep 2014 17:25:30 +0200 |
More fixes following Gonglei comments:
- add a missing \n in a debug message.
- add an explicit initialisation of sock_fd.
- fix a check on vector index.
Signed-off-by: David Marchand <address@hidden>
---
contrib/ivshmem-client/ivshmem-client.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/contrib/ivshmem-client/ivshmem-client.c
b/contrib/ivshmem-client/ivshmem-client.c
index e9a19ff..ad210c8 100644
--- a/contrib/ivshmem-client/ivshmem-client.c
+++ b/contrib/ivshmem-client/ivshmem-client.c
@@ -105,7 +105,7 @@ handle_server_msg(IvshmemClient *client)
if (fd == -1) {
if (peer == NULL || peer == &client->local) {
- debug_log(client, "receive delete for invalid peer %ld", peer_id);
+ debug_log(client, "receive delete for invalid peer %ld\n",
peer_id);
return -1;
}
@@ -155,6 +155,7 @@ ivshmem_client_init(IvshmemClient *client, const char
*unix_sock_path,
client->notif_cb = notif_cb;
client->notif_arg = notif_arg;
client->verbose = verbose;
+ client->sock_fd = -1;
return 0;
}
@@ -309,7 +310,7 @@ ivshmem_client_notify(const IvshmemClient *client,
uint64_t kick;
int fd;
- if (vector > peer->vectors_count) {
+ if (vector >= peer->vectors_count) {
debug_log(client, "invalid vector %u on peer %ld\n", vector, peer->id);
return -1;
}
--
1.7.10.4
- [Qemu-devel] [PATCH v4 01/14] contrib: add ivshmem client and server, (continued)
- [Qemu-devel] [PATCH v4 01/14] contrib: add ivshmem client and server, David Marchand, 2014/09/02
- [Qemu-devel] [PATCH v4 05/14] contrib/ivshmem-*: switch to QEMU headers, David Marchand, 2014/09/02
- [Qemu-devel] [PATCH v4 06/14] contrib/ivshmem-server: set client sockets as non blocking, David Marchand, 2014/09/02
- [Qemu-devel] [PATCH v4 08/14] contrib/ivshmem-*: plug client and server in QEMU top Makefile, David Marchand, 2014/09/02
- [Qemu-devel] [PATCH v4 07/14] contrib/ivshmem-*: add missing const and static attrs, David Marchand, 2014/09/02
- [Qemu-devel] [PATCH v4 09/14] contrib/ivshmem-*: switch to g_malloc0/g_free, David Marchand, 2014/09/02
- [Qemu-devel] [PATCH v4 10/14] contrib/ivshmem-server: fix mem leak on error, David Marchand, 2014/09/02
- [Qemu-devel] [PATCH v4 11/14] contrib/ivshmem-*: rework error handling, David Marchand, 2014/09/02
- [Qemu-devel] [PATCH v4 12/14] contrib/ivshmem-*: various fixes,
David Marchand <=
- [Qemu-devel] [PATCH v4 13/14] contrib/ivshmem-server: align server default parameter values, David Marchand, 2014/09/02
- [Qemu-devel] [PATCH v4 14/14] ivshmem: add check on protocol version in QEMU, David Marchand, 2014/09/02
- Re: [Qemu-devel] [PATCH v4 00/14] ivshmem: update documentation, add client/server tools, Eric Blake, 2014/09/02