summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Acceptance tests: show test report on GitLab CICleber Rosa2020-10-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avocado will, by default, produce JUnit files. Let's ask GitLab to present those in the web UI. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20201009205513.751968-4-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | Acceptance tests: do not show canceled test logs on GitLab CICleber Rosa2020-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tests resulting in "CANCEL" in Avocado are usually canceled on purpose, and are almost identical to "SKIP". The logs for canceled tests are adding a lot of noise to the logs being shown on GitLab CI, and causing distraction from real failures. As a side note, this "after script" is scheduled for removal once the feature is implemented within Avocado itself. Reference: https://github.com/avocado-framework/avocado/issues/4266 Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20201009205513.751968-3-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | Acceptance tests: bump pycdlib version for easier installationCleber Rosa2020-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On with certain versions of "pip", package installations will attempt to create wheels. And, on environments without a "complete" Python installation (as described in the acceptance tests requirements docs), that will fail. pycdlib, starting with version 1.11.0, is now being made available as wheels, so its instalation on those constrained environments is now possible. Buglink: https://bugs.launchpad.net/qemu/+bug/1897783 Reported-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20201009205513.751968-2-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | gitlab-ci.yml: Only run one test-case per fuzzerAlexander Bulekov2020-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With 1000 runs, there is a non-negligible chance that the fuzzer can trigger a crash. With this CI job, we care about catching build/runtime issues in the core fuzzing code. Actual device fuzzing takes place on oss-fuzz. For these purposes, only running one input should be sufficient. Signed-off-by: Alexander Bulekov <alxndr@bu.edu> Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201002143524.56930-1-alxndr@bu.edu> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Darren Kenny <darren.kenny@oracle.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | tests/qtest: Replace magic value by NANOSECONDS_PER_SECOND definitionPhilippe Mathieu-Daudé2020-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use self-explicit NANOSECONDS_PER_SECOND definition instead of a magic value. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201011194918.3219195-5-f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
* | | Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into ↵Peter Maydell2020-10-1252-1497/+1471Star
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging * qtest documentation improvements (Eduardo, myself) * libqtest event buffering (Maxim) * use RCU for list of children of a bus (Maxim) * move more files to softmmu/ (myself) * meson.build cleanups, qemu-storage-daemon fix (Philippe) # gpg: Signature made Mon 12 Oct 2020 16:55:19 BST # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini-gitlab/tags/for-upstream: (38 commits) meson: identify more sections of meson.build scsi/scsi_bus: fix races in REPORT LUNS virtio-scsi: use scsi_device_get scsi/scsi_bus: Add scsi_device_get scsi/scsi-bus: scsi_device_find: don't return unrealized devices device-core: use atomic_set on .realized property scsi: switch to bus->check_address device-core: use RCU for list of children of a bus device_core: use drain_call_rcu in in qmp_device_add scsi/scsi_bus: switch search direction in scsi_device_find qdev: add "check if address free" callback for buses qemu-iotests, qtest: rewrite test 067 as a qtest qtest: check that drives are really appearing and disappearing qtest: switch users back to qtest_qmp_receive device-plug-test: use qtest_qmp to send the device_del command qtest: remove qtest_qmp_receive_success qtest: Reintroduce qtest_qmp_receive with QMP event buffering qtest: rename qtest_qmp_receive to qtest_qmp_receive_dict meson.build: Re-enable KVM support for MIPS build-sys: fix git version from -version ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | meson: identify more sections of meson.buildPaolo Bonzini2020-10-121-11/+25
| | | | | | | | | | | | | | | | | | Add more headers that clarify code organization. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi/scsi_bus: fix races in REPORT LUNSMaxim Levitsky2020-10-121-35/+33Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently scsi_target_emulate_report_luns iterates over the child device list twice, and there is no guarantee that this list is the same in both iterations. The reason for iterating twice is that the first iteration calculates how much memory to allocate. However if we use a dynamic array we can avoid iterating twice, and therefore we avoid this race. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1866707 Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200913160259.32145-10-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006123904.610658-14-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | virtio-scsi: use scsi_device_getMaxim Levitsky2020-10-121-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will help us to avoid the scsi device disappearing after we took a reference to it. It doesn't by itself forbid case when we try to access an unrealized device Suggested-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200913160259.32145-9-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006123904.610658-13-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi/scsi_bus: Add scsi_device_getMaxim Levitsky2020-10-122-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add scsi_device_get which finds the scsi device and takes a reference to it. Suggested-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20200913160259.32145-8-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006123904.610658-12-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi/scsi-bus: scsi_device_find: don't return unrealized devicesPaolo Bonzini2020-10-121-30/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device core first places a device on the bus and then realizes it. Make scsi_device_find avoid returing such devices to avoid races in drivers that use an iothread (currently virtio-scsi) Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1812399 Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200913160259.32145-7-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006123904.610658-11-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | device-core: use atomic_set on .realized propertyMaxim Levitsky2020-10-122-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some code might race with placement of new devices on a bus. We currently first place a (unrealized) device on the bus and then realize it. As a workaround, users that scan the child device list, can check the realized property to see if it is safe to access such a device. Use an atomic write here too to aid with this. A separate discussion is what to do with devices that are unrealized: It looks like for this case we only call the hotplug handler's unplug callback and its up to it to unrealize the device. An atomic operation doesn't cause harm for this code path though. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200913160259.32145-6-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006123904.610658-10-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi: switch to bus->check_addressPaolo Bonzini2020-10-121-47/+75
| | | | | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006123904.610658-6-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | device-core: use RCU for list of children of a busMaxim Levitsky2020-10-125-29/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the race between device emulation code that tries to find a child device to dispatch the request to (e.g a scsi disk), and hotplug of a new device to that bus. Note that this doesn't convert all the readers of the list but only these that might go over that list without BQL held. This is a very small first step to make this code thread safe. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200913160259.32145-5-mlevitsk@redhat.com> [Use RCU_READ_LOCK_GUARD in more places, adjust testcase now that the delay in DEVICE_DELETED due to RCU is more consistent. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006123904.610658-9-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | device_core: use drain_call_rcu in in qmp_device_addMaxim Levitsky2020-10-121-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Soon, a device removal might only happen on RCU callback execution. This is okay for device-del which provides a DEVICE_DELETED event, but not for the failure case of device-add. To avoid changing monitor semantics, just drain all pending RCU callbacks on error. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Suggested-by: Stefan Hajnoczi <stefanha@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200913160259.32145-4-mlevitsk@redhat.com> [Don't use it in qmp_device_del. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | scsi/scsi_bus: switch search direction in scsi_device_findMaxim Levitsky2020-10-121-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change will allow us to convert the bus children list to RCU, while not changing the logic of this function Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200913160259.32145-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | qdev: add "check if address free" callback for busesPaolo Bonzini2020-10-124-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check if an address is free on the bus before plugging in the device. This makes it possible to do the check without any side effects, and to detect the problem early without having to do it in the realize callback. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006123904.610658-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | qemu-iotests, qtest: rewrite test 067 as a qtestPaolo Bonzini2020-10-126-599/+191Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test 067 from qemu-iotests is executing QMP commands to hotplug and hot-unplug disks, devices and blockdevs. Because the power of the text-based test harness is limited, it is actually limiting the checks that it does, for example by skipping DEVICE_DELETED events. tests/qtest already has a similar test, drive_del-test.c. We can merge them, and even reuse some of the existing code in drive_del-test.c. This will improve the quality of the test by covering DEVICE_DELETED events and testing multiple architectures (therefore covering multiple PCI hotplug mechanisms as well as s390x virtio-ccw). The only difference is that the new test will always use null-co:// for the medium rather than qcow2 or raw, but this should be irrelevant for what the test is covering. For example there are no "qemu-img check" runs in 067 that would check that the file is properly closed. The new tests requires PCI hot-plug support, so drive_del-test is moved from qemu-system-ppc to qemu-system-ppc64. Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | qtest: check that drives are really appearing and disappearingPaolo Bonzini2020-10-121-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | Do not just trust the HMP commands to create and delete the drive, use query-block to check that this is actually the case. Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | qtest: switch users back to qtest_qmp_receiveMaxim Levitsky2020-10-125-22/+15Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let test use the new functionality for buffering events. The only remaining users of qtest_qmp_receive_dict are tests that fuzz the QMP protocol. Tested with 'make check-qtest'. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20201006123904.610658-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | device-plug-test: use qtest_qmp to send the device_del commandPaolo Bonzini2020-10-121-23/+9Star
| | | | | | | | | | | | | | | | | | | | | Simplify the code now that events are buffered. There is no need anymore to separate sending the command and retrieving the response. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | qtest: remove qtest_qmp_receive_successMaxim Levitsky2020-10-123-70/+25Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of qtest_qmp_receive_success was mostly to process events that arrived between the issueing of a command and the "return" line from QMP. This is now handled by the buffering of events that libqtest performs automatically. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
| * | qtest: Reintroduce qtest_qmp_receive with QMP event bufferingMaxim Levitsky2020-10-122-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new qtest_qmp_receive buffers all the received qmp events, allowing qtest_qmp_eventwait_ref to return them. This is intended to solve the race in regard to ordering of qmp events vs qmp responses, as soon as the callers start using the new interface. In addition to that, define qtest_qmp_event_ref a function which only scans the buffer that qtest_qmp_receive stores the events to. This is intended for callers that are only interested in events that were received during the last call to the qtest_qmp_receive. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20201006123904.610658-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | qtest: rename qtest_qmp_receive to qtest_qmp_receive_dictMaxim Levitsky2020-10-127-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the next patch a new version of qtest_qmp_receive will be reintroduced that will buffer received qmp events for later consumption in qtest_qmp_eventwait_ref No functional change intended. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | meson.build: Re-enable KVM support for MIPSHuacai Chen2020-10-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After converting from configure to meson, KVM support is lost for MIPS, so re-enable it in meson.build. Fixes: fdb75aeff7c212e1afaaa3a43 ("configure: remove target configuration") Fixes: 8a19980e3fc42239aae054bc9 ("configure: move accelerator logic to meson") Cc: aolo Bonzini <pbonzini@redhat.com> Signed-off-by: Huacai Chen <chenhc@lemote.com> Message-Id: <1602059975-10115-3-git-send-email-chenhc@lemote.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | build-sys: fix git version from -versionMarc-André Lureau2020-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Typo introduced with the script. Fixes: 2c273f32d3 ("meson: generate qemu-version.h") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reported-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200929143654.518157-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | docs/devel: update instruction on how to add new unit testsPaolo Bonzini2020-10-122-18/+31
| | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | qtest: unify extra_qtest_srcs and extra_qtest_depsPaolo Bonzini2020-10-121-29/+26Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the extra sources and extra dependencies of qtests are held in two separate dictionaries. Use the same trick as tests/meson.build to combine them into one. This will make it easier to update the documentation for unit tests and qtests. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | docs/devel/qtest: Include libqtest API referenceEduardo Habkost2020-10-122-10/+16
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-Id: <20201005205228.697463-4-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | docs/devel/qtest: Include protocol spec in documentEduardo Habkost2020-10-122-10/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Include the QTest Protocol doc string in docs/devel/qtest.rst, after converting it to use Sphinx syntax. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-Id: <20201005205228.697463-3-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | docs: Move QTest documentation to its own documentEduardo Habkost2020-10-123-45/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qtest and libqtest doc comments will be parsed to generate API documentation, so move QTest documentation to its own document where the API and format documentation and will be included. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-Id: <20201005205228.697463-2-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | qom: fix objects with improper parent typePaolo Bonzini2020-10-125-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some objects accidentally inherit ObjectClass instead of Object. They compile silently but may crash after downcasting. In this patch, we introduce a coccinelle script to find broken declarations and fix them manually with proper base type. Signed-off-by: Sergey Nizovtsev <snizovtsev@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | exec: split out non-softmmu-specific partsPaolo Bonzini2020-10-126-451/+467
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Over the years, most parts of exec.c that were not specific to softmmu have been moved to accel/tcg; what's left is mostly the low-level part of the memory API, which includes RAMBlock and AddressSpaceDispatch. However exec.c also hosts 4-500 lines of code for the target specific parts of the CPU QOM object, plus a few functions for user-mode emulation that do not have a better place (they are not TCG-specific so accel/tcg/user-exec.c is not a good place either). Move these parts to a new file, so that exec.c can be moved to softmmu/physmem.c. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | softmmu: move more files to softmmu/Paolo Bonzini2020-10-129-14/+15
| | | | | | | | | | | | | | | | | | | | | Keep most softmmu_ss files into the system-emulation-specific directory. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACEPhilippe Mathieu-Daudé2020-10-124-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the FW_CFG_DATA_GENERATOR_INTERFACE is only consumed by a device only available using system-mode (fw_cfg), it is implemented by a crypto component (tls-cipher-suites) which is always available when crypto is used. Commit 69699f3055 introduced the following error in the qemu-storage-daemon binary: $ echo -e \ '{"execute": "qmp_capabilities"}\r\n{"execute": "qom-list-types"}\r\n{"execute": "quit"}\r\n' \ | storage-daemon/qemu-storage-daemon --chardev stdio,id=qmp0 --monitor qmp0 {"QMP": {"version": {"qemu": {"micro": 50, "minor": 1, "major": 5}, "package": ""}, "capabilities": ["oob"]}} {"return": {}} missing interface 'fw_cfg-data-generator' for object 'tls-creds' Aborted (core dumped) Since QOM dependencies are resolved at runtime, this issue could not be triggered at linktime, and we don't have test running the qemu-storage-daemon binary. Fix by always registering the QOM interface. Reported-by: Kevin Wolf <kwolf@redhat.com> Fixes: 69699f3055 ("crypto/tls-cipher-suites: Produce fw_cfg consumable blob") Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006111909.2302081-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | qom: Move the creation of the library to the main meson.buildPhilippe Mathieu-Daudé2020-10-122-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201006125602.2311423-10-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | authz: Move the creation of the library to the main meson.buildPhilippe Mathieu-Daudé2020-10-122-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201006125602.2311423-9-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | crypto: Move the creation of the library to the main meson.buildPhilippe Mathieu-Daudé2020-10-122-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201006125602.2311423-8-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | io: Move the creation of the library to the main meson.buildPhilippe Mathieu-Daudé2020-10-122-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201006125602.2311423-7-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | migration: Move the creation of the library to the main meson.buildPhilippe Mathieu-Daudé2020-10-122-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201006125602.2311423-6-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | chardev: Move the creation of the library to the main meson.buildPhilippe Mathieu-Daudé2020-10-122-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201006125602.2311423-5-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | hw/core: Move the creation of the library to the main meson.buildPhilippe Mathieu-Daudé2020-10-122-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Be consistent creating all the libraries in the main meson.build file. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201006125602.2311423-4-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | meson.build: Sort sourcesets alphabeticallyPhilippe Mathieu-Daudé2020-10-121-9/+9
| | | | | | | | | | | | | | | | | | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201006125602.2311423-3-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | meson.build: Add comments to clarify code organizationPhilippe Mathieu-Daudé2020-10-121-0/+8
|/ / | | | | | | | | | | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201006125602.2311423-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | Merge remote-tracking branch ↵Peter Maydell2020-10-127-37/+57
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/dgilbert/tags/pull-migration-20201012a' into staging v3 Migration+ virtiofsd pull 2020-10-12 V3 Remove the postcopy recovery changes Migration: Dirtyrate measurement API cleanup Virtiofsd: Missing qemu_init_exec_dir call Support for setting the group on socket creation Stop a gcc warning Avoid tempdir in sandboxing # gpg: Signature made Mon 12 Oct 2020 12:43:30 BST # gpg: using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full] # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20201012a: migration/dirtyrate: present dirty rate only when querying the rate has completed migration/dirtyrate: record start_time and calc_time while at the measuring state virtiofsd: avoid /proc/self/fd tempdir virtiofsd: Call qemu_init_exec_dir tools/virtiofsd: add support for --socket-group virtiofsd: Silence gcc warning Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * migration/dirtyrate: present dirty rate only when querying the rate has ↵Chuan Zheng2020-10-122-7/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | completed Make dirty_rate field optional, present dirty rate only when querying the rate has completed. The qmp results is shown as follow: @unstarted: {"return":{"status":"unstarted","start-time":0,"calc-time":0},"id":"libvirt-12"} @measuring: {"return":{"status":"measuring","start-time":102931,"calc-time":1},"id":"libvirt-85"} @measured: {"return":{"status":"measured","dirty-rate":4,"start-time":150146,"calc-time":1},"id":"libvirt-15"} Signed-off-by: Chuan Zheng <zhengchuan@huawei.com> Reviewed-by: David Edmondson <david.edmondson@oracle.com> Message-Id: <1601350938-128320-3-git-send-email-zhengchuan@huawei.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
| * migration/dirtyrate: record start_time and calc_time while at the measuring ↵Chuan Zheng2020-10-121-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | state Querying could include both the start-time and the calc-time while at the measuring state, allowing a caller to determine when they should expect to come back looking for a result. Signed-off-by: Chuan Zheng <zhengchuan@huawei.com> Message-Id: <1601350938-128320-2-git-send-email-zhengchuan@huawei.com> Reviewed-by: David Edmondson <david.edmondson@oracle.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
| * virtiofsd: avoid /proc/self/fd tempdirStefan Hajnoczi2020-10-121-23/+11Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to prevent /proc/self/fd escapes a temporary directory is created where /proc/self/fd is bind-mounted. This doesn't work on read-only file systems. Avoid the temporary directory by bind-mounting /proc/self/fd over /proc. This does not affect other processes since we remounted / with MS_REC | MS_SLAVE. /proc must exist and virtiofsd does not use it so it's safe to do this. Path traversal can be tested with the following function: static void test_proc_fd_escape(struct lo_data *lo) { int fd; int level = 0; ino_t last_ino = 0; fd = lo->proc_self_fd; for (;;) { struct stat st; if (fstat(fd, &st) != 0) { perror("fstat"); return; } if (last_ino && st.st_ino == last_ino) { fprintf(stderr, "inode number unchanged, stopping\n"); return; } last_ino = st.st_ino; fprintf(stderr, "Level %d dev %lu ino %lu\n", level, (unsigned long)st.st_dev, (unsigned long)last_ino); fd = openat(fd, "..", O_PATH | O_DIRECTORY | O_NOFOLLOW); level++; } } Before and after this patch only Level 0 is displayed. Without /proc/self/fd bind-mount protection it is possible to traverse parent directories. Fixes: 397ae982f4df4 ("virtiofsd: jail lo->proc_self_fd") Cc: Miklos Szeredi <mszeredi@redhat.com> Cc: Jens Freimann <jfreimann@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20201006095826.59813-1-stefanha@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Tested-by: Jens Freimann <jfreimann@redhat.com> Reviewed-by: Jens Freimann <jfreimann@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
| * virtiofsd: Call qemu_init_exec_dirDr. David Alan Gilbert2020-10-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since fcb4f59c879 qemu_get_local_state_pathname relies on the init_exec_dir, and virtiofsd asserts because we never set it. Set it. Reported-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20201002124015.44820-1-dgilbert@redhat.com> Tested-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
| * tools/virtiofsd: add support for --socket-groupAlex Bennée2020-10-124-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If you like running QEMU as a normal user (very common for TCG runs) but you have to run virtiofsd as a root user you run into connection problems. Adding support for an optional --socket-group allows the users to keep using the command line. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200925125147.26943-2-alex.bennee@linaro.org> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> dgilbert: Split long line