Skip to content
Snippets Groups Projects
  1. Oct 03, 2022
    • Markus Armbruster's avatar
      Use g_new() & friends where that makes obvious sense · c5e8d518
      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: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Message-Id: <20220923084254.4173111-1-armbru@redhat.com>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      c5e8d518
    • Markus Armbruster's avatar
      Drop superfluous conditionals around g_free() · 76eb88b1
      Markus Armbruster authored
      
      There is no need to guard g_free(P) with if (P): g_free(NULL) is safe.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20220923090428.93529-1-armbru@redhat.com>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      76eb88b1
    • Philippe Mathieu-Daudé's avatar
      block/qcow2-bitmap: Add missing cast to silent GCC error · 90dc46d3
      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: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
      Message-Id: <20220919182755.51967-1-f4bug@amsat.org>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      90dc46d3
  2. Sep 29, 2022
  3. Sep 28, 2022
    • Stefan Hajnoczi's avatar
      Merge tag 'pull-request-2022-09-28' of https://gitlab.com/thuth/qemu into staging · c8de6ec6
      Stefan 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: default avatarStefan Hajnoczi <stefanha@redhat.com>
      c8de6ec6
    • Stefan Hajnoczi's avatar
      Merge tag 'linux-user-for-7.2-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging · 36cd0aea
      Stefan 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: default avatarStefan Hajnoczi <stefanha@redhat.com>
      36cd0aea
    • Stefan Hajnoczi's avatar
      Merge tag 'vfio-updates-20220927.1' of https://gitlab.com/alex.williamson/qemu into staging · dc6c2342
      Stefan 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: default avatarStefan Hajnoczi <stefanha@redhat.com>
      dc6c2342
    • Stefan Hajnoczi's avatar
      Merge tag 'pull-xen-20220927' of... · 1acf19fa
      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: default avatarStefan Hajnoczi <stefanha@redhat.com>
      1acf19fa
    • Helge Deller's avatar
      linux-user: Add parameters of getrandom() syscall for strace · 4a877b82
      Helge Deller authored
      
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Message-Id: <20220927093538.8954-2-deller@gmx.de>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      4a877b82
  4. Sep 27, 2022
Loading