Ver código fonte

Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging

trivial patches for 2025-01-30

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEZKoqtTHVaQM2a/75gqpKJDselHgFAmebf70ACgkQgqpKJDse
# lHgmWw/8DZXr5+Aar9FJZIUZWqxBxRzNjnvKEGQPCKI+Iqi3qkwOHij3Tr06vERM
# upWZ/6Gx6v8SFjlfCv4VvtAHwflLOFqBzDxrCRDiZqNuLDaXuLnTMF1H8teg4ciM
# 7uPjvI17LDgoBEDR27divxcLcP4dDI5RMkAndzyL1U9OGugO4vgmDUAuXkNzqBFS
# tnWQmay3VTDVNtd4YJvhqJM5UR/4mSHlISlZpbzpF2Pxd2Job6IHYEzmre+0iteQ
# TukjKkSQ7os7jEV984zVmwZnqCZrq6iIjX0nY6d1wWeDLjRMzLNqHuZ7jYVYDMWr
# G/HdXp7BfGW1kG67W86MWWVW6O96DsyN5e76pMdlu8DjDs1/hiTA02cUEa2x2Alw
# 3ngblJMC2JhvmuMLZStJf3zTb1GABijQJdfEYjUJ1FEY0dhVuK5teeTRjql7xjnw
# tHtaxn11ahifZ++kRAeZyinkkUlKLOcV8xoGqmv8uRjy6XepFASFkSj/jEbyohKF
# BGGvUVT1cp0Krr9TOAEnrhYEpXgHjxsR0PqTphH1wQojr/AyYTBwSy/wGWPbMvQQ
# u/hHoJ/RgiiSf5HW/PRUbWrTdgYPg8Ej/9n7geAZSk2e9hfGI6Ii88XOmrZefQ+4
# 2GQ+a3I2n4LQ1cyzrGZgUncwLClIpqN/WtRsUNEFQs6zrcvG52U=
# =2d/y
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 30 Jan 2025 08:33:49 EST
# gpg:                using RSA key 64AA2AB531D56903366BFEF982AA4A243B1E9478
# gpg: Good signature from "Michael Tokarev <mjt@debian.org>" [unknown]
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>" [unknown]
# gpg:                 aka "Michael Tokarev <mjt@tls.msk.ru>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 9D8B E14E 3F2A 9DD7 9199  28F1 61AD 3D98 ECDF 2C8E
#      Subkey fingerprint: 64AA 2AB5 31D5 6903 366B  FEF9 82AA 4A24 3B1E 9478

* tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu:
  hw/i386/pc: Remove unused pc_compat_2_3 declarations
  licenses: Remove SPDX tags not being license identifier for Linaro
  tests/functional/test_mips_malta: Fix comment about endianness of the test
  gdbstub/user-target: fix gdbserver int format (%d -> %x)
  vvfat: create_long_filename: fix out-of-bounds array access
  net/dump: Correctly compute Ethernet packet offset
  net: Fix announce_self

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Stefan Hajnoczi 6 meses atrás
pai
commit
b6df314a4e

+ 7 - 2
accel/tcg/vcpu-state.h

@@ -1,6 +1,11 @@
 /*
 /*
- * SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
- * SPDX-FileCopyrightText: 2023 Linaro Ltd.
+ * TaskState helpers for QEMU
+ *
+ * Copyright (c) 2023 Linaro Ltd.
+ *
+ * Authors:
+ *   Philippe Mathieu-Daudé
+ *
  * SPDX-License-Identifier: GPL-2.0-or-later
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
  */
 #ifndef ACCEL_TCG_VCPU_STATE_H
 #ifndef ACCEL_TCG_VCPU_STATE_H

+ 5 - 6
block/vvfat.c

