- Oct 03, 2022
-
-
Markus Armbruster authored
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This commit only touches allocations with size arguments of the form sizeof(T). Patch created mechanically with: $ spatch --in-place --sp-file scripts/coccinelle/use-g_new-etc.cocci \ --macro-file scripts/cocci-macro-file.h FILES... The previous iteration was commit a95942b50c. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Message-Id: <20220923084254.4173111-1-armbru@redhat.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Markus Armbruster authored
There is no need to guard g_free(P) with if (P): g_free(NULL) is safe. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220923090428.93529-1-armbru@redhat.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Philippe Mathieu-Daudé authored
Commit d1258dd0 ("qcow2: autoloading dirty bitmaps") added the set_readonly_helper() GFunc handler, correctly casting the gpointer user_data in both the g_slist_foreach() caller and the handler. Few commits later (commit 1b6b0562), the handler is reused in qcow2_reopen_bitmaps_rw() but missing the gpointer cast, resulting in the following error when using Homebrew GCC 12.2.0: [2/658] Compiling C object libblock.fa.p/block_qcow2-bitmap.c.o ../../block/qcow2-bitmap.c: In function 'qcow2_reopen_bitmaps_rw': ../../block/qcow2-bitmap.c:1211:60: error: incompatible type for argument 3 of 'g_slist_foreach' 1211 | g_slist_foreach(ro_dirty_bitmaps, set_readonly_helper, false); | ^~~~~ | | | _Bool In file included from /opt/homebrew/Cellar/glib/2.72.3_1/include/glib-2.0/glib/gmain.h:26, from /opt/homebrew/Cellar/glib/2.72.3_1/include/glib-2.0/glib/giochannel.h:33, from /opt/homebrew/Cellar/glib/2.72.3_1/include/glib-2.0/glib.h:54, from /Users/philmd/source/qemu/include/glib-compat.h:32, from /Users/philmd/source/qemu/include/qemu/osdep.h:144, from ../../block/qcow2-bitmap.c:28: /opt/homebrew/Cellar/glib/2.72.3_1/include/glib-2.0/glib/gslist.h:127:61: note: expected 'gpointer' {aka 'void *'} but argument is of type '_Bool' 127 | gpointer user_data); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~ At top level: FAILED: libblock.fa.p/block_qcow2-bitmap.c.o Fix by adding the missing gpointer cast. Fixes: 1b6b0562 ("qcow2: support .bdrv_reopen_bitmaps_rw") Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Message-Id: <20220919182755.51967-1-f4bug@amsat.org> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Sep 29, 2022
-
-
Matheus Tavares Bernardino authored
These files come from an external project (the hexagon archlib), so they deliberately do not follow QEMU's coding style. To avoid false positives from checkpatch.pl, let's disable the checking for those. Signed-off-by:
Matheus Tavares Bernardino <quic_mathbern@quicinc.com> Message-Id: <e3b6a345a88807a1c4daa45f638b2a90af538fd5.1663681339.git.quic_mathbern@quicinc.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Tong Zhang authored
The structure is for device dvsec not port dvsec. Change type to fix this issue. Signed-off-by:
Tong Zhang <t.zhang2@samsung.com> Acked-by:
Jonathan Cameron <Jonathan.Cameron@huawei.com> Message-Id: <20220915175853.2902-1-t.zhang2@samsung.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Wang, Lei authored
$PROJECT/.cache/clangd/index is the intended location for project index data when using clangd as the language server. Ignore this directory to keep the git status clean. Signed-off-by:
Wang, Lei <lei4.wang@intel.com> Message-Id: <20220907150010.2047037-1-lei4.wang@intel.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
Bernhard Beschow authored
GCC issues a false positive warning, resulting in build failure with -Werror: In file included from /usr/include/glib-2.0/glib.h:114, from src/include/glib-compat.h:32, from src/include/qemu/osdep.h:144, from ../src/hw/virtio/vhost-shadow-virtqueue.c:10: In function ‘g_autoptr_cleanup_generic_gfree’, inlined from ‘vhost_handle_guest_kick’ at ../src/hw/virtio/vhost-shadow-virtqueue.c:292:42: /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘elem’ may be used uninitialized [-Werror=maybe-uninitialized] 28 | g_free (*pp); | ^~~~~~~~~~~~ ../src/hw/virtio/vhost-shadow-virtqueue.c: In function ‘vhost_handle_guest_kick’: ../src/hw/virtio/vhost-shadow-virtqueue.c:292:42: note: ‘elem’ was declared here 292 | g_autofree VirtQueueElement *elem; | ^~~~ cc1: all warnings being treated as errors There is actually no problem since "elem" is initialized in both branches. Silence the warning by initializig it with "NULL". $ gcc --version gcc (GCC) 12.2.0 Fixes: 9c2ab2f1 ("vhost: stop transfer elem ownership in vhost_handle_guest_kick") Signed-off-by:
Bernhard Beschow <shentey@gmail.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220910151117.6665-1-shentey@gmail.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Sep 28, 2022
-
-
https://gitlab.com/thuth/qemuStefan Hajnoczi authored
* Fixes for qtests and unit tests to be more portable to non-POSIX platforms # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmMz9MQRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbVUKRAAnubo/wtHqjxg/yVO68odX2LFI2koligA # LcEAnhGkVJ/Pe/+Qo9yVbcOY6k6xfGQU3VIipqvLEwPAdSF0E43EJxlImBNm8/Zq # MggjNoepXRhdFGULONSmSNm7HJykLH/CHdmBjPLrbpkTCwWG1gg64xP9fI+b8mGf # vST0ADuYloLDA9J45UbC33AD+9dQsy2GeOs8X99O6ysKF3htEqMD3vBdqKiJSwgT # 2c7UqySGECn6kMHl7iAdipRNUghSgzpUe8LcH4jP7Y1XnoB3zwC/+VrOVwFESI6y # LVFsC8u7cEKKSYunoowfQTgHvYbCuSdrDqljy17NE5qRMziKMTnhXaQNR5wtBKNt # HZxvc082P/QDFdBYYY3MIjB27r/I6x0t6Xl4IVwLz7bK0xfHFF8Ba2Lr57/2RTc/ # SMPDxGrMicTPnPDU/Cw5VROMmw0OC/tVpJMGo1VjVnNESo581RAMApyzkWiUyfZj # ktKd+4ihmqrBXcZHVjKbIufa6eKNuktlkfv72dnJY4XoUlDHlbDYaVuknybZmxWK # 9/CDVDG72s5Cqm+M47Q56IagVVZwIGrUP0u3j3h/v0rnHZehY8Qzr3SLEfeqmUb6 # nP7MP+ItZFZtMITdvXb3OtyeVuM0ZSw8kt+/evpvC9zB6FjgYl/e5FppsO0HxB/O # PeeV43Bk270= # =n+FM # -----END PGP SIGNATURE----- # gpg: Signature made Wed 28 Sep 2022 03:16:20 EDT # 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-2022-09-28' of https://gitlab.com/thuth/qemu : (37 commits) docs/devel: testing: Document writing portable test cases tests/qtest: boot-serial-test: Close the serial file before starting QEMU tests/qtest: vhost-user-test: Avoid using hardcoded /tmp tests/qtest: qmp-test: Avoid using hardcoded /tmp tests/qtest: pflash-cfi02-test: Avoid using hardcoded /tmp tests/qtest: hd-geo-test: Avoid using hardcoded /tmp tests/x86: Move common code to function in device-plug-test .gitlab-ci.d/windows.yml: Display meson test logs tests/qtest: migration-test: Skip running some TLS cases for win32 tests/qtest: libqtest: Replace the call to close a socket with closesocket() tests/qtest: microbit-test: Fix socket access for win32 tests/qtest: virtio-net-failover: Disable migration tests for win32 tests/qtest: ide-test: Open file in binary mode tests/qtest: migration-test: Disable IO redirection for win32 tests/qtest: bios-tables-test: Adapt the case for win32 tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32 tests/qtest: libqtest: Exclude the *_fds APIs for win32 tests/qtest: libqtest: Adapt global_qtest declaration for win32 tests/qtest: qmp-test: Skip running test_qmp_oob for win32 tests/qtest: Build test-filter-{mirror, redirector} cases for posix only ... Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
https://gitlab.com/laurent_vivier/qemuStefan Hajnoczi authored
linux-user pull request 20220928-v2 use 'max' instead of 'qemu32' / 'qemu64' add pidfd_open(), pidfd_send_signal() and pidfd_getfd() Improve madvise(MADV_DONTNEED) futex syscal rework strace improvement HP/PA fixes and improvement Misc fixes # -----BEGIN PGP SIGNATURE----- # # iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmM0riISHGxhdXJlbnRA # dml2aWVyLmV1AAoJEPMMOL0/L748gH4P/2wesXJKPMY2zQzP3Rld4iyefoPGG/Yp # mdq59BbjO2jQMR8GBss/nl9l84cIzzkYRQIogaKsjljtZYm/OO5xRefqrzJY6apD # eidxv20dAVjuaXHAIdGhbFlxot1ctExbZs9atB4uj5DWxfYGD6e/stoBy5/pSmr4 # M5EbGHhyrRI7tRbHGtVQVvG6AT6XGE0pT9tzT5JLaApF8UPMkgJwmez16PNWvcMm # v8GEvKm/vEVS8CCpzLV4kfwVeo3f54VAOrEBDi29ph2Yo50IA21k8BvoRZaSp+Kn # G6TMnnly/DkMspAs5EOVfat+kv3TziNNdDH7EnVU1vV1yTDdZgW/1204Uy/JY0Pw # WotwAFuO9FYeHKmjY0CfnIIZZHYZpDYUOZ8M6dESD/O0EjoB8LMf5p9cbYlze4DE # csJZCsVcz19HDv6QZXi5mvvDcJ83B2IDb8/PUAzSc0n62lXL9qjYD0wdb0QsLdAT # I25qLDge1HCmQfCIKcaoHYvE0pDmvkF6ftuQUXLtIwtaV0Z/N5wDf2PEHikjOYHM # gD2izz23/2wQx6KP/9ZNnCJ5QEBkEgm5wpHncsvjzSzi1uIdNlHyzJJwGTAcc5qZ # hOeoJ7dT0D6g0BGnvOdg2W/bDx18KW65mNDxE4d+W0uzn0YmQtArk2YsnhKQNO46 # 12/0ltPFnSV/ # =DIzQ # -----END PGP SIGNATURE----- # gpg: Signature made Wed 28 Sep 2022 16:27:14 EDT # 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 * tag 'linux-user-for-7.2-pull-request' of https://gitlab.com/laurent_vivier/qemu : (37 commits) linux-user: Add parameters of getrandom() syscall for strace linux-user: Lock log around strace linux-user: Update print_futex_op linux-user: Implement PI futexes linux-user: Convert signal number for FUTEX_FD linux-user: Implement FUTEX_WAKE_BITSET linux-user: Sink call to do_safe_futex linux-user: Combine do_futex and do_futex_time64 linux-user: Set ELF_BASE_PLATFORM for MIPS linux-user: Introduce stubs for ELF AT_BASE_PLATFORM linux-user/s390x: Save/restore fpc when handling a signal linux-user: Don't assume 0 is not a valid host timer_t value linux-user: fix bug about missing signum convert of sigqueue linux-user/hppa: Fix setup_sigcontext() linux-user/hppa: Allow PROT_GROWSUP and PROT_GROWSDOWN in mprotect() linux-user/hppa: Increase guest stack size to 80MB for hppa target linux-user/hppa: Drop stack guard page on hppa target linux-user/hppa: Add signal trampoline for hppa target linux-user: Add proper strace format strings for getdents()/getdents64() linux-user: Fix TARGET_PROT_SEM for XTENSA ... Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
https://gitlab.com/alex.williamson/qemuStefan Hajnoczi authored
VFIO updates 2022-09-27 * Fix initial values for migration state (Kunkun Jiang) * Fix a use-after-free error path (Alex Williamson) # -----BEGIN PGP SIGNATURE----- # # iQJPBAABCAA5FiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmMzXKwbHGFsZXgud2ls # bGlhbXNvbkByZWRoYXQuY29tAAoJECObm247sIsiOv8QAKJstXXq92FxT+wBXt0Q # wnMJjE1hvCHXki7FfPSRPmVgoMppWD1vhr7TajeOkidtqnX48V863/RGZfxX+oQU # bEPPT6QaWnYhagslrRjIj4R+5O5N6rY9A2zzpG2vv1x9qv8r9WLicKvwjzinTgAp # PyU9Ajgu2OUpD6O64iXIeD2MnfblSN3N+bBvZ7alDifFC1D8CfX9D3X76bdERC6X # LFEenZ/3ZwZh46z1xv4v3opI2aBp9oh1gca9NKc/jUKg11AuswhmmUSmb+lVDDnt # UBNTqgHtnGBfAMcxQ1cA6AtRvtwwneJkQC4nkUmOEWuMImUEhTQw7vcTpDFFyHzz # dcYRjioHu15EmuHeP/W+139fnGeCDpr1/XJcJ2avUp/9oNeRDsAi4w/lEHXHv5Rm # KHuXSIswC/6+dgvdOwRw2OlbzX5KjSVlqXJia+QexEliCxpcs8OYEJ7ZgRdFCO8t # unWssLs7x1O40J7cngnyT8addLGwbwExrJggpG70suSQB5mMIJzNIVanUpUkzy2g # 9kAwW3fTUXqW7O+2RYbjFUoY0yR1eHO8EExiPHyO3hxCDNjglwpM20C4M7fs3Eo6 # /1zwagtjxblsWTPK9dOsq3y4yoXlhX+0EpM9PYPV8OleayTRyhS7O/FzHmqpJNlt # G524RusuIU+xNwUTEKgFFHgm # =5YPM # -----END PGP SIGNATURE----- # gpg: Signature made Tue 27 Sep 2022 16:27:24 EDT # gpg: using RSA key 42F6C04E540BD1A99E7B8A90239B9B6E3BB08B22 # gpg: issuer "alex.williamson@redhat.com" # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" [full] # gpg: aka "Alex Williamson <alex@shazbot.org>" [full] # gpg: aka "Alex Williamson <alwillia@redhat.com>" [full] # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>" [full] # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B 8A90 239B 9B6E 3BB0 8B22 * tag 'vfio-updates-20220927.1' of https://gitlab.com/alex.williamson/qemu : vfio/common: Fix vfio_iommu_type1_info use after free vfio/migration: Fix incorrect initialization value for parameters in VFIOMigration Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Stefan Hajnoczi authored
Merge tag 'pull-xen-20220927' of https://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging Xen patch - Xen PCI passthrough fix for Atomic Ops requests # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCgAdFiEE+AwAYwjiLP2KkueYDPVXL9f7Va8FAmMy/BUACgkQDPVXL9f7 # Va/EWwf+OYEesPbMD9IWvMAgtbuqK8Q/u+YwX8bviiWsBHdGT/Egut/AKBcdmVo0 # 68erlvsXBlffhT5kw6FtWHPrIMsDA+tos/q4pM7w4IJUsz+RKV/1IYT1pQ92XPP1 # RgxJyMCmVrKadqnDvVE9wAn8NeK3t75Lq5QWhN4cpWDWSSUXta90dlu8QefnrguA # tTmdgneoDUjBhimpy4LgoWBeBqnAMdN05A0dcGcsTSjptj/GsylwSbbbkGivsaDl # OH23Lk4I6dBhqGo0bEi/LpuPZ44BsuY6NHUlZixbWZl+PxneePdiEd+6YjEWNAZU # kx2XEm0hQXYxUZDk+fvHCVZP3Y/b1g== # =cDzP # -----END PGP SIGNATURE----- # gpg: Signature made Tue 27 Sep 2022 09:35:17 EDT # gpg: using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF # gpg: Can't check signature: No public key * tag 'pull-xen-20220927' of https://xenbits.xen.org/git-http/people/aperard/qemu-dm : hw/xen: set pci Atomic Ops requests for passthrough device Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Helge Deller authored
Signed-off-by:
Helge Deller <deller@gmx.de> Reviewed-by:
Laurent Vivier <laurent@vivier.eu> Message-Id: <20220927093538.8954-2-deller@gmx.de> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Sep 27, 2022
-
-
Alex Williamson authored
On error, vfio_get_iommu_info() frees and clears *info, but vfio_connect_container() continues to use the pointer regardless of the return value. Restructure the code such that a failure of this function triggers an error and clean up the remainder of the function, including updating an outdated comment that had drifted from its relevant line of code and using host page size for a default for better compatibility on non-4KB systems. Reported-by:
Nicolin Chen <nicolinc@nvidia.com> Link: https://lore.kernel.org/all/20220910004245.2878-1-nicolinc@nvidia.com/ Signed-off-by:
Alex Williamson <alex.williamson@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Nicolin Chen <nicolinc@nvidia.com> Tested-by:
Nicolin Chen <nicolinc@nvidia.com> Link: https://lore.kernel.org/r/166326219630.3388898.12882473157184946072.stgit@omen Signed-off-by:
Alex Williamson <alex.williamson@redhat.com>
-
Kunkun Jiang authored
The structure VFIOMigration of a VFIODevice is allocated and initialized in vfio_migration_init(). "device_state" and "vm_running" are initialized to 0, indicating that VFIO device is_STOP and VM is not-running. The initialization value is incorrect. According to the agreement, default state of VFIO device is _RUNNING. And if a VFIO device is hot-plugged while the VM is running, "vm_running" should be 1. This patch fixes it. Fixes: 02a7e71b ("vfio: Add VM state change handler to know state of VM") Signed-off-by:
Kunkun Jiang <jiangkunkun@huawei.com> Link: https://lore.kernel.org/r/20220711014651.1327-1-jiangkunkun@huawei.com Signed-off-by:
Alex Williamson <alex.williamson@redhat.com>
-
Bin Meng authored
Update the best practices of how to write portable test cases that can be built and run successfully on both Linux and Windows hosts. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220927110632.1973965-55-bmeng.cn@gmail.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
This qtest executable created a serial chardev file to be passed to the QEMU executable. The serial file was created by g_file_open_tmp(), which internally opens the file with FILE_SHARE_WRITE security attribute on Windows. Based on [1], there is only one case that allows the first call to CreateFile() with GENERIC_READ & FILE_SHARE_WRITE, and second call to CreateFile() with GENERIC_WRITE & FILE_SHARE_READ. All other combinations require FILE_SHARE_WRITE in the second call. But there is no way for the second call (in this case the QEMU executable) to know what combination was passed to the first call, unless FILE_SHARE_WRITE is passed to the second call. Two processes shouldn't share the same file for writing with a chardev. Let's close the serial file before starting QEMU. [1] https://docs.microsoft.com/en-us/windows/win32/fileio/creating-and-opening-files Signed-off-by:
Bin Meng <bin.meng@windriver.com> Message-Id: <20220927110632.1973965-40-bmeng.cn@gmail.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Message-Id: <20220927110632.1973965-19-bmeng.cn@gmail.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Message-Id: <20220927110632.1973965-17-bmeng.cn@gmail.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Message-Id: <20220927110632.1973965-16-bmeng.cn@gmail.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Message-Id: <20220927110632.1973965-13-bmeng.cn@gmail.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Michael Labiuk authored
Move common code for device removing to function. Signed-off-by:
Michael Labiuk <michael.labiuk@virtuozzo.com> Message-Id: <20220920104842.605530-2-michael.labiuk@virtuozzo.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
When CI fails we don't know what causes the failure. Displaying the meson test logs can be helpful. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20220925113032.1949844-53-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
Some migration test cases use TLS to communicate, but they fail on Windows with the following error messages: qemu-system-x86_64: TLS handshake failed: Insufficient credentials for that request. qemu-system-x86_64: TLS handshake failed: Error in the pull function. query-migrate shows failed migration: TLS handshake failed: Error in the pull function. Disable them temporarily. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Message-Id: <20220925113032.1949844-51-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
close() is a *nix function. It works on any file descriptor, and sockets in *nix are an example of a file descriptor. closesocket() is a Windows-specific function, which works only specifically with sockets. Sockets on Windows do not use *nix-style file descriptors, and socket() returns a handle to a kernel object instead, so it must be closed with closesocket(). In QEMU there is already a logic to handle such platform difference in os-posix.h and os-win32.h, that: * closesocket maps to close on POSIX * closesocket maps to a wrapper that calls the real closesocket() on Windows Replace the call to close a socket with closesocket() instead. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-46-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
Sockets on Windows do not use *nix-style file descriptors, so write()/read()/close() do not work on Windows. Switch over to use send()/recv()/closesocket() which work with sockets on all platforms. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-45-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Xuzhou Cheng authored
These tests use the exec migration protocol, which is unsupported on Windows as of today. Disable these tests for now. Signed-off-by:
Xuzhou Cheng <xuzhou.cheng@windriver.com> Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-42-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Xuzhou Cheng authored
By default Windows opens file in text mode, while a POSIX compliant implementation treats text files and binary files the same. The fopen() 'mode' string can include the letter 'b' to indicate binary mode shall be used. POSIX spec says the character 'b' shall have no effect, but is allowed for ISO C standard conformance. Let's add the letter 'b' which works on both POSIX and Windows. Signed-off-by:
Xuzhou Cheng <xuzhou.cheng@windriver.com> Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-41-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
On Windows the QEMU executable is created via CreateProcess() and IO redirection does not work, so don't bother adding IO redirection to the command line. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-40-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
Single quotes in the arguments (oem_id='CRASH ') are not removed in the Windows environment before it is passed to the QEMU executable. The space in the argument causes the "-acpitable" option parser to think that all of its parameters are done, hence it complains: '-acpitable' requires one of 'data' or 'file' Change to use double quotes which works fine on all platforms. Also /dev/null does not work on win32, and nul should be used. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Message-Id: <20220925113032.1949844-39-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
These test cases uses "blkdebug:path/to/config:path/to/image" for testing. On Windows, absolute file paths contain the delimiter ':' which causes the blkdebug filename parser fail to parse filenames. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20220925113032.1949844-38-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
libqmp.c::qmp_fd_vsend_fds() is not available on Windows, hence any APIs in libqtest that call libqmp.c::qmp_fd_vsend_fds() should be excluded for win32 too. This includes the following: * qtest_qmp_vsend_fds() * qtest_vqmp_fds() * qtest_qmp_fds() * qtest_qmp_add_client() Note qtest_qmp_vsend() was wrongly written to call qmp_fd_vsend_fds() previously, but it should call the non fds version API qmp_fd_vsend(). Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-35-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Xuzhou Cheng authored
Commit dd210749 ("tests/libqtest: Use libqtest-single.h in tests that require global_qtest") moved global_qtest to libqtest-single.h, by declaring global_qtest attribute to be common and weak. This trick unfortunately does not work on Windows, and building qtest test cases results in multiple definition errors of the weak symbol global_qtest, as Windows PE does not have the concept of the so-called weak symbol like ELF in the *nix world. However Windows does provide a trick to declare a variable to be a common symbol, via __declspec(selectany) [1]. It does not provide the "strong override weak" effect but we don't need it in our use case anyway. So let's use it for win32. [1] https://docs.microsoft.com/en-us/cpp/cpp/selectany Signed-off-by:
Xuzhou Cheng <xuzhou.cheng@windriver.com> Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20220925113032.1949844-33-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
The test_qmp_oob test case calls mkfifo() which does not exist on win32. Exclude it. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20220925113032.1949844-31-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
The test-filter-{mirror,redirector} cases use socketpair() API that is only available on POSIX and should only be built for POSIX. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-30-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
Some of the virtio-net-test test cases require socketpair() to do the test setup. Skip them for win32. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-29-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-25-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-24-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-23-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
The qtest library was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() and g_dir_make_tmp() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-22-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-21-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-