From 28452758c405e16d9890c44d6031d44233e8cb38 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 24 Apr 2015 19:35:17 +0800 Subject: libqos: Allow calling guest_free on NULL pointer Signed-off-by: Fam Zheng Reviewed-by: John Snow Signed-off-by: Paolo Bonzini --- tests/libqos/malloc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/libqos') diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c index 827613005a..82b9df537a 100644 --- a/tests/libqos/malloc.c +++ b/tests/libqos/malloc.c @@ -285,6 +285,9 @@ uint64_t guest_alloc(QGuestAllocator *allocator, size_t size) void guest_free(QGuestAllocator *allocator, uint64_t addr) { + if (!addr) { + return; + } mlist_free(allocator, addr); if (allocator->opts & ALLOC_PARANOID) { mlist_check(allocator); -- cgit v1.2.3-55-g7522 From bea2f0982b335c13448dbde8a409107764fa8b59 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 24 Apr 2015 19:35:18 +0800 Subject: libqos: Complete virtio device ID definition list Signed-off-by: Fam Zheng Signed-off-by: Paolo Bonzini --- tests/libqos/virtio.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/libqos') diff --git a/tests/libqos/virtio.h b/tests/libqos/virtio.h index 2449feec59..01012787b8 100644 --- a/tests/libqos/virtio.h +++ b/tests/libqos/virtio.h @@ -19,8 +19,14 @@ #define QVIRTIO_DRIVER 0x2 #define QVIRTIO_DRIVER_OK 0x4 -#define QVIRTIO_NET_DEVICE_ID 0x1 -#define QVIRTIO_BLK_DEVICE_ID 0x2 +#define QVIRTIO_NET_DEVICE_ID 0x1 +#define QVIRTIO_BLK_DEVICE_ID 0x2 +#define QVIRTIO_CONSOLE_DEVICE_ID 0x3 +#define QVIRTIO_RNG_DEVICE_ID 0x4 +#define QVIRTIO_BALLOON_DEVICE_ID 0x5 +#define QVIRTIO_RPMSG_DEVICE_ID 0x7 +#define QVIRTIO_SCSI_DEVICE_ID 0x8 +#define QVIRTIO_9P_DEVICE_ID 0x9 #define QVIRTIO_F_NOTIFY_ON_EMPTY 0x01000000 #define QVIRTIO_F_ANY_LAYOUT 0x08000000 -- cgit v1.2.3-55-g7522