@@ -403,7 +403,6 @@ static direntry_t *create_long_filename(BDRVVVFATState *s, const char *filename)
 {
 {
     int number_of_entries, i;
     int number_of_entries, i;
     glong length;
     glong length;
-    direntry_t *entry;
 
 
     gunichar2 *longname = g_utf8_to_utf16(filename, -1, NULL, &length, NULL);
     gunichar2 *longname = g_utf8_to_utf16(filename, -1, NULL, &length, NULL);
     if (!longname) {
     if (!longname) {
@@ -414,24 +413,24 @@ static direntry_t *create_long_filename(BDRVVVFATState *s, const char *filename)
     number_of_entries = DIV_ROUND_UP(length * 2, 26);
     number_of_entries = DIV_ROUND_UP(length * 2, 26);
 
 
     for(i=0;i<number_of_entries;i++) {
     for(i=0;i<number_of_entries;i++) {
-        entry=array_get_next(&(s->directory));
+        direntry_t *entry=array_get_next(&(s->directory));
         entry->attributes=0xf;
         entry->attributes=0xf;
         entry->reserved[0]=0;
         entry->reserved[0]=0;
         entry->begin=0;
         entry->begin=0;
         entry->name[0]=(number_of_entries-i)|(i==0?0x40:0);
         entry->name[0]=(number_of_entries-i)|(i==0?0x40:0);
     }
     }
     for(i=0;i<26*number_of_entries;i++) {
     for(i=0;i<26*number_of_entries;i++) {
+        unsigned char *entry=array_get(&(s->directory),s->directory.next-1-(i/26));
         int offset=(i%26);
         int offset=(i%26);
         if(offset<10) offset=1+offset;
         if(offset<10) offset=1+offset;
         else if(offset<22) offset=14+offset-10;
         else if(offset<22) offset=14+offset-10;
         else offset=28+offset-22;
         else offset=28+offset-22;
-        entry=array_get(&(s->directory),s->directory.next-1-(i/26));
         if (i >= 2 * length + 2) {
         if (i >= 2 * length + 2) {
-            entry->name[offset] = 0xff;
+            entry[offset] = 0xff;
         } else if (i % 2 == 0) {
         } else if (i % 2 == 0) {
-            entry->name[offset] = longname[i / 2] & 0xff;
+            entry[offset] = longname[i / 2] & 0xff;
         } else {
         } else {
-            entry->name[offset] = longname[i / 2] >> 8;
+            entry[offset] = longname[i / 2] >> 8;
         }
         }
     }
     }
     g_free(longname);
     g_free(longname);

+ 5 - 5
gdbstub/user-target.c

@@ -317,9 +317,9 @@ void gdb_handle_v_file_open(GArray *params, void *user_ctx)
     int fd = open(filename, flags, mode);
     int fd = open(filename, flags, mode);
 #endif
 #endif
     if (fd < 0) {
     if (fd < 0) {
-        g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno);
+        g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno);
     } else {
     } else {
-        g_string_printf(gdbserver_state.str_buf, "F%d", fd);
+        g_string_printf(gdbserver_state.str_buf, "F%x", fd);
     }
     }
     gdb_put_strbuf();
     gdb_put_strbuf();
 }
 }
@@ -329,7 +329,7 @@ void gdb_handle_v_file_close(GArray *params, void *user_ctx)
     int fd = gdb_get_cmd_param(params, 0)->val_ul;
     int fd = gdb_get_cmd_param(params, 0)->val_ul;
 
 
     if (close(fd) == -1) {
     if (close(fd) == -1) {
-        g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno);
+        g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno);
         gdb_put_strbuf();
         gdb_put_strbuf();
         return;
         return;
     }
     }
@@ -352,7 +352,7 @@ void gdb_handle_v_file_pread(GArray *params, void *user_ctx)
 
 
     ssize_t n = pread(fd, buf, bufsiz, offset);
     ssize_t n = pread(fd, buf, bufsiz, offset);
     if (n < 0) {
     if (n < 0) {
-        g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno);
+        g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno);
         gdb_put_strbuf();
         gdb_put_strbuf();
         return;
         return;
     }
     }
