[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/39] ivshmem: improve error
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH 16/39] ivshmem: improve error |
Date: |
Fri, 26 Jun 2015 16:49:22 +0200 |
The test whether the chardev is an AF_UNIX socket rejects
"-chardev socket,id=chr0,path=/tmp/foo,server,nowait -device
ivshmem,chardev=chr0", but fails to explain why.
Use an explicit error on why a chardev may be rejected.
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/misc/ivshmem.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 0cc5682..ab13f70 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -301,7 +301,7 @@ static CharDriverState* create_eventfd_chr_device(void *
opaque, EventNotifier *
chr = qemu_chr_open_eventfd(eventfd);
if (chr == NULL) {
- error_report("creating eventfd for eventfd %d failed", eventfd);
+ error_report("creating chardriver for eventfd %d failed", eventfd);
return NULL;
}
qemu_chr_fe_claim_no_fail(chr);
@@ -778,8 +778,12 @@ static void pci_ivshmem_realize(PCIDevice *dev, Error
**errp)
attr |= PCI_BASE_ADDRESS_MEM_TYPE_64;
}
- if ((s->server_chr != NULL) &&
- (strncmp(s->server_chr->filename, "unix:", 5) == 0)) {
+ if (s->server_chr != NULL) {
+ if (strncmp(s->server_chr->filename, "unix:", 5)) {
+ error_setg(errp, "chardev is not a unix client socket");
+ return;
+ }
+
/* if we get a UNIX socket as the parameter we will talk
* to the ivshmem server to receive the memory region */
--
2.4.3
- [Qemu-devel] [PATCH 07/39] ivshmem: remove superflous ivshmem_attr field, (continued)
- [Qemu-devel] [PATCH 07/39] ivshmem: remove superflous ivshmem_attr field, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 08/39] ivshmem: remove useless doorbell field, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 06/39] ivshmem: remove unnecessary dup(), Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 09/39] ivshmem: more qdev conversion, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 10/39] ivshmem: remove last exit(1), Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 11/39] ivshmem: increase_dynamic_storage() improvements, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 13/39] ivshmem: initialize max_peer to -1, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 12/39] ivshmem: remove useless ivshmem_update_irq() val argument, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 14/39] ivshmem: remove max_peer field, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 15/39] ivshmem: improve debug messages, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 16/39] ivshmem: improve error,
Marc-André Lureau <=
- [Qemu-devel] [PATCH 17/39] ivshmem: print error on invalid peer id, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 18/39] ivshmem: add a warning if eventfd value is 0, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 19/39] ivshmem: beautify a bit the code, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 20/39] ivshmem: use common return, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 22/39] ivshmem: migrate with VMStateDescription, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 21/39] ivshmem: use common is_power_of_2(), Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 24/39] ivshmem: check shm isn't already initialized, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 23/39] ivshmem: shmfd can be 0, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 25/39] ivshmem: add device description, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 26/39] ivshmem: fix pci_ivshmem_exit(), Marc-André Lureau, 2015/06/26