aboutsummaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)AuthorFilesLines
2020-01-23libvhost-user: Fix some memtable remap casesDr. David Alan Gilbert2-8/+28
If a new setmemtable command comes in once the vhost threads are running, it will remap the guests address space and the threads will now be looking in the wrong place. Fortunately we're running this command under lock, so we can update the queue mappings so that threads will look in the new-right place. Note: This doesn't fix things that the threads might be doing without a lock (e.g. a readv/writev!) That's for another time. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-01-23contrib/libvhost-user: Protect slave fd with mutexDr. David Alan Gilbert2-4/+23
In future patches we'll be performing commands on the slave-fd driven by commands on queues, since those queues will be driven by individual threads we need to make sure they don't attempt to use the slave-fd for multiple commands in parallel. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-01-05Implement backend program convention command for vhost-user-blkMicky Yun Chan1-45/+65
This patch is to add standard commands defined in docs/interop/vhost-user.rst For vhost-user-* program Signed-off-by: Micky Yun Chan (michiboo) <chanmickyyun@gmail.com> Message-Id: <20191209015331.5455-1-chanmickyyun@gmail.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2020-01-03Merge remote-tracking branch 'remotes/kraxel/tags/vga-20191220-pull-request' ↵Peter Maydell1-1/+1
into staging vga: two little bugfixes. # gpg: Signature made Fri 20 Dec 2019 06:06:04 GMT # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/vga-20191220-pull-request: display/bochs-display: fix memory leak vhost-user-gpu: Drop trailing json comma Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-12-20vhost-user-gpu: Drop trailing json commaCole Robinson1-1/+1
Trailing comma is not valid json: $ cat contrib/vhost-user-gpu/50-qemu-gpu.json.in | jq parse error: Expected another key-value pair at line 5, column 1 Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 7f5dd2ac9f3504e2699f23e69bc3d8051b729832.1568925097.git.crobinso@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-12-17vhost-user-scsi: fix printf format warningMarc-André Lureau1-1/+1
Fixes: ../contrib/vhost-user-scsi/vhost-user-scsi.c:118:57: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat] g_warning("Unable to determine cdb len (0x%02hhX)", cdb[0] >> 5); Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-11-20vhost-user-input: use free(elem) instead of g_free(elem)Stefan Hajnoczi1-2/+2
The virtqueue element returned by vu_queue_pop() is allocated using malloc(3) by virtqueue_alloc_element(). Use the matching free(3) function instead of glib's g_free(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20191119111626.112206-1-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2019-11-20libvhost-user: Zero memory allocated for VuVirtqInflightDescXie Yongji1-1/+1
Use a zero-initialized VuVirtqInflightDesc struct to avoid that scan-build reports that vq->resubmit_list[0].counter may be garbage value in vu_check_queue_inflights(). Fixes: 5f9ff1eff ("libvhost-user: Support tracking inflight I/O in shared memory") Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Xie Yongji <xieyongji@baidu.com> Message-Id: <20191119075759.4334-1-xieyongji@baidu.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-11-12ivshmem-server: Terminate also on SIGINTJan Kiszka1-2/+3
Allows to shutdown a foreground session via ctrl-c. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Claudio Fontana <claudio.fontana@suse.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Message-Id: <99c1a7bd-1876-66a2-4b8e-d5bc86116fe7@web.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-11-12ivshmem-server: Clean up shmem on shutdownJan Kiszka1-0/+6
So far, the server leaves the posix shared memory object behind when terminating, requiring the user to explicitly remove it in order to start a new instance. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Claudio Fontana <claudio.fontana@suse.com> Message-Id: <d938a62c-7538-9d2b-cc0a-13b240ab9141@web.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-10-30Merge remote-tracking branch 'remotes/stsquad/tags/pull-gitdm-next-271019-1' ↵Peter Maydell2-0/+3
into staging gitdm updates - Add a few individuals - Add China Mobile # gpg: Signature made Sun 27 Oct 2019 19:21:15 GMT # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-gitdm-next-271019-1: contrib/gitdm: add China Mobile to the domain map contrib/gitdm: add Andrey to the individual group contrib/gitdm: add Emanuele as an individual Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-10-27contrib/gitdm: add China Mobile to the domain mapAlex Bennée1-0/+1
We've had a number of contributions from this domain. Mao has confirmed they are company contributions. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> Cc: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
2019-10-27contrib/gitdm: add Andrey to the individual groupAlex Bennée1-0/+1
Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>
2019-10-27contrib/gitdm: add Emanuele as an individualAlex Bennée1-0/+1
Again this is guess work based on public websites. Please confirm. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
2019-10-26core: replace getpagesize() with qemu_real_host_page_sizeWei Yang1-1/+1
There are three page size in qemu: real host page size host page size target page size All of them have dedicate variable to represent. For the last two, we use the same form in the whole qemu project, while for the first one we use two forms: qemu_real_host_page_size and getpagesize(). qemu_real_host_page_size is defined to be a replacement of getpagesize(), so let it serve the role. [Note] Not fully tested for some arch or device. Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> Message-Id: <20191013021145.16011-3-richardw.yang@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-09-04Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell1-9/+10
virtio,vhost: fixes, features, cleanups. FLR support. Misc fixes, cleanups. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Wed 04 Sep 2019 12:53:35 BST # gpg: using RSA key 281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full] # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" [full] # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: libvhost-user: introduce and use vu_has_protocol_feature() libvhost-user: fix SLAVE_SEND_FD handling virtio-pci: Add Function Level Reset support virtio-rng: change default backend to rng-builtin virtio-rng: Keep the default backend out of VirtIORNGConf rng-builtin: add an RNG backend that uses qemu_guest_getrandom() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-09-04libvhost-user: introduce and use vu_has_protocol_feature()Johannes Berg1-10/+10
This simplifies the various has_feature() checks, we already have vu_has_feature() but it checks features, not protocol features. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Message-Id: <20190904065021.1360-1-johannes@sipsolutions.net> Reviewed-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-09-04libvhost-user: fix SLAVE_SEND_FD handlingJohannes Berg1-1/+2
It doesn't look like this could possibly work properly since VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD is defined to 10, but the dev->protocol_features has a bitmap. I suppose the peer this was tested with also supported VHOST_USER_PROTOCOL_F_LOG_SHMFD, in which case the test would always be false, but nevertheless the code seems wrong. Use has_feature() to fix this. Fixes: d84599f56c82 ("libvhost-user: support host notifier") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Message-Id: <20190903200422.11693-1-johannes@sipsolutions.net> Reviewed-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-09-02contrib/gitdm: Add RT-RK to the domain-mapPhilippe Mathieu-Daudé1-0/+1
This company has at least 7 contributors, add a domain-map entry. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190822231231.1306-1-philmd@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2019-09-02.mailmap/aliases: add some further commentaryAlex Bennée2-3/+20
The two files are not interchangeable but a change to one *might* require a change to the other so lets flag that up with an explanation of what both files are trying to achieve. While we are at it document the many forms .mailmap can take in the header. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
2019-09-02contrib/gitdm: Add armbru@pond.sub.org to group-map-redhatMarkus Armbruster1-0/+1
Just to get the (few) accidental uses of my private e-mail address attributed correctly. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190822122350.29852-3-armbru@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2019-09-02contrib/gitdm: filetype interface is not in order, fixMarkus Armbruster1-1/+1
gitm prints the rather cryptic message "interface not found, appended to the last order". This is because filetypes.txt has filetype interface, but neglects to mention it in order. Fix that. Fixes: 2f28271d807edfcdc47a280c06999dd866dcae10 Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Message-Id: <20190822122350.29852-2-armbru@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2019-07-22contrib/elf2dmp: Build download.o with CURL_CFLAGSPeter Maydell1-0/+3
contrib/elf2dmp has a source file which uses curl/curl.h; although we link the final executable with CURL_LIBS, we forgot to build this source file with CURL_CFLAGS, so if the curl header is in a place that's not already on the system include path then it will fail to build. Add a line specifying the cflags needed for download.o; while we are here, bring the specification of the libs into line with this, since using a per-object variable setting is preferred over adding them to the final executable link line. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20190719100955.17180-1-peter.maydell@linaro.org
2019-07-15rdmacm-mux: fix strcpy string warningMarc-André Lureau1-1/+1
../contrib/rdmacm-mux/main.c: In function ‘parse_args’: ../contrib/rdmacm-mux/main.c:118:13: error: ‘strncpy’ specified bound 3835 equals destination size [-Werror=stringop-truncation] 118 | strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX); Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190712165154.11504-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-07-04libvhost-user: implement VHOST_USER_PROTOCOL_F_MQStefan Hajnoczi1-3/+4
Existing vhost-user device backends, including vhost-user-scsi and vhost-user-blk, support multiqueue but libvhost-user currently does not advertise this. VHOST_USER_PROTOCOL_F_MQ enables the VHOST_USER_GET_QUEUE_NUM request needed for a vhost-user master to query the number of queues. For example, QEMU's vhost-user-net master depends on VHOST_USER_PROTOCOL_F_MQ for multiqueue. If you're wondering how any device backend with more than one virtqueue functions today, it's because device types with a fixed number of virtqueues do not require querying the number of queues. Therefore the vhost-user master for vhost-user-input with 2 virtqueues, for example, doesn't actually depend on VHOST_USER_PROTOCOL_F_MQ. It just enables virtqueues 0 and 1 without asking. Let there be multiqueue! Suggested-by: Sebastien Boeuf <sebastien.boeuf@intel.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190626074815.19994-4-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-07-04libvhost-user: support many virtqueuesStefan Hajnoczi8-37/+77
Currently libvhost-user is hardcoded to at most 8 virtqueues. The device backend should decide the number of virtqueues, not libvhost-user. This is important for multiqueue device backends where the guest driver needs an accurate number of virtqueues. This change breaks libvhost-user and libvhost-user-glib API stability. There is no stability guarantee yet, so make this change now and update all in-tree library users. This patch touches up vhost-user-blk, vhost-user-gpu, vhost-user-input, vhost-user-scsi, and vhost-user-bridge. If the device has a fixed number of queues that exact number is used. Otherwise the previous default of 8 virtqueues is used. vu_init() and vug_init() can now fail if malloc() returns NULL. I considered aborting with an error in libvhost-user but it should be safe to instantiate new vhost-user instances at runtime without risk of terminating the process. Therefore callers need to handle the vu_init() failure now. vhost-user-blk and vhost-user-scsi duplicate virtqueue index checks that are already performed by libvhost-user. This code would need to be modified to use max_queues but remove it completely instead since it's redundant. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190626074815.19994-3-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-07-04libvhost-user: add vmsg_set_reply_u64() helperStefan Hajnoczi1-13/+13
The VhostUserMsg request is reused as the reply by message processing functions. This is risky since request fields may corrupt the reply if the vhost-user message handler function forgets to re-initialize them. Changing this practice would be very invasive but we can introduce a helper function to make u64 payload replies safe. This also eliminates code duplication in message processing functions. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190626074815.19994-2-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-06-16vhost-user-gpu: initialize msghdr & iov at declarationMarc-André Lureau1-13/+8
This should fix uninitialized fields found by coverity CID 1401762. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190605145829.7674-6-marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2019-06-16vhost-user-input: check ioctl(EVIOCGNAME) return valueMarc-André Lureau1-1/+5
This should fix coverity CID 1401704. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190605145829.7674-5-marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2019-06-16vhost-user: improve error reportMarc-André Lureau2-2/+2
g_printerr() needs a trailing \n Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190605145829.7674-4-marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-06-16vhost-user: check unix_listen() return valueMarc-André Lureau2-0/+8
This check shouldn't be necessary, since &error_fatal is given as argument and will exit() on failure. However, this change should silence coverity CID 1401761 & 1401705. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190605145829.7674-3-marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-06-16vhost-user-gpu: do not send scanout update if no GPU socketMarc-André Lureau1-1/+1
Should fix coverity CID 1401760. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190605145829.7674-2-marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-06-12Clean up a header guard symbols (again)Markus Armbruster3-6/+9
Commit d52c454aad "contrib: add vhost-user-gpu" and "c68082c43a virtio-gpu: split virtio-gpu-pci & virtio-vga" created headers with unusual header guard symbols. Clean them up Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190607141321.9726-1-armbru@redhat.com>
2019-06-12Clean up a few header guard symbolsMarkus Armbruster1-3/+2
Commit 58ea30f5145 "Clean up header guards that don't match their file name" messed up contrib/elf2dmp/qemu_elf.h and tests/migration/migration-test.h. It missed target/cris/opcode-cris.h and tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h due to the scripts/clean-header-guards.pl bug fixed in the previous commit. Commit a8b991b52dc "Clean up ill-advised or unusual header guards" missed include/hw/xen/io/ring.h for the same reason. Commit 3979fca4b69 "disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h" neglected to update the guard symbol for the rename. Commit a331c6d7741 "semihosting: implement a semihosting console" created include/hw/semihosting/console.h with an ill-advised guard symbol. Clean them up. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190604181618.19980-4-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2019-06-12Include qemu-common.h exactly where neededMarkus Armbruster3-3/+0
No header includes qemu-common.h after this commit, as prescribed by qemu-common.h's file comment. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-5-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and net/tap-bsd.c fixed up]
2019-05-29contrib: add vhost-user-gpuMarc-André Lureau8-0/+2376
Add a vhost-user gpu backend, based on virtio-gpu/3d device. It is associated with a vhost-user-gpu device. Various TODO and nice to have items: - multi-head support - crash & resume handling - accelerated rendering/display that avoids the waiting round trips - edid support Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20190524130946.31736-6-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-29vhost-user: add vhost_user_gpu_set_socket()Marc-André Lureau2-0/+2
Add a new vhost-user message to give a unix socket to a vhost-user backend for GPU display updates. Back when I started that work, I added a new GPU channel because the vhost-user protocol wasn't bidirectional. Since then, there is a vhost-user-slave channel for the slave to send requests to the master. We could extend it with GPU messages. However, the GPU protocol is quite orthogonal to vhost-user, thus I chose to have a new dedicated channel. See vhost-user-gpu.rst for the protocol details. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20190524130946.31736-2-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-22contrib: add vhost-user-inputMarc-André Lureau2-0/+394
Add a vhost-user input backend example, based on virtio-input-host device. It takes an evdev path as argument, and can be associated with a vhost-user-input device via a UNIX socket: $ vhost-user-input -p /dev/input/eventX -s /tmp/vui.sock $ qemu ... -chardev socket,id=vuic,path=/tmp/vui.sock -device vhost-user-input-pci,chardev=vuic This example is intentionally not included in $TOOLS, and not installed by default. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20190514104126.6294-4-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-22libvhost-user: fix -Werror=format= on ppc64Marc-André Lureau1-2/+4
That should fix the following warning: /home/pm215/qemu/contrib/libvhost-user/libvhost-user.c: In function ‘vu_set_mem_table_exec_postcopy’: /home/pm215/qemu/contrib/libvhost-user/libvhost-user.c:666:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘__u64’ [-Werror=format=] DPRINT("%s: region %d: Registered userfault for %llx + %llx\n", ^ /home/pm215/qemu/contrib/libvhost-user/libvhost-user.c:666:9: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 6 has type ‘__u64’ [-Werror=format=] cc1: all warnings being treated as errors Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190514104126.6294-3-marcandre.lureau@redhat.com { kraxel: s/PRIu64/PRIx64/ ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-22libvhost-user: fix cast warnings on 32 bitsMarc-André Lureau1-3/+3
Fixes warnings: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190514104126.6294-2-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-20libvhost-user: fix bad vu_log_writeLi Feng1-1/+1
Mark dirty as page, the step of each call is 1. Signed-off-by: Li Feng <fengli@smartx.com> Message-Id: <20190420091016.213160-1-fengli@smartx.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-05-20contrib/vhost-user-blk: enable inflight I/O trackingXie Yongji1-1/+2
This patch enables inflight I/O tracking for vhost-user-blk backend so that we could restart it safely. Signed-off-by: Xie Yongji <xieyongji@baidu.com> Signed-off-by: Zhang Yu <zhangyu31@baidu.com> Message-Id: <20190320112646.3712-8-xieyongji@baidu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-05-13Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2019-05-13' into ↵Peter Maydell5-20/+18
staging Miscellaneous patches for 2019-05-13 # gpg: Signature made Mon 13 May 2019 08:04:02 BST # gpg: using RSA key 3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-misc-2019-05-13: Clean up decorations and whitespace around header guards Normalize header guard symbol definition. Clean up ill-advised or unusual header guards Clean up header guards that don't match their file name target/xtensa: Clean up core-isa.h header guards linux-user/nios2 linux-user/riscv: Clean up header guards authz: Normalize #include "authz/trace.h" to "trace.h" Use #include "..." for our own headers, <...> for others Clean up includes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-05-13Clean up header guards that don't match their file nameMarkus Armbruster1-3/+3
Header guard symbols should match their file name to make guard collisions less likely. Cleaned up with scripts/clean-header-guards.pl, followed by some renaming of new guard symbols picked by the script to better ones. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190315145123.28030-6-armbru@redhat.com> [Rebase to master: update include/hw/net/ne2000-isa.h]
2019-05-13Use #include "..." for our own headers, <...> for othersMarkus Armbruster2-13/+13
Also delete a few redundant #include. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190315145123.28030-2-armbru@redhat.com>
2019-05-13Clean up includesMarkus Armbruster2-4/+2
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes, with the changes to the following files manually reverted: contrib/libvhost-user/libvhost-user-glib.h contrib/libvhost-user/libvhost-user.c contrib/libvhost-user/libvhost-user.h linux-user/mips64/cpu_loop.c linux-user/mips64/signal.c linux-user/sparc64/cpu_loop.c linux-user/sparc64/signal.c linux-user/x86_64/cpu_loop.c linux-user/x86_64/signal.c slirp/src/* target/s390x/gen-features.c tests/fp/platform.h tests/migration/s390x/a-b-bios.c tests/test-rcu-simpleq.c tests/test-rcu-tailq.c tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c We're in the process of spinning out slirp/. tests/fp/platform.h is has to include qemu/osdep.h because tests/fp/berkeley-softfloat-3/ and tests/fp/berkeley-testfloat-3/ don't. tests/uefi-test-tools/ is guest software. The remaining reverts are the same as in commit b7d89466dde. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190313162812.8885-1-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Revert change to tests/fp/platform.h, adjust commit message]
2019-05-10libvhost-user: add PROTOCOL_F_CONFIG if {set, get}_configMarc-André Lureau1-0/+4
Add the config protocol feature bit if the set_config & get_config callbacks are implemented. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20190503130034.24916-3-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-10libvhost-user: fix -Waddress-of-packed-memberMarc-André Lureau1-3/+3
/home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c: In function ‘vu_set_mem_table_exec_postcopy’: /home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c:546:31: warning: taking address of packed member of ‘struct VhostUserMsg’ may result in an unaligned pointer value [-Waddress-of-packed-member] 546 | VhostUserMemory *memory = &vmsg->payload.memory; | ^~~~~~~~~~~~~~~~~~~~~ /home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c: In function ‘vu_set_mem_table_exec’: /home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c:688:31: warning: taking address of packed member of ‘struct VhostUserMsg’ may result in an unaligned pointer value [-Waddress-of-packed-member] 688 | VhostUserMemory *memory = &vmsg->payload.memory; | ^~~~~~~~~~~~~~~~~~~~~ /home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c: In function ‘vu_set_vring_addr_exec’: /home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c:817:36: warning: taking address of packed member of ‘struct VhostUserMsg’ may result in an unaligned pointer value [-Waddress-of-packed-member] 817 | struct vhost_vring_addr *vra = &vmsg->payload.addr; | ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20190503130034.24916-2-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-05-07QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targetsCao Jiaxi1-1/+1
gcc_struct is for x86 only, and it generates an warning on ARM64 Clang/MinGW targets. Signed-off-by: Cao Jiaxi <driver1998@foxmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20190503003618.10089-1-driver1998@foxmail.com [PMM: dropped the slirp change as slirp is now a submodule] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-16contrib/rdmacm-mux: Fix out-of-bounds riskYuval Shaia1-2/+33
The function get_fd extract context from the received MAD message and uses it as a key to fetch the destination fd from the mapping table. A context can be dgid in case of CM request message or comm_id in case of CM SIDR response message. When MAD message with a smaller size as expected for the message type received we are hitting out-of-bounds where we are looking for the context out of message boundaries. Fix it by validating the message size. Reported-by Sam Smith <sam.j.smith@oracle.com> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Message-Id: <20190212112347.1605-1-yuval.shaia@oracle.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>