@@ -375,7 +375,7 @@ void gdb_handle_v_file_readlink(GArray *params, void *user_ctx)
     ssize_t n = readlink(filename, buf, BUFSIZ);
     ssize_t n = readlink(filename, buf, BUFSIZ);
 #endif
 #endif
     if (n < 0) {
     if (n < 0) {
-        g_string_printf(gdbserver_state.str_buf, "F-1,%d", errno);
+        g_string_printf(gdbserver_state.str_buf, "F-1,%x", errno);
         gdb_put_strbuf();
         gdb_put_strbuf();
         return;
         return;
     }
     }

+ 3 - 2
hw/misc/ivshmem-flat.c

@@ -1,9 +1,10 @@
 /*
 /*
  * Inter-VM Shared Memory Flat Device
  * Inter-VM Shared Memory Flat Device
  *
  *
- * SPDX-FileCopyrightText: 2023 Linaro Ltd.
- * SPDX-FileContributor: Gustavo Romero <gustavo.romero@linaro.org>
  * SPDX-License-Identifier: GPL-2.0-or-later
  * SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright (c) 2023 Linaro Ltd.
+ * Authors:
+ *   Gustavo Romero
  *
  *
  */
  */
 
 

+ 0 - 3
include/hw/i386/pc.h

@@ -302,9 +302,6 @@ extern const size_t pc_compat_2_5_len;
 extern GlobalProperty pc_compat_2_4[];
 extern GlobalProperty pc_compat_2_4[];
 extern const size_t pc_compat_2_4_len;
 extern const size_t pc_compat_2_4_len;
 
 
