aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-02-17parallels: Fix .bdrv_co_create(_opts) to open images with no_co_wrapperKevin Wolf1-5/+5
.bdrv_co_create implementations run in a coroutine. Therefore they are not allowed to open images directly. Fix the calls to use the corresponding no_co_wrappers instead. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230126172432.436111-5-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Hanna Czenczek <hreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-02-17luks: Fix .bdrv_co_create(_opts) to open images with no_co_wrapperKevin Wolf1-10/+9
.bdrv_co_create implementations run in a coroutine. Therefore they are not allowed to open images directly. Fix the calls to use the corresponding no_co_wrappers instead. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230126172432.436111-4-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Hanna Czenczek <hreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-02-17block: Create no_co_wrappers for open functionsKevin Wolf3-13/+44
Images can't be opened in coroutine context because opening needs to change the block graph. Add no_co_wrappers so that coroutines have a simple way of opening images in a BH instead. At the same time, mark the wrapped functions as no_coroutine_fn. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230126172432.436111-3-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Hanna Czenczek <hreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-02-17block-coroutine-wrapper: Introduce no_co_wrapperKevin Wolf2-11/+86
Some functions must not be called from coroutine context. The common pattern to use them anyway from a coroutine is running them in a BH and letting the calling coroutine yield to be woken up when the BH is completed. Instead of manually writing such wrappers, add support for generating them to block-coroutine-wrapper. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230126172432.436111-2-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Hanna Czenczek <hreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-02-17curl: Fix error path in curl_open()Hanna Czenczek1-2/+4
g_hash_table_destroy() and g_hash_table_foreach_remove() (called by curl_drop_all_sockets()) both require the table to be non-NULL, or will print assertion failures (just print, no abort). There are several paths in curl_open() that can lead to the out_noclean label without s->sockets being allocated, so clean it only if it has been allocated. Example reproducer: $ qemu-img info -f http '' qemu-img: GLib: g_hash_table_foreach_remove: assertion 'hash_table != NULL' failed qemu-img: GLib: g_hash_table_destroy: assertion 'hash_table != NULL' failed qemu-img: Could not open '': http curl driver cannot handle the URL '' (does not start with 'http://') Closes: https://gitlab.com/qemu-project/qemu/-/issues/1475 Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Hanna Czenczek <hreitz@redhat.com> Message-Id: <20230206132949.92917-1-hreitz@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-02-17configure: Enable -Wthread-safety if presentKevin Wolf1-0/+1
This enables clang's thread safety analysis (TSA), which we'll use to statically check the block graph locking. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20221207131838.239125-9-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230117135203.3049709-4-eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-02-17bsd-user/mmap: use TSA_NO_TSA to suppress clang TSA warnings in FreeBSDEmanuele Giuseppe Esposito2-4/+6
FreeBSD implements pthread headers using TSA (thread safety analysis) annotations, therefore when an application is compiled with -Wthread-safety there are some locking/annotation requirements that the user of the pthread API has to follow. This will also be the case in QEMU, since bsd-user/mmap.c uses the pthread API. Therefore when building it with -Wthread-safety the compiler will throw warnings because the functions are not properly annotated. We need TSA to be enabled because it ensures that the critical sections of an annotated variable are properly locked. In order to make the compiler happy and avoid adding all the necessary macros to all callers (lock functions should use TSA_ACQUIRE, while unlock TSA_RELEASE, and this applies to all users of pthread_mutex_lock and pthread_mutex_unlock), simply use TSA_NO_TSA to supppress such warnings. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20230117135203.3049709-3-eesposit@redhat.com> Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-02-17util/qemu-thread-posix: use TSA_NO_TSA to suppress clang TSA warnings in FreeBSDEmanuele Giuseppe Esposito2-6/+10
FreeBSD implements pthread headers using TSA (thread safety analysis) annotations, therefore when an application is compiled with -Wthread-safety there are some locking/annotation requirements that the user of the pthread API has to follow. This will also be the case in QEMU, since util/qemu-thread-posix.c uses the pthread API. Therefore when building it with -Wthread-safety, the compiler will throw warnings because the functions are not properly annotated. We need TSA to be enabled because it ensures that the critical sections of an annotated variable are properly locked. In order to make the compiler happy and avoid adding all the necessary macros to all callers (lock functions should use TSA_ACQUIRE, while unlock TSA_RELEASE, and this applies to all users of pthread_mutex_lock and pthread_mutex_unlock), simply use TSA_NO_TSA to supppress such warnings. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20230117135203.3049709-2-eesposit@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-02-16Merge tag 'migration-20230215-pull-request' of ↵Peter Maydell13-97/+99
https://gitlab.com/juan.quintela/qemu into staging Migration Pull request This pull request contains: * Add qemu_file_get_to_fd() a.k.a. make vfio happy(Avihai) * migration/block is now DPRINTF() free zone (Philippe) * remove res_compat and improve docs (me) Please apply. # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmPtOxgACgkQ9IfvGFhy # 1yM+8w/+Nrm40o8B+0M1X/2O8SPaXE0Oxll5qk5AgfC+2Ef/n5661ZzOM1xQcqzv # CN3bj3g7dKN05nGhqW5ZFrEZliJCGksx2FBKMq9H6R5YBSMo/+GHT4ugPqsujudl # RBafIHzp4h4nTh/4aJ4Kr2Vn/bVQzGVyv5c6yUdUhKhE1QfCLu9AMC5vN1hfWxBz # IQBvMkLNXXhWOTdkVAElVlFOM6GZzWb1UYDkBaQHjjw/dN0MdCFFj7tIaBIyU2Eb # KyQCoYeJjjWrljsrfzfCucrW+mbVGmCe1TiCEnaAmmgzOI0NwARmUcdYdCyZ4Nhh # flNjpqQB6H4/ekI0mus2YPMPEkHyVgBMuF8fHV3YDwxcQ25U39RLymVfAoKPNg88 # S1EcQ9h2QVqdML7bR9vTmPOZKk5vD25H7B8LQIJpT8PHVg3ZzzRaOIR8UHmmFXx/ # PSL1rGfPcCLJ3P1XlVjwBApebMHyid9c+Sohda9L9HPer0jlB+mGQUEV8J67DJiT # xlffFgJmYu3+AJu9BoqrG0AUW6zA78jSs4Tbp78qbIVA4uzGkWI9JvROMfG9Qcc7 # vruuL0sUXHVUhzW2F+0M+b1rVhaHHQYvFo3mIqdHrd5mGicdgh1HUbaJuEJxeJnh # oFt6SZbIx3N/pllcvMsxQa+rFI/po+FEkRwIF02SzTRWYHB0qos= # =KpKO # -----END PGP SIGNATURE----- # gpg: Signature made Wed 15 Feb 2023 20:05:44 GMT # gpg: using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full] # gpg: aka "Juan Quintela <quintela@trasno.org>" [full] # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * tag 'migration-20230215-pull-request' of https://gitlab.com/juan.quintela/qemu: migration: Rename res_{postcopy,precopy}_only migration: Remove unused res_compatible migration: In case of postcopy, the memory ends in res_postcopy_only migration/block: Convert remaining DPRINTF() debug macro to trace events migration/qemu-file: Add qemu_file_get_to_fd() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-02-16Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into stagingPeter Maydell15-235/+317
* block/iscsi: fix double-free on BUSY or similar statuses * catch [accel] entry without accelerator * target/i386: various fixes for BMI and ADX instructions * make the contents of meson-buildoptions.sh stable # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmPpDTcUHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroODWAgAhWi0XSBe91+34ahQqx6JoLStNX9e # xy1Cm/5LPDrDquD/4T6gnzb1Min/X2AsVu9c+VIbuHbL/rFc7aNIEL6c7KzwSFLs # vEDF7tSnlIMK0ClDsDYBz7HUIgBgqE2crAJmTJus2Cqd+Ef5bMxhQi5Imrk6qtmO # HRdVYEGasJ7CO50oUB91AMrNInWQw0qBnBOB8TnwTLTcvE1txa+xnZuZgQA2HrGX # OweLdKRcYPvRYvBB3wLMbwqEKbD1eYbdbNt7T2KkuVQpYcgfoCpayHIIMroD+hvu # BImmG9wWieDKH4Brs765gH6/3VF5UZKbgDQo9Wz+W/5QqnqRSsOYBiMkmA== # =G3PN # -----END PGP SIGNATURE----- # gpg: Signature made Sun 12 Feb 2023 16:00:55 GMT # 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 * tag 'for-upstream' of https://gitlab.com/bonzini/qemu: libqtest: ensure waitpid() is only called once libqtest: split qtest_spawn_qemu function target/i386: fix ADOX followed by ADCX target/i386: Fix C flag for BLSI, BLSMSK, BLSR target/i386: Fix BEXTR instruction tests/tcg/i386: Introduce and use reg_t consistently vl: catch [accel] entry without accelerator block/iscsi: fix double-free on BUSY or similar statuses remove unnecessary extern "C" blocks build: make meson-buildoptions.sh stable Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-02-15migration: Rename res_{postcopy,precopy}_onlyJuan Quintela9-66/+59
Once that res_compatible is removed, they don't make sense anymore. We remove the _only preffix. And to make things clearer we rename them to must_precopy and can_postcopy. Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Signed-off-by: Juan Quintela <quintela@redhat.com>
2023-02-15migration: Remove unused res_compatibleJuan Quintela11-33/+16
Nothing assigns to it after previous commit. Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Signed-off-by: Juan Quintela <quintela@redhat.com>
2023-02-15migration: In case of postcopy, the memory ends in res_postcopy_onlyJuan Quintela1-1/+1
So remove last assignation of res_compatible. Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Signed-off-by: Juan Quintela <quintela@redhat.com>
2023-02-15Merge tag 'misc-next-pull-request' of https://gitlab.com/berrange/qemu into ↵Peter Maydell8-34/+111
staging * Document 'password-secret' option for -iscsi * Deprecate iSCSI 'password' in favour of 'password-secret' * Remove deprecated 'password' option for SPICE * Fix handling of cached read buffers with TLS # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE2vOm/bJrYpEtDo4/vobrtBUQT98FAmPtGoUACgkQvobrtBUQ # T99RsA/7BQqQCyZcpTxYXYnGace4qnVx/VQLX7gESjnbsXlA0qUAtxepg2YdsU3W # GxyZHflP48TesSAsxsA9sBwoFaJZvsq+fZnq62clNNiZTIRynSi65KVUdbqQ/a3F # 3A9XZlqLzXJMPpwyowzcjMCx+/4+cIr9DA0hKUzQJtNder1I17ySXFGGsO98iM24 # KR/Pulk2NogWLez1Tr7qF01+OK8/cBPpD/QEHzKXsyVcbgnFLFnBIpbpLtlK4BEb # g6csk665kbWZXud25YXdyG9pUPOrNM4l+7fQcDhjy3IoS2P6/bCTp1jsn3txTbEj # yTKFJEEM18UWNQCvn4wyHiRCK6+KrFigocdj0jdsyG5DtNUTxqNkdscJa8V/d0hR # 4y56Z33yK5JQIPaHE28f5vy/w2014hUoqpoYHt4JOeUuUJq9tvMqY6TCThc3ZvvP # 08DF/0MwIj0NzP5hiEtNxUwFNjwmVRZCSzmNX+22SXOlICwZeQpejwtpEz8YMgDo # S4vEUjhcNYXoTkL6qZFfBuwn1Gkqqg1DRx8amh3WTB7JDiFA9YwefmBiblAqEK0D # AG1vPo53uHFytoYqMtsEI/JVE7wfZCBHGBXz2euOOKzUqWS0OGL0h71s5D0yDY+U # /8YBy86qj7Vm7QuUz+Z2OaWH+miXYy8/kMjdfEcGgqbORReZWrI= # =sAEk # -----END PGP SIGNATURE----- # gpg: Signature made Wed 15 Feb 2023 17:46:45 GMT # gpg: using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full] # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" [full] # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * tag 'misc-next-pull-request' of https://gitlab.com/berrange/qemu: ui: remove deprecated 'password' option for SPICE block: deprecate iSCSI 'password' in favour of 'password-secret' block: mention 'password-secret' option for -iscsi io/channel-tls: fix handling of bigger read buffers crypto: TLS: introduce `check_pending` Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-02-15migration/block: Convert remaining DPRINTF() debug macro to trace eventsPhilippe Mathieu-Daudé2-11/+2
Finish the conversion from commit fe80c0241d ("migration: using trace_ to replace DPRINTF"). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2023-02-15migration/qemu-file: Add qemu_file_get_to_fd()Avihai Horon2-0/+35
Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon <avihaih@nvidia.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2023-02-15ui: remove deprecated 'password' option for SPICEDaniel P. Berrangé4-31/+8
This has been replaced by the 'password-secret' option, which references a 'secret' object instance. Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-02-15block: deprecate iSCSI 'password' in favour of 'password-secret'Daniel P. Berrangé2-0/+11
Support for referencing secret objects was added in commit b189346eb1784df95ed6fed610411dbf23d19e1f Author: Daniel P. Berrangé <berrange@redhat.com> Date: Thu Jan 21 14:19:21 2016 +0000 iscsi: add support for getting CHAP password via QCryptoSecret API The existing 'password' option is overdue for deprecation and subsequent removal. Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-02-15block: mention 'password-secret' option for -iscsiDaniel P. Berrangé1-2/+2
The 'password-secret' option was added commit b189346eb1784df95ed6fed610411dbf23d19e1f Author: Daniel P. Berrangé <berrange@redhat.com> Date: Thu Jan 21 14:19:21 2016 +0000 iscsi: add support for getting CHAP password via QCryptoSecret API but was not mentioned in the command line docs Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-02-15io/channel-tls: fix handling of bigger read buffersAntoine Damhet1-1/+65
Since the TLS backend can read more data from the underlying QIOChannel we introduce a minimal child GSource to notify if we still have more data available to be read. Signed-off-by: Antoine Damhet <antoine.damhet@shadow.tech> Signed-off-by: Charles Frey <charles.frey@shadow.tech> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-02-15crypto: TLS: introduce `check_pending`Antoine Damhet2-0/+25
The new `qcrypto_tls_session_check_pending` function allows the caller to know if data have already been consumed from the backend and is already available. Signed-off-by: Antoine Damhet <antoine.damhet@shadow.tech> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-02-14Merge tag 'pull-request-2023-02-14' of https://gitlab.com/thuth/qemu into ↵Peter Maydell54-192/+312
staging * Bump minimum Clang version to 10.0 * Improve the handling of the libdw library * Deprecate --enable-gprof builds and remove them from CI * Remove the deprecated "sga" device * Some header #include clean-ups * Make qtests more flexible with regards to missing devices * Some small s390x-related fixes/improvements # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmPra8ARHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbW5zQ/+LRyPlCB9/Zz+40QUNIl9M9pcpjwCno9w # pWIeOXMftBu8vCa/+o58Y22NzmWq7cFypfsIvjrlCqCIZQx1shez5+bvE/ZSyECd # vy3I+ybKRSaXgE/ighAifwOR7eOhqLBHyXJkAN5grMx0kuu3oKqXBpyJNqTHjq6o # VgKTu8+o7Ddb+CuzwGahKzyzTqD7gY+9+Y5Gnlq0DvbNEq9k6tcjQZ8P3MqOmjWJ # WnBZH9Rrq9itnlcZXMl8xY6w572GLTq+aJbtc/iS3cvNV2WMwTFMj4lJZjuSkzX0 # af2Aw/4e23uKpjnD44cI17XkRSQbUcT756b3KtdHlKHRvKSL+zwjsraimEN6sleO # Y5ibaFamqvoR7IuOqJ7/cbpBN+P46JU1ryQ17BvAN/HnNSEmkn6FLGtDhyvabIHq # C69TBb1IX0GApo0txeg0d0nFrSvVACpX+/D1bRedmI5SD3EukTcBr6UELiBqXqLH # O75tWQydMwxuP8ay7/zU4g4PApif/RBbR41pw+oVsQNIx1p5QilNy069m/V2nT3k # gMciT2+U8bIu3GUULuW0zPuD/o88XJk+ocjFHIE8BbwCx41iL6jKhM+xHwUeIkv4 # dZT+8BlbBzNZlSAgpMu9wt0T2hyHrKYtmLxvrVi/qq6ZyO7ZUVBfOGfqAd3QtvQX # hIERpFunzFY= # =GNLD # -----END PGP SIGNATURE----- # gpg: Signature made Tue 14 Feb 2023 11:08:48 GMT # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2023-02-14' of https://gitlab.com/thuth/qemu: (22 commits) hw/s390x/event-facility: Replace DO_UPCAST(SCLPEvent) by SCLP_EVENT() tests/tcg/s390x: Use -nostdlib for softmmu tests tests/qtest: Don't build virtio-serial-test.c if device not present tests/qtest: bios-tables-test: Skip if missing configs tests/qemu-iotests: Require virtio-scsi-pci tests/qtest: Do not include hexloader-test if loader device is not present tests/qtest: Check for devices in bios-tables-test tests/qtest: drive_del-test: Skip tests that require missing devices tests/qtest: Skip unplug tests that use missing devices test/qtest: Fix coding style in device-plug-test.c tests/qtest: hd-geo-test: Check for missing devices tests/qtest: Add dependence on PCIE_PORT for virtio-net-failover.c tests/qtest: Do not run lsi53c895a test if device is not present tests/qtest: Skip PXE tests for missing devices Do not include "qemu/error-report.h" in headers that do not need it include/hw: Do not include "hw/registerfields.h" in headers that don't need it hw/misc/sga: Remove the deprecated "sga" device tests/qtest/npcm7xx_pwm-test: Be less verbose unless V=2 build: deprecate --enable-gprof builds and remove from CI meson: Disable libdw for static builds by default ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-02-14hw/s390x/event-facility: Replace DO_UPCAST(SCLPEvent) by SCLP_EVENT()Philippe Mathieu-Daudé1-2/+1
Use the SCLP_EVENT() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230212225144.58660-16-philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/tcg/s390x: Use -nostdlib for softmmu testsIlya Leoshkevich1-1/+1
The code currently uses -nostartfiles, but this does not prevent linking with libc. On Fedora there is no cross-libc, so the linking step fails. Fix by using the more comprehensive -nostdlib (that's also what probe_target_compiler() checks for as well). Fixes: 503e549e441e ("tests/tcg/s390x: Test unaligned accesses to lowcore") Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20230131182057.2261614-1-iii@linux.ibm.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest: Don't build virtio-serial-test.c if device not presentFabiano Rosas1-1/+5
The virtconsole device might not be present in the QEMU build that is being tested. Signed-off-by: Fabiano Rosas <farosas@suse.de> Message-Id: <20230213210738.9719-5-farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest: bios-tables-test: Skip if missing configsFabiano Rosas1-1/+3
If we build with --without-default-devices, CONFIG_HPET and CONFIG_PARALLEL are set to N, which makes the respective devices go missing from acpi tables. Signed-off-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230208194700.11035-13-farosas@suse.de> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qemu-iotests: Require virtio-scsi-pciFabiano Rosas1-0/+1
Check that virtio-scsi-pci is present in the QEMU build before running the tests. Signed-off-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230208194700.11035-12-farosas@suse.de> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest: Do not include hexloader-test if loader device is not presentFabiano Rosas1-2/+2
Signed-off-by: Fabiano Rosas <farosas@suse.de> Message-Id: <20230208194700.11035-11-farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest: Check for devices in bios-tables-testFabiano Rosas1-4/+71
Do not include tests that require devices that are not available in the QEMU build. Signed-off-by: Fabiano Rosas <farosas@suse.de> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20230208194700.11035-10-farosas@suse.de> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest: drive_del-test: Skip tests that require missing devicesFabiano Rosas1-0/+65
Signed-off-by: Fabiano Rosas <farosas@suse.de> Message-Id: <20230208194700.11035-9-farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest: Skip unplug tests that use missing devicesFabiano Rosas1-6/+27
Signed-off-by: Fabiano Rosas <farosas@suse.de> Message-Id: <20230208194700.11035-8-farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14test/qtest: Fix coding style in device-plug-test.cFabiano Rosas1-3/+5
We should not mix declarations and statements in QEMU code. Signed-off-by: Fabiano Rosas <farosas@suse.de> Message-Id: <20230208194700.11035-7-farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest: hd-geo-test: Check for missing devicesFabiano Rosas1-13/+25
Don't include tests that require devices not available in the QEMU binary. Signed-off-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230208194700.11035-6-farosas@suse.de> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest: Add dependence on PCIE_PORT for virtio-net-failover.cFabiano Rosas1-1/+2
This test depends on the presence of the pcie-root-port device. Add a build time dependency. Signed-off-by: Fabiano Rosas <farosas@suse.de> Message-Id: <20230208194700.11035-4-farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest: Do not run lsi53c895a test if device is not presentFabiano Rosas1-0/+4
The tests are built once for all the targets, so as long as one QEMU binary is built with CONFIG_LSI_SCSI_PCI=y, this test will run. However some binaries might not include the device. So check this again in runtime. Signed-off-by: Fabiano Rosas <farosas@suse.de> Message-Id: <20230208194700.11035-3-farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest: Skip PXE tests for missing devicesFabiano Rosas1-0/+4
Check if the devices we're trying to add are present in the QEMU binary. They could have been removed from the build via Kconfig or the --without-default-devices option. Signed-off-by: Fabiano Rosas <farosas@suse.de> Message-Id: <20230208194700.11035-2-farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14Do not include "qemu/error-report.h" in headers that do not need itThomas Huth19-3/+16
Include it in the .c files instead that use the error reporting functions. Message-Id: <20230210111931.1115489-1-thuth@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14include/hw: Do not include "hw/registerfields.h" in headers that don't need itThomas Huth5-3/+2
Include "hw/registerfields.h" in the .c files instead (if needed). Message-Id: <20230210112315.1116966-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14hw/misc/sga: Remove the deprecated "sga" deviceThomas Huth14-106/+12
It's been deprecated since QEMU v6.2, so it should be OK to finally remove this now. Message-Id: <20230209161540.1054669-1-thuth@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14tests/qtest/npcm7xx_pwm-test: Be less verbose unless V=2Peter Maydell1-6/+21
The npcm7xx_pwm-test produces a lot of output at V=1, which means that on our CI tests the log files exceed the gitlab 500KB limit. Suppress the messages about exactly what is being tested unless at V=2 and above. This follows the pattern we use with qom-test. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20230209135047.1753081-1-peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14build: deprecate --enable-gprof builds and remove from CIAlex Bennée4-17/+26
As gprof relies on instrumentation you rarely get useful data compared to a real optimised build. Lets deprecate the build option and simplify the CI configuration as a result. Buglink: https://gitlab.com/qemu-project/qemu/-/issues/1338 Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230131094224.861621-1-alex.bennee@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14meson: Disable libdw for static builds by defaultIlya Leoshkevich1-1/+2
Static QEMU build fails on Debian Bullseye: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libdw.a(debuginfod-client.o): in function `__libdwfl_debuginfod_init': (.text.startup+0x17): undefined reference to `dlopen' The reason is that pkg-config does not suggest -ldl for libdw, and adding --extra-ldflags="-ldl" resolves the issue. However, static linking with libdw is an unclear topic: * Linux perf does it. * Debian's libdw-dev description says: Only link to the static version for special cases and when you don't need anything from the ebl backends. * As the error message above indicates, -ldl is also needed for debuginfod support. The functionality provided by libdw is needed for analyzing performance of JITed code, which is mostly useful to developers and researchers. Therefore, in order to avoid unpleasant surprises for people who don't need this, simply disable libdw for static builds by default. It can still be enabled explicitly if needed. Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Message-Id: <20230210005208.438142-2-iii@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14meson: Add missing libdw knobsIlya Leoshkevich3-4/+12
Add the missing meson infrastructure bits for the new libdw dependency. Model them after the existing capstone knobs. Fixes: 7c10cb38ccb8 ("accel/tcg: Add debuginfo support") Reported-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230210005208.438142-1-iii@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-14configure: Bump minimum Clang version to 10.0Thomas Huth1-19/+6
Anthony Perard recently reported some problems with Clang v6.0 from Ubuntu Bionic (with regards to the -Wmissing-braces configure test). Since we're not officially supporting that version of Ubuntu anymore, we should better bump our minimum version check in the configure script instead of using our time to fix problems of unsupported compilers. According to repology.org, our supported distros ship these versions of Clang (looking at the highest version only): Fedora 36: 14.0.5 CentOS 8 (RHEL-8): 12.0.1 Debian 11: 13.0.1 OpenSUSE Leap 15.4: 13.0.1 Ubuntu LTS 20.04: 12.0.0 FreeBSD Ports: 15.0.7 NetBSD pkgsrc: 15.0.7 Homebrew: 15.0.7 MSYS2 mingw: 15.0.7 Haiku ports: 12.0.1 While it seems like we could update to v12.0.0 from that point of view, the default version on Ubuntu 20.04 is still v10.0, and we use that for our CI tests based via the tests/docker/dockerfiles/ubuntu2004.docker file. Thus let's make v10.0 our minimum version now (which corresponds to Apple Clang version v12.0). The -Wmissing-braces check can then be removed, too, since both our minimum GCC and our minimum Clang version now handle this correctly. Message-Id: <20230131180239.1582302-1-thuth@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-02-13Merge tag 'migration-20230213-pull-request' of ↵Peter Maydell34-1489/+1261
https://gitlab.com/juan.quintela/qemu into staging Migration Pull request (take3) Hi In this PULL request: - Added to leonardo fixes: Fixes: b5eea99ec2 ("migration: Add yank feature") Reported-by: Li Xiaohui <xiaohli@redhat.com> Please apply. [take 2] - rebase to latest upstream - fix compilation of linux-user (if have_system was missing) (me) - cleanup multifd_load_cleanup(leonardo) - Document RAM flags (me) Please apply. [take 1] This are all the reviewed patches for migration: - AVX512 support for xbzrle (Ling Xu) - /dev/userfaultd support (Peter Xu) - Improve ordering of channels (Peter Xu) - multifd cleanups (Li Zhang) - Remove spurious files from last merge (me) Rebase makes that to you - Fix mixup between state_pending_{exact,estimate} (me) - Cache RAM size during migration (me) - cleanup several functions (me) Please apply. # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmPppZYACgkQ9IfvGFhy # 1yPLvQ//f8D6txzFawaxrfzpSAHnq70Gx+B5GkIwgwB8nlPIC3QELEf5uooM/RGA # nSaUctUNOJUWqVGK3vp3jDIep02DzdIUrlOfy96h+pnTMpyMWFC2BexDfveVMUId # dw8WCWZkGCFDfIWuKF+GA8eTu6HM1ouzgCJrRmPtCqsikzAPkogPm60hQSTAQxm9 # Kzdp1SXV1HmyA440vy8rtYf71BKpvb9OJFmwgZ+ICy0rc1aUmgJbKxkwyOgiI2lq # ONekpbOg7lzlFVAQu1QHTmYN13bsn4uzwUgdifn1PixFQyRE3AVs4jdTmqeLnoPe # Ac6j8v3pDOw/Xf4kpRWUmhkqTMEJt8/lyneJzu1mQkw0wwiUtDvknFgPG8wJsa+J # ZQr1cBXQj4IjtkN6+ixF7XYvx3T6pWz0L+/w2+TbFBdLWIrPgFH0yPYjhx7FdDid # cjUHyS1a0w9ngnXOxRG8+UNHWCpPOUhXeeiyNioogYZNKu77PFxJVDMe3eB6dXAB # pDfl4P129PloKAPafcz9E6Sxr+lIgrETZmsRJlRz4czg18TxlIukMlDtyrepNWti # GtIf9xTpP3JKjpHnKbWLaxP5VeFC7kQd0qas4VxD+tDjbJdUZdZMfHcOSS0SMRGe # q5LVEzMMIPCQJQIqiLEJ0HTUUOtB8i+bGoirNEbDqhLa/oZwPP8= # =TDnO # -----END PGP SIGNATURE----- # gpg: Signature made Mon 13 Feb 2023 02:51:02 GMT # gpg: using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full] # gpg: aka "Juan Quintela <quintela@trasno.org>" [full] # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * tag 'migration-20230213-pull-request' of https://gitlab.com/juan.quintela/qemu: (22 commits) ram: Document migration ram flags migration/multifd: Move load_cleanup inside incoming_state_destroy migration/multifd: Join all multifd threads in order to avoid leaks migration/multifd: Remove unnecessary assignment on multifd_load_cleanup() migration/multifd: Change multifd_load_cleanup() signature and usage migration: Postpone postcopy preempt channel to be after main migration: Add a semaphore to count PONGs migration: Cleanup postcopy_preempt_setup() migration: Rework multi-channel checks on URI Update bench-code for addressing CI problem AVX512 support for xbzrle_encode_buffer migration: I messed state_pending_exact/estimate migration: Make ram_save_target_page() a pointer migration: Calculate ram size once migration: Split ram_bytes_total_common() in two functions migration: Make find_dirty_block() return a single parameter migration: Simplify ram_find_and_save_block() util/userfaultfd: Support /dev/userfaultfd linux-headers: Update to v6.1 multifd: Remove some redundant code ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-02-13ram: Document migration ram flagsJuan Quintela1-6/+10
0x80 is RAM_SAVE_FLAG_HOOK, it is in qemu-file now. Bigger usable flag is 0x200, noticing that. We can reuse RAM_SAVe_FLAG_FULL. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2023-02-13migration/multifd: Move load_cleanup inside incoming_state_destroyLeonardo Bras3-1/+11
Currently running migration_incoming_state_destroy() without first running multifd_load_cleanup() will cause a yank error: qemu-system-x86_64: ../util/yank.c:107: yank_unregister_instance: Assertion `QLIST_EMPTY(&entry->yankfns)' failed. (core dumped) The above error happens in the target host, when multifd is being used for precopy, and then postcopy is triggered and the migration finishes. This will crash the VM in the target host. To avoid that, move multifd_load_cleanup() inside migration_incoming_state_destroy(), so that the load cleanup becomes part of the incoming state destroying process. Running multifd_load_cleanup() twice can become an issue, though, but the only scenario it could be ran twice is on process_incoming_migration_bh(). So removing this extra call is necessary. On the other hand, this multifd_load_cleanup() call happens way before the migration_incoming_state_destroy() and having this happening before dirty_bitmap_mig_before_vm_start() and vm_start() may be a need. So introduce a new function multifd_load_shutdown() that will mainly stop all multifd threads and close their QIOChannels. Then use this function instead of multifd_load_cleanup() to make sure nothing else is received before dirty_bitmap_mig_before_vm_start(). Fixes: b5eea99ec2 ("migration: Add yank feature") Reported-by: Li Xiaohui <xiaohli@redhat.com> Signed-off-by: Leonardo Bras <leobras@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2023-02-13migration/multifd: Join all multifd threads in order to avoid leaksLeonardo Bras1-1/+2
Current approach will only join threads that are still running. For the threads not joined, resources or private memory are always kept in the process space and never reclaimed before process end, and this risks serious memory leaks. This should usually not represent a big problem, since multifd migration is usually just ran at most a few times, and after it succeeds there is not much to be done before exiting the process. Yet still, it should not hurt performance to join all of them. Fixes: b5eea99ec2 ("migration: Add yank feature") Reported-by: Li Xiaohui <xiaohli@redhat.com> Signed-off-by: Leonardo Bras <leobras@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2023-02-13migration/multifd: Remove unnecessary assignment on multifd_load_cleanup()Leonardo Bras1-1/+0
Before assigning "p->quit = true" for every multifd channel, multifd_load_cleanup() will call multifd_recv_terminate_threads() which already does the same assignment, while protected by a mutex. So there is no point doing the same assignment again. Fixes: b5eea99ec2 ("migration: Add yank feature") Reported-by: Li Xiaohui <xiaohli@redhat.com> Signed-off-by: Leonardo Bras <leobras@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2023-02-13migration/multifd: Change multifd_load_cleanup() signature and usageLeonardo Bras3-15/+7
Since it's introduction in commit f986c3d256 ("migration: Create multifd migration threads"), multifd_load_cleanup() never returned any value different than 0, neither set up any error on errp. Even though, on process_incoming_migration_bh() an if clause uses it's return value to decide on setting autostart = false, which will never happen. In order to simplify the codebase, change multifd_load_cleanup() signature to 'void multifd_load_cleanup(void)', and for every usage remove error handling or decision made based on return value != 0. Fixes: b5eea99ec2 ("migration: Add yank feature") Reported-by: Li Xiaohui <xiaohli@redhat.com> Signed-off-by: Leonardo Bras <leobras@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>