aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-24Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell147-1075/+1514
staging Pull request This includes the atomic_ -> qatomic_ rename that touches many files and is prone to conflicts. # gpg: Signature made Wed 23 Sep 2020 17:08:43 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: qemu/atomic.h: rename atomic_ to qatomic_ tests: add test-fdmon-epoll fdmon-poll: reset npfd when upgrading to fdmon-epoll gitmodules: add qemu.org vbootrom submodule gitmodules: switch to qemu.org meson mirror gitmodules: switch to qemu.org qboot mirror docs/system: clarify deprecation schedule virtio-crypto: don't modify elem->in/out_sg virtio-blk: undo destructive iov_discard_*() operations util/iov: add iov_discard_undo() virtio: add vhost-user-fs-ccw device libvhost-user: handle endianness as mandated by the spec MAINTAINERS: add Stefan Hajnoczi as block/nvme.c maintainer Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-24Merge remote-tracking branch ↵Peter Maydell5-32/+80
'remotes/kraxel/tags/audio-20200923-pull-request' into staging audio: various buffering fixes. audio: build spiceaudio as module. # gpg: Signature made Wed 23 Sep 2020 10:09:46 BST # 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/audio-20200923-pull-request: audio: build spiceaudio as module audio: remove qemu_spice_audio_init() audio: run downstream playback queue unconditionally audio: align audio_generic_write with audio_pcm_hw_run_out audio: remove unnecessary calls to put_buffer_in audio: align audio_generic_read with audio_pcm_hw_run_in audio/spiceaudio: always rate limit playback stream audio/audio: fix video playback slowdown with spiceaudio audio: handle buf == NULL in put_buffer_out() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-24Merge remote-tracking branch ↵Peter Maydell35-182/+208
'remotes/ehabkost/tags/machine-next-pull-request' into staging machine + QOM queue, 2020-09-22 QOM cleanups: * Convert instance properties to class properties (Eduardo Habkost) * simplify object_find_property / object_class_find_property (Daniel P. Berrangé) Deprecated feature removal: * Drop support for invalid topologies (Igor Mammedov) # gpg: Signature made Tue 22 Sep 2020 23:25:01 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: sifive_u: Register "start-in-flash" as class property sifive_e: Register "revb" as class property i440fx: Register i440FX-pcihost properties as class properties machine: Register "memory-backend" as class property xlnx-zcu102: Register properties as class properties cpu/core: Register core-id and nr-threads as class properties s390x: Register all CPU properties as class properties cryptodev-backend: Register "chardev" as class property cryptodev-vhost-user: Register "chardev" as class property smp: drop support for deprecated (invalid topologies) qom: simplify object_find_property / object_class_find_property Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-23docs/system/deprecated: Move lm32 and unicore32 to the right sectionThomas Huth1-16/+16
lm32 and unicore32 are softmmut targets, and not linux-user targets. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200923080015.77373-1-thuth@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-23migration/multifd: Remove superfluous semicolonsPhilippe Mathieu-Daudé1-1/+1
checkpatch.pl report superfluous semicolons since commit ee0f3c09e01, but this one was missed: scripts/checkpatch.pl d32ca5ad798~..d32ca5ad798 ERROR: superfluous trailing semicolon #498: FILE: migration/multifd.c:308: + ram_counters.transferred += transferred;; total: 1 errors, 1 warnings, 2073 lines checked Fixes: d32ca5ad798 ("multifd: Split multifd code into its own file") Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Li Qiang <liq3ea@gmail.com> Message-Id: <20200921040231.437653-1-f4bug@amsat.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-23timer: Fix timer_mod_anticipate() documentationPhilippe Mathieu-Daudé1-1/+1
timer_mod_anticipate() will be scaled to the timer unit, which is not always nanosecond. Fix the documentation. Fixes: add40e9777d ("timer: add timer_mod_anticipate*") Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20200920155042.400737-1-f4bug@amsat.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-23vhost-vdpa: remove useless variableLaurent Vivier1-6/+3
in vhost_vdpa_listener_region_del(), try_unmap is always true and so, vhost_vdpa_dma_unmap() is always called. We can remove the variable Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Message-Id: <20200920152024.860172-1-lvivier@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-23Add *.pyc back to the .gitignore fileThomas Huth1-0/+1
Python still dumps its bytecode into the source directory, so we should continue to ignore the *.pyc files. Fixes: 0e72b7df4d ("Simplify the .gitignore file") Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20200919101859.28739-1-thuth@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-23virtio: vdpa: omit check return of g_mallocLi Qiang1-6/+1
If g_malloc fails, the application will be terminated. No need to check the return value of g_malloc. Signed-off-by: Li Qiang <liq3ea@163.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20200819144309.67579-1-liq3ea@163.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-23meson: fix static flag summaryLaurent Vivier1-1/+1
'static build:' must display value of CONFIG_STATIC rather than value of CONFIG_TOOLS. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200917140700.673171-1-lvivier@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-23vhost-vdpa: fix indentation in vdpa_opsStefano Garzarella1-2/+2
This patch fixes wrong indentation of some vdpa_ops fields introduced with the initial commit 108a64818e ("vhost-vdpa: introduce vhost-vdpa backend") Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20200916152634.56917-1-sgarzare@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-23qemu/atomic.h: rename atomic_ to qatomic_Stefan Hajnoczi133-1024/+1047
clang's C11 atomic_fetch_*() functions only take a C11 atomic type pointer argument. QEMU uses direct types (int, etc) and this causes a compiler error when a QEMU code calls these functions in a source file that also included <stdatomic.h> via a system header file: $ CC=clang CXX=clang++ ./configure ... && make ../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid) Avoid using atomic_*() names in QEMU's atomic.h since that namespace is used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h and <stdatomic.h> can co-exist. I checked /usr/include on my machine and searched GitHub for existing "qatomic_" users but there seem to be none. This patch was generated using: $ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \ sort -u >/tmp/changed_identifiers $ for identifier in $(</tmp/changed_identifiers); do sed -i "s%\<$identifier\>%q$identifier%g" \ $(git grep -I -l "\<$identifier\>") done I manually fixed line-wrap issues and misaligned rST tables. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200923105646.47864-1-stefanha@redhat.com>
2020-09-23Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-09-21' ↵Peter Maydell3-3/+76
into staging bitmaps patches for 2020-09-21 - Eric Blake: Improve 'qemu-img bitmap --merge' by not opening backing images # gpg: Signature made Tue 22 Sep 2020 01:58:31 BST # gpg: using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full] # gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full] # gpg: aka "[jpeg image of size 6874]" [full] # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A * remotes/ericb/tags/pull-bitmaps-2020-09-21: qemu-img: Support bitmap --merge into backing image Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-23tests: add test-fdmon-epollStefan Hajnoczi3-0/+77
Test aio_disable_external(), which switches from fdmon-epoll back to fdmon-poll. This resulted in an assertion failure that was fixed in the previous patch. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200915120339.702938-3-stefanha@redhat.com>
2020-09-23fdmon-poll: reset npfd when upgrading to fdmon-epollStefan Hajnoczi1-0/+1
npfd keeps track of how many pollfds are currently being monitored. It must be reset to 0 when fdmon_poll_wait() returns. When npfd reaches a treshold we switch to fdmon-epoll because it scales better. This patch resets npfd in the case where we switch to fdmon-epoll. Forgetting to do so results in the following assertion failure: util/fdmon-poll.c:65: fdmon_poll_wait: Assertion `npfd == 0' failed. Fixes: 1f050a4690f62a1e7dabc4f44141e9f762c3769f ("aio-posix: extract ppoll(2) and epoll(7) fd monitoring") Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1869952 Message-Id: <20200915120339.702938-2-stefanha@redhat.com>
2020-09-23gitmodules: add qemu.org vbootrom submoduleStefan Hajnoczi1-1/+1
The vbootrom module is needed for the new NPCM7xx ARM SoCs. The vbootrom.git repo is now mirrored on qemu.org. QEMU mirrors third-party code to ensure that users can always build QEMU even if the dependency goes offline and so QEMU meets its responsibilities to provide full source code under software licenses. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Cc: Havard Skinnemoen <hskinnemoen@google.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200915130834.706758-4-stefanha@redhat.com>
2020-09-23gitmodules: switch to qemu.org meson mirrorStefan Hajnoczi1-1/+1
QEMU now hosts a mirror of meson.git. QEMU mirrors third-party code to ensure that users can always build QEMU even if the dependency goes offline and so QEMU meets its responsibilities to provide full source code under software licenses. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200915130834.706758-3-stefanha@redhat.com>
2020-09-23gitmodules: switch to qemu.org qboot mirrorStefan Hajnoczi1-1/+1
QEMU now hosts a mirror of qboot.git. QEMU mirrors third-party code to ensure that users can always build QEMU even if the dependency goes offline and so QEMU meets its responsibilities to provide full source code under software licenses. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200915130834.706758-2-stefanha@redhat.com>
2020-09-23docs/system: clarify deprecation scheduleStefan Hajnoczi1-4/+5
The sentence explaining the deprecation schedule is ambiguous. Make it clear that a feature deprecated in the Nth release is guaranteed to remain available in the N+1th release. Removal can occur in the N+2nd release or later. As an example of this in action, see commit 25956af3fe5dd0385ad8017bc768a6afe41e2a74 ("block: Finish deprecation of 'qemu-img convert -n -o'"). The feature was deprecated in QEMU 4.2.0. It was present in the 5.0.0 release and removed in the 5.1.0 release. Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915150734.711426-1-stefanha@redhat.com>
2020-09-23virtio-crypto: don't modify elem->in/out_sgStefan Hajnoczi1-3/+14
A number of iov_discard_front/back() operations are made by virtio-crypto. The elem->in/out_sg iovec arrays are modified by these operations, resulting virtqueue_unmap_sg() calls on different addresses than were originally mapped. This is problematic because dirty memory may not be logged correctly, MemoryRegion refcounts may be leaked, and the non-RAM bounce buffer can be leaked. Take a copy of the elem->in/out_sg arrays so that the originals are preserved. The iov_discard_undo() API could be used instead (with better performance) but requires careful auditing of the code, so do the simple thing instead. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Message-Id: <20200917094455.822379-4-stefanha@redhat.com>
2020-09-23virtio-blk: undo destructive iov_discard_*() operationsStefan Hajnoczi2-2/+11
Fuzzing discovered that virtqueue_unmap_sg() is being called on modified req->in/out_sg iovecs. This means dma_memory_map() and dma_memory_unmap() calls do not have matching memory addresses. Fuzzing discovered that non-RAM addresses trigger a bug: void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len, bool is_write, hwaddr access_len) { if (buffer != bounce.buffer) { ^^^^^^^^^^^^^^^^^^^^^^^ A modified iov->iov_base is no longer recognized as a bounce buffer and the wrong branch is taken. There are more potential bugs: dirty memory is not tracked correctly and MemoryRegion refcounts can be leaked. Use the new iov_discard_undo() API to restore elem->in/out_sg before virtqueue_push() is called. Fixes: 827805a2492c1bbf1c0712ed18ee069b4ebf3dd6 ("virtio-blk: Convert VirtIOBlockReq.out to structrue") Reported-by: Alexander Bulekov <alxndr@bu.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Buglink: https://bugs.launchpad.net/qemu/+bug/1890360 Message-Id: <20200917094455.822379-3-stefanha@redhat.com>
2020-09-23util/iov: add iov_discard_undo()Stefan Hajnoczi3-4/+234
The iov_discard_front/back() operations are useful for parsing iovecs but they modify the array elements. If the original array is needed after parsing finishes there is currently no way to restore it. Although g_memdup() can be used before performing destructive iov_discard_front/back() operations, this is inefficient. Introduce iov_discard_undo() to restore the array to the state prior to an iov_discard_front/back() operation. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Message-Id: <20200917094455.822379-2-stefanha@redhat.com>
2020-09-23virtio: add vhost-user-fs-ccw deviceHalil Pasic2-0/+76
Wire up the CCW device for vhost-user-fs. Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Halil Pasic <pasic@linux.ibm.com> Message-id: 20200901150019.29229-2-mhartmay@linux.ibm.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-09-23libvhost-user: handle endianness as mandated by the specMarc Hartmayer1-34/+43
Since virtio existed even before it got standardized, the virtio standard defines the following types of virtio devices: + legacy device (pre-virtio 1.0) + non-legacy or VIRTIO 1.0 device + transitional device (which can act both as legacy and non-legacy) Virtio 1.0 defines the fields of the virtqueues as little endian, while legacy uses guest's native endian [1]. Currently libvhost-user does not handle virtio endianness at all, i.e. it works only if the native endianness matches with whatever is actually needed. That means things break spectacularly on big-endian targets. Let us handle virtio endianness for non-legacy as required by the virtio specification [1] and fence legacy virtio, as there is no safe way to figure out the needed endianness conversions for all cases. The fencing of legacy virtio devices is done in `vu_set_features_exec`. [1] https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-210003 Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Message-id: 20200901150019.29229-3-mhartmay@linux.ibm.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-09-23MAINTAINERS: add Stefan Hajnoczi as block/nvme.c maintainerStefan Hajnoczi1-1/+3
Development of the userspace NVMe block driver picked up again recently. After talking with Fam I am stepping up as block/nvme.c maintainer. Patches will be merged through my 'block' tree. Cc: Kevin Wolf <kwolf@redhat.com> Cc: Klaus Jensen <k.jensen@samsung.com> Cc: Fam Zheng <fam@euphon.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com> Acked-by: Klaus Jensen <k.jensen@samsung.com> Acked-by: Fam Zheng <fam@euphon.net> Message-id: 20200907111632.90499-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-09-23audio: build spiceaudio as moduleGerd Hoffmann1-2/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200916084117.21828-3-kraxel@redhat.com
2020-09-23audio: remove qemu_spice_audio_init()Gerd Hoffmann4-7/+16
Handle the spice special case in audio_init instead. With the qemu_spice_audio_init() symbol dependency being gone we can build spiceaudio as module. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200916084117.21828-2-kraxel@redhat.com
2020-09-23audio: run downstream playback queue unconditionallyVolker Rümelin1-0/+3
Run the downstream playback queue even if there are no samples in the mixing engine buffer. The downstream queue may still have queued samples. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-7-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-23audio: align audio_generic_write with audio_pcm_hw_run_outVolker Rümelin1-5/+27
The function audio_generic_write should work exactly like audio_pcm_hw_run_out. It's a very similar function working on a different buffer. This patch significantly reduces the number of drop-outs with the DirectSound backend. To hear the difference start qemu with -audiodev dsound,id=audio0,out.mixing-engine=off and play a song in the guest with and without this patch. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-6-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-23audio: remove unnecessary calls to put_buffer_inVolker Rümelin1-2/+0
This patch removes unnecessary calls to the pcm_ops function put_buffer_in(). No audio backend needs this call if the returned length of pcm_ops function get_buffer_in() is zero. For the DirectSound backend this prevents a call to dsound_unlock_in() without a preceding call to dsound_lock_in(). While Windows doesn't complain it seems wrong anyway. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-5-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-23audio: align audio_generic_read with audio_pcm_hw_run_inVolker Rümelin1-4/+15
The function audio_generic_read should work exactly like audio_pcm_hw_run_in. It's a very similar function working on a different buffer. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-4-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-23audio/spiceaudio: always rate limit playback streamVolker Rümelin2-7/+6
The playback rate with the spiceaudio backend is currently too fast if there's no spice client connected or the spice client can't play audio. Rate limit the audio playback stream in all cases. To calculate the rate correctly the limiter has to know the maximum buffer size. Fixes: 8c198ff065 ("spiceaudio: port to the new audio backend api") Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-3-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-23audio/audio: fix video playback slowdown with spiceaudioVolker Rümelin1-2/+5
This patch allows the audio backends get_buffer_out() functions to drop audio data and mitigates a bug reported on the qemu-devel mailing list. https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03832.html The new rules for the variables buf and size returned by get_buffer_out() are: size == 0: Downstream playback buffer is full. Retry later. size > 0, buf != NULL: Copy size bytes to buf for playback. size > 0, buf == NULL: Drop size bytes. The audio playback rate with spiceaudio for the no audio case is too fast, but that's what we had before commit fb35c2cec5 "audio/dsound: fix invalid parameters error". The complete fix comes with the next patch. Reported-by: Qi Zhou <atmgnd@outlook.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-2-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-23audio: handle buf == NULL in put_buffer_out()Volker Rümelin1-5/+8
With the next patch all audio backends put_buffer_out() functions have to handle the buf == NULL case, provided the get_buffer_out() function may return buf = NULL and size > 0. It turns out that all audio backends get_buffer_out() functions either can't return buf = NULL or return buf = NULL and size = 0 at the same time. The only exception is the spiceaudio backend where size may be uninitialized. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-id: 20200920171729.15861-1-vr_qemu@t-online.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-22sifive_u: Register "start-in-flash" as class propertyEduardo Habkost1-8/+8
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20200921221045.699690-25-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22sifive_e: Register "revb" as class propertyEduardo Habkost1-5/+6
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20200921221045.699690-24-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22i440fx: Register i440FX-pcihost properties as class propertiesEduardo Habkost1-16/+16
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20200921221045.699690-23-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22machine: Register "memory-backend" as class propertyEduardo Habkost1-6/+6
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20200921221045.699690-21-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22xlnx-zcu102: Register properties as class propertiesEduardo Habkost1-12/+13
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20200921221045.699690-20-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22cpu/core: Register core-id and nr-threads as class propertiesEduardo Habkost1-4/+4
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20200921221045.699690-18-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22s390x: Register all CPU properties as class propertiesEduardo Habkost3-21/+16
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Acked-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <20200921221045.699690-13-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22cryptodev-backend: Register "chardev" as class propertyEduardo Habkost1-4/+4
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <20200921221045.699690-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22cryptodev-vhost-user: Register "chardev" as class propertyEduardo Habkost1-8/+5
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <20200921221045.699690-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22smp: drop support for deprecated (invalid topologies)Igor Mammedov3-37/+21
it's was deprecated since 3.1 Support for invalid topologies is removed, the user must ensure that topologies described with -smp include all possible cpus, i.e. (sockets * cores * threads) == maxcpus or QEMU will exit with error. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20200911133202.938754-1-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22qom: simplify object_find_property / object_class_find_propertyDaniel P. Berrangé22-61/+109
When debugging QEMU it is often useful to put a breakpoint on the error_setg_internal method impl. Unfortunately the object_property_add / object_class_property_add methods call object_property_find / object_class_property_find methods to check if a property exists already before adding the new property. As a result there are a huge number of calls to error_setg_internal on startup of most QEMU commands, making it very painful to set a breakpoint on this method. Most callers of object_find_property and object_class_find_property, however, pass in a NULL for the Error parameter. This simplifies the methods to remove the Error parameter entirely, and then adds some new wrapper methods that are able to raise an Error when needed. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200914135617.1493072-1-berrange@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-22Merge remote-tracking branch ↵Peter Maydell2-9/+7
'remotes/kraxel/tags/input-20200921-pull-request' into staging input: tsc2xxx fix. # gpg: Signature made Mon 21 Sep 2020 12:09:17 BST # 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/input-20200921-pull-request: hw/input/tsc2xxx: Reduce MouseTransformInfo structure exposure Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-22Merge remote-tracking branch 'remotes/kraxel/tags/usb-20200921-pull-request' ↵Peter Maydell2-4/+28
into staging usb: fix u2f build usb: fix ohci oob access and loop issues # gpg: Signature made Mon 21 Sep 2020 09:58:06 BST # 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/usb-20200921-pull-request: hw: usb: hcd-ohci: check for processed TD before retire hw: usb: hcd-ohci: check len and frame_number variables usb: fix u2f build Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-22Merge remote-tracking branch ↵Peter Maydell69-179/+163
'remotes/vivier2/tags/trivial-branch-for-5.2-pull-request' into staging Pull request trivial patches 20200919 # gpg: Signature made Sat 19 Sep 2020 19:43:35 BST # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/trivial-branch-for-5.2-pull-request: contrib/: fix some comment spelling errors qapi/: fix some comment spelling errors disas/: fix some comment spelling errors linux-user/: fix some comment spelling errors util/: fix some comment spelling errors scripts/: fix some comment spelling errors docs/: fix some comment spelling errors migration/: fix some comment spelling errors qemu/: fix some comment spelling errors scripts/git.orderfile: Display meson files along with buildsys ones hw/timer/hpet: Fix debug format strings hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw meson: remove empty else and duplicated gio deps manual: escape backslashes in "parsed-literal" blocks ui/spice-input: Remove superfluous forward declaration hw/ppc/ppc4xx_pci: Replace magic value by the PCI_NUM_PINS definition hw/gpio/max7310: Remove impossible check Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-21qemu-img: Support bitmap --merge into backing imageEric Blake3-3/+76
If you have the chain 'base.qcow2 <- top.qcow2' and want to merge a bitmap from top into base, qemu-img was failing with: qemu-img: Could not open 'top.qcow2': Could not open backing file: Failed to get shared "write" lock Is another process using the image [base.qcow2]? The easiest fix is to not open the entire backing chain of either image (source or destination); after all, the point of 'qemu-img bitmap' is solely to manipulate bitmaps directly within a single qcow2 image, and this is made more precise if we don't pay attention to other images in the chain that may happen to have a bitmap by the same name. However, note that on a case-by-case analysis, there _are_ times where we treat it as a feature that we can access a bitmap from a backing layer in association with an overlay BDS. A demonstration of this is using NBD to expose both an overlay BDS (for constant contents) and a bitmap (for learning which blocks are interesting) during an incremental backup: Base <- Active <- Temporary \--block job ->/ where Temporary is being fed by a backup 'sync=none' job. When exposing Temporary over NBD, referring to a bitmap that lives only in Active is less effort than having to copy a bitmap into Temporary [1]. So the testsuite additions in this patch check both where bitmaps get allocated (the qemu-img info output), and that qemu-nbd is indeed able to access a bitmap inherited from the backing chain since it is a different use case than 'qemu-img bitmap'. [1] Full disclosure: prior to the recent commit 374eedd1c4 and friends, we were NOT able to see bitmaps through filters, which meant that we actually did not have nice clean semantics for uniformly being able to pick up bitmaps from anywhere in the backing chain (seen as a change in behavior between qemu 4.1 and 4.2 at commit 00e30f05de, when block-copy swapped from a one-off to a filter). Which means libvirt was already coded to copy bitmaps around for the sake of older qemu, even though modern qemu no longer needs it. Oh well. Fixes: http://bugzilla.redhat.com/1877209 Reported-by: Eyal Shenitzky <eshenitz@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20200914191009.644842-1-eblake@redhat.com> [eblake: more commit message tweaks, per Max Reitz review] Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
2020-09-21Merge remote-tracking branch ↵Peter Maydell651-2595/+2079
'remotes/ehabkost/tags/machine-next-pull-request' into staging QOM queue, 2020-09-18 Fixes: * Error value corrections (Markus Armbruster) * Correct object_class_dynamic_cast_assert() documentation (Eduardo Habkost) * Ensure objects using QEMU_ALIGNED are properly aligned (Richard Henderson) QOM cleanups (Eduardo Habkost): * Rename some constants * Simplify parameters of OBJECT_DECLARE* macros * Additional DECLARE_*CHECKER* usage * Additional OBJECT_DECLARE_TYPE usage * Additional OBJECT_DECLARE_SIMPLE_TYPE usage # gpg: Signature made Fri 18 Sep 2020 21:45:29 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: Use OBJECT_DECLARE_SIMPLE_TYPE when possible Use OBJECT_DECLARE_TYPE when possible qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros qom: Remove ParentClassType argument from OBJECT_DECLARE_SIMPLE_TYPE scripts/codeconverter: Update to latest version target/s390x: Set instance_align on S390CPU TypeInfo target/riscv: Set instance_align on RISCVCPU TypeInfo target/ppc: Set instance_align on PowerPCCPU TypeInfo target/arm: Set instance_align on CPUARM TypeInfo qom: Allow objects to be allocated with increased alignment qom: Correct error values in two contracts qom: Clean up object_property_get_enum()'s error value qom: Correct object_class_dynamic_cast_assert() documentation sifive: Use DECLARE_*CHECKER* macros sifive: Move QOM typedefs and add missing includes sifive_u: Rename memmap enum constants sifive_e: Rename memmap enum constants Signed-off-by: Peter Maydell <peter.maydell@linaro.org>