-extern GlobalProperty pc_compat_2_3[];
-extern const size_t pc_compat_2_3_len;
-
 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
     static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
     static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
     { \
     { \

+ 3 - 2
include/hw/misc/ivshmem-flat.h

@@ -1,9 +1,10 @@
 /*
 /*
  * Inter-VM Shared Memory Flat Device
  * Inter-VM Shared Memory Flat Device
  *
  *
- * SPDX-FileCopyrightText: 2023 Linaro Ltd.
- * SPDX-FileContributor: Gustavo Romero <gustavo.romero@linaro.org>
  * SPDX-License-Identifier: GPL-2.0-or-later
  * SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright (c) 2023 Linaro Ltd.
+ * Authors:
+ *   Gustavo Romero
  *
  *
  */
  */
 
 

+ 2 - 1
net/dump.c

@@ -155,7 +155,8 @@ static ssize_t filter_dump_receive_iov(NetFilterState *nf, NetClientState *sndr,
 {
 {
     NetFilterDumpState *nfds = FILTER_DUMP(nf);
     NetFilterDumpState *nfds = FILTER_DUMP(nf);
 
 
-    dump_receive_iov(&nfds->ds, iov, iovcnt, qemu_get_vnet_hdr_len(nf->netdev));
+    dump_receive_iov(&nfds->ds, iov, iovcnt, flags & QEMU_NET_PACKET_FLAG_RAW ?
+                     0 : qemu_get_vnet_hdr_len(nf->netdev));
     return 0;
     return 0;
 }
 }
 
 

+ 1 - 0
net/net.c

@@ -822,6 +822,7 @@ static ssize_t qemu_deliver_packet_iov(NetClientState *sender,
         iov_copy[0].iov_len =  nc->vnet_hdr_len;
         iov_copy[0].iov_len =  nc->vnet_hdr_len;
         memcpy(&iov_copy[1], iov, iovcnt * sizeof(*iov));
         memcpy(&iov_copy[1], iov, iovcnt * sizeof(*iov));
         iov = iov_copy;
         iov = iov_copy;
+        iovcnt++;
     }
     }
 
 
     if (nc->info->receive_iov) {
     if (nc->info->receive_iov) {

+ 5 - 2
scripts/qom-cast-macro-clean-cocci-gen.py

@@ -13,8 +13,11 @@
 #           --in-place \
 #           --in-place \
 #           --dir .
 #           --dir .
 #
 #
-# SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
-# SPDX-FileCopyrightText: 2023 Linaro Ltd.
+# Copyright (c) 2023 Linaro Ltd.
+#
+# Authors:
+#   Philippe Mathieu-Daudé
+#
 # SPDX-License-Identifier: GPL-2.0-or-later
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 
 import re
 import re

+ 5 - 2
target/m68k/semihosting-stub.c

@@ -1,8 +1,11 @@
 /*
 /*
  *  m68k/ColdFire semihosting stub
  *  m68k/ColdFire semihosting stub
  *
  *
- * SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
- * SPDX-FileCopyrightText: 2024 Linaro Ltd.
+ * Copyright (c) 2024 Linaro Ltd.
+ *
+ * Authors:
+ *   Philippe Mathieu-Daudé
+ *
  * SPDX-License-Identifier: GPL-2.0-or-later
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
  */
 
 

+ 3 - 2
target/mips/tcg/system/semihosting-stub.c

@@ -1,9 +1,10 @@
 /*
 /*
  *  MIPS semihosting stub
  *  MIPS semihosting stub
  *
  *
- * SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
- * SPDX-FileCopyrightText: 2024 Linaro Ltd.
  * SPDX-License-Identifier: GPL-2.0-or-later
  * SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright (c) 2024 Linaro Ltd.
+ * Authors:
+ *   Philippe Mathieu-Daudé
  */
  */
 
 
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"

+ 5 - 3
tests/functional/test_aarch64_sbsaref.py

@@ -2,9 +2,11 @@
 #
 #
 # Functional test that boots a kernel and checks the console
 # Functional test that boots a kernel and checks the console
 #
 #
-# SPDX-FileCopyrightText: 2023-2024 Linaro Ltd.
-# SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
-# SPDX-FileContributor: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
+# Copyright (c) 2023-2024 Linaro Ltd.
+#
+# Authors:
+#   Philippe Mathieu-Daudé
+#   Marcin Juszkiewicz
 #
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 

+ 5 - 3
tests/functional/test_aarch64_sbsaref_alpine.py

@@ -2,9 +2,11 @@
 #
 #
 # Functional test that boots a kernel and checks the console
 # Functional test that boots a kernel and checks the console
 #
 #
-# SPDX-FileCopyrightText: 2023-2024 Linaro Ltd.
-# SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
-# SPDX-FileContributor: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
+# Copyright (c) 2023-2024 Linaro Ltd.
+#
+# Authors:
+#   Philippe Mathieu-Daudé
+#   Marcin Juszkiewicz
 #
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 

+ 5 - 3
tests/functional/test_aarch64_sbsaref_freebsd.py

@@ -2,9 +2,11 @@
 #
 #
 # Functional test that boots a kernel and checks the console
 # Functional test that boots a kernel and checks the console
 #
 #
-# SPDX-FileCopyrightText: 2023-2024 Linaro Ltd.
-# SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
-# SPDX-FileContributor: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
+# Copyright (c) 2023-2024 Linaro Ltd.
+#
+# Authors:
+#   Philippe Mathieu-Daudé
+#   Marcin Juszkiewicz
 #
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 

+ 1 - 1
tests/qtest/libqos/virtio-scmi.c

@@ -1,7 +1,7 @@
 /*
 /*
  * virtio-scmi nodes for testing
  * virtio-scmi nodes for testing
  *
  *
- * SPDX-FileCopyrightText: Linaro Ltd
+ * Copyright (c) Linaro Ltd.
  * SPDX-FileCopyrightText: Red Hat, Inc.
  * SPDX-FileCopyrightText: Red Hat, Inc.
  * SPDX-License-Identifier: GPL-2.0-or-later
  * SPDX-License-Identifier: GPL-2.0-or-later
  *
  *