From 50d34c4e357c41231b1106fc3f46cfd479a31e41 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 24 Nov 2015 18:06:25 +0100 Subject: [PATCH 1/5] qemu-doc: Fix ivshmem example markup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use @var{foo} like we do everywhere else, not . Signed-off-by: Markus Armbruster Message-Id: <1448384789-14830-2-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau --- qemu-doc.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 460ab716ac..c9b7069637 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -1256,7 +1256,7 @@ zero-copy communication to the application level of the guests. The basic syntax is: @example -qemu-system-i386 -device ivshmem,size=[,shm=] +qemu-system-i386 -device ivshmem,size=@var{size}[,shm=@var{shm-name}] @end example If desired, interrupts can be sent between guest VMs accessing the same shared @@ -1267,12 +1267,12 @@ memory server is: @example # First start the ivshmem server once and for all -ivshmem-server -p -S -m -l -n +ivshmem-server -p @var{pidfile} -S @var{path} -m @var{shm-name} -l @var{shm-size} -n @var{vectors} # Then start your qemu instances with matching arguments -qemu-system-i386 -device ivshmem,size=,vectors=,chardev= +qemu-system-i386 -device ivshmem,size=@var{shm-size},vectors=@var{vectors},chardev=@var{id} [,msi=on][,ioeventfd=on][,role=peer|master] - -chardev socket,path=,id= + -chardev socket,path=@var{path},id=@var{id} @end example When using the server, the guest will be assigned a VM ID (>=0) that allows guests From a9282c25a5e2e860dfba5eca6d08fb2e42ee4f1a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 24 Nov 2015 18:06:26 +0100 Subject: [PATCH 2/5] qemu-doc: Fix ivshmem usage example with shm=... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The example suggests you can omit "shm". This isn't true; you must specify exactly one of "shm", "chardev", "memdev". Fix it. Signed-off-by: Markus Armbruster Message-Id: <1448384789-14830-3-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau --- qemu-doc.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index c9b7069637..68ca07533d 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -1256,7 +1256,7 @@ zero-copy communication to the application level of the guests. The basic syntax is: @example -qemu-system-i386 -device ivshmem,size=@var{size}[,shm=@var{shm-name}] +qemu-system-i386 -device ivshmem,size=@var{size},shm=@var{shm-name} @end example If desired, interrupts can be sent between guest VMs accessing the same shared From 1613094766602bdb8cae337ceecd8ab68f956197 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 24 Nov 2015 18:06:27 +0100 Subject: [PATCH 3/5] tests/ivshmem-test: Supply missing initializer in get_device() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the device isn't found, the assertion uses dev without initialization. Fix that. Signed-off-by: Markus Armbruster Message-Id: <1448384789-14830-4-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau --- tests/ivshmem-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c index f1793ba6fb..8f1a849ab4 100644 --- a/tests/ivshmem-test.c +++ b/tests/ivshmem-test.c @@ -40,6 +40,7 @@ static QPCIDevice *get_device(void) QPCIBus *pcibus; pcibus = qpci_init_pc(); + dev = NULL; qpci_device_foreach(pcibus, 0x1af4, 0x1110, save_fn, &dev); g_assert(dev != NULL); From 2825717c02f5b1367e8e315b222888db00618170 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 24 Nov 2015 18:06:28 +0100 Subject: [PATCH 4/5] ivshmem: Mark questionable socket type test FIXME MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau --- hw/misc/ivshmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 83d7bd3e5f..edb22704c7 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -939,6 +939,7 @@ static void pci_ivshmem_realize(PCIDevice *dev, Error **errp) memory_region_add_subregion(&s->bar, 0, mr); pci_register_bar(PCI_DEVICE(s), 2, attr, &s->bar); } else if (s->server_chr != NULL) { + /* FIXME do not rely on what chr drivers put into filename */ if (strncmp(s->server_chr->filename, "unix:", 5)) { error_setg(errp, "chardev is not a unix client socket"); return; From 1d649244b3695cb148dd2ae66999db0f6f9566b3 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 24 Nov 2015 18:06:29 +0100 Subject: [PATCH 5/5] ivshmem: Rename property memdev to x-memdev for 2.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The device's guest interface and its QEMU user interface are flawed^Whotly debated. We'll resolve that in the next development cycle, probably by deprecating the device in favour of a cleaned up, but not quite compatible revision. To avoid adding more baggage to the soon-to-be-deprecated interface, mark property "memdev" as experimental, by renaming it to "x-memdev". It's the only recent user interface change. Signed-off-by: Markus Armbruster Message-Id: <1448384789-14830-6-git-send-email-armbru@redhat.com> [Update of qemu-doc.texi squashed in] Reviewed-by: Marc-André Lureau --- hw/misc/ivshmem.c | 8 +++----- qemu-doc.texi | 2 +- tests/ivshmem-test.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index edb22704c7..f73f0c2b17 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -60,8 +60,6 @@ #define IVSHMEM(obj) \ OBJECT_CHECK(IVShmemState, (obj), TYPE_IVSHMEM) -#define IVSHMEM_MEMDEV_PROP "memdev" - typedef struct Peer { int nb_eventfds; EventNotifier *eventfds; @@ -857,8 +855,8 @@ static void pci_ivshmem_realize(PCIDevice *dev, Error **errp) PCI_BASE_ADDRESS_MEM_PREFETCH; if (!!s->server_chr + !!s->shmobj + !!s->hostmem != 1) { - error_setg(errp, "You must specify either a shmobj, a chardev" - " or a hostmem"); + error_setg(errp, + "You must specify either 'shm', 'chardev' or 'x-memdev'"); return; } @@ -1182,7 +1180,7 @@ static void ivshmem_init(Object *obj) { IVShmemState *s = IVSHMEM(obj); - object_property_add_link(obj, IVSHMEM_MEMDEV_PROP, TYPE_MEMORY_BACKEND, + object_property_add_link(obj, "x-memdev", TYPE_MEMORY_BACKEND, (Object **)&s->hostmem, ivshmem_check_memdev_is_busy, OBJ_PROP_LINK_UNREF_ON_RELEASE, diff --git a/qemu-doc.texi b/qemu-doc.texi index 68ca07533d..ffc3e50abb 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -1300,7 +1300,7 @@ a memory backend that has hugepage support: @example qemu-system-i386 -object memory-backend-file,size=1G,mem-path=/mnt/hugepages/my-shmem-file,id=mb1 - -device ivshmem,memdev=mb1 + -device ivshmem,x-memdev=mb1 @end example ivshmem-server also supports hugepages mount points with the diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c index 8f1a849ab4..03c7b962a3 100644 --- a/tests/ivshmem-test.c +++ b/tests/ivshmem-test.c @@ -393,7 +393,7 @@ static void test_ivshmem_memdev(void) /* just for the sake of checking memory-backend property */ setup_vm_cmd(&state, "-object memory-backend-ram,size=1M,id=mb1" - " -device ivshmem,memdev=mb1", false); + " -device ivshmem,x-memdev=mb1", false); qtest_quit(state.qtest); }