Skip to contentSkip to conversation

Trivial patches for 2024-07-17

GIT PULL Applied Michael Tokarev 2 participants 18 messages Jul 17, 2024 – Jul 18, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

The following changes since commit e2f346aa98646e84eabe0256f89d08e89b1837cf:

Merge tag 'sdmmc-20240716' of https://github.com/philmd/qemu into staging (2024-07-17 07:59:31 +1000)

are available in the Git repository at:

https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches

for you to fetch changes up to 66a8de9889ceb929e2abe7fb0e424f45210d9dda:

meson: Update meson-buildoptions.sh (2024-07-17 14:04:15 +0300)

----------------------------------------------------------------
trivial patches for 2024-07-17

----------------------------------------------------------------
Michael Tokarev (1):
block/curl: rewrite http header parsing function

Thomas Huth (1):
tests/avocado: Remove the non-working virtio_check_params test

Zhao Liu (13):
accel/kvm/kvm-all: Fix superfluous trailing semicolon hw/i386/x86: Fix superfluous trailing semicolon util/oslib-posix: Fix superfluous trailing semicolon target/hexagon/imported/mmvec: Fix superfluous trailing semicolon doc/net/l2tpv3: Update boolean fields' description to avoid short-form use hw/i386/sgx: Get rid of qemu_open_old()
hw/usb/host-libusb: Get rid of qemu_open_old() hw/usb/u2f-passthru: Get rid of qemu_open_old() hw/vfio/container: Get rid of qemu_open_old() backends/hostmem-epc: Get rid of qemu_open_old() backends/iommufd: Get rid of qemu_open_old() backends/rng-random: Get rid of qemu_open_old()
meson: Update meson-buildoptions.sh

Zhihai Dong (1):
README.rst: add the missing punctuations

 README.rst                             |   6 +-
 accel/kvm/kvm-all.c                    |   2 +-
 backends/hostmem-epc.c                 |   4 +-
 backends/iommufd.c                     |   3 +-
 backends/rng-random.c                  |   5 +-
 block/curl.c                           |  44 +++++-----
 hw/i386/sgx.c                          |   6 +-
 hw/i386/x86.c                          |   2 +-
 hw/usb/host-libusb.c                   |   3 +-
 hw/usb/u2f-passthru.c                  |   4 +-
 hw/vfio/container.c                    |   6 +-
 qemu-options.hx                        |  10 +--
 scripts/meson-buildoptions.sh          |  14 ++--
 target/hexagon/imported/mmvec/ext.idef |   2 +-
 tests/avocado/virtio_check_params.py   | 143 ---------------------------------
 util/oslib-posix.c                     |   2 +-
 16 files changed, 48 insertions(+), 208 deletions(-)
 delete mode 100644 tests/avocado/virtio_check_params.py
#1 lore raw

[PULL 02/16] README.rst: add the missing punctuations

From: Zhihai Dong <[email protected]>

Make the README more clearly.

---
 README.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
README.rst +3 -3
index 21df79ef43..b120a1f69e 100644
@@ -82,7 +82,7 @@ guidelines set out in the `style section
 the Developers Guide.
 
 Additional information on submitting patches can be found online via
-the QEMU website
+the QEMU website:
 
 * `<https://wiki.qemu.org/Contribute/SubmitAPatch>`_
 * `<https://wiki.qemu.org/Contribute/TrivialPatches>`_
@@ -102,7 +102,7 @@ requires a working 'git send-email' setup, and by default doesn't
 automate everything, so you may want to go through the above steps
 manually for once.
 
-For installation instructions, please go to
+For installation instructions, please go to:
 
 *  `<https://github.com/stefanha/git-publish>`_
 
@@ -159,7 +159,7 @@ Contact
 =======
 
 The QEMU community can be contacted in a number of ways, with the two
-main methods being email and IRC
+main methods being email and IRC:
 
 * `<mailto:[email protected]>`_
 * `<https://lists.nongnu.org/mailman/listinfo/qemu-devel>`_
Signature · 1 line
2.39.2
#2 lore raw

[PULL 01/16] block/curl: rewrite http header parsing function

In reply to Michael Tokarev

Existing code was long, unclear and twisty.

This also relaxes the rules a tiny bit: allows to have whitespace before header name and colon and makes the header value match to be case-insensitive.

---
 block/curl.c | 44 ++++++++++++++++++--------------------------
 1 file changed, 18 insertions(+), 26 deletions(-)
block/curl.c +18 -26
index ef5252d00b..0fdb6d39ac 100644
@@ -210,37 +210,29 @@ static size_t curl_header_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
 {
     BDRVCURLState *s = opaque;
     size_t realsize = size * nmemb;
-    const char *header = (char *)ptr;
-    const char *end = header + realsize;
-    const char *accept_ranges = "accept-ranges:";
-    const char *bytes = "bytes";
+    const char *p = ptr;
+    const char *end = p + realsize;
+    const char *t = "accept-ranges : bytes "; /* A lowercase template */
 
-    if (realsize >= strlen(accept_ranges)
-        && g_ascii_strncasecmp(header, accept_ranges,
-                               strlen(accept_ranges)) == 0) {
-
-        char *p = strchr(header, ':') + 1;
-
-        /* Skip whitespace between the header name and value. */
-        while (p < end && *p && g_ascii_isspace(*p)) {
-            p++;
-        }
-
-        if (end - p >= strlen(bytes)
-            && strncmp(p, bytes, strlen(bytes)) == 0) {
-
-            /* Check that there is nothing but whitespace after the value. */
-            p += strlen(bytes);
-            while (p < end && *p && g_ascii_isspace(*p)) {
-                p++;
-            }
-
-            if (p == end || !*p) {
-                s->accept_range = true;
+    /* check if header matches the "t" template */
+    for (;;) {
+        if (*t == ' ') { /* space in t matches any amount of isspace in p */
+            if (p < end && g_ascii_isspace(*p)) {
+                ++p;
+            } else {
+                ++t;
             }
+        } else if (*t && p < end && *t == g_ascii_tolower(*p)) {
+            ++p, ++t;
+        } else {
+            break;
         }
     }
 
+    if (!*t && p == end) { /* if we managed to reach ends of both strings */
+        s->accept_range = true;
+    }
+
     return realsize;
 }
 
Signature · 1 line
2.39.2
#3 lore raw

[PULL 04/16] hw/i386/x86: Fix superfluous trailing semicolon

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

---
 hw/i386/x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/x86.c +1 -1
index a4aa8e0810..01fc5e6562 100644
@@ -242,7 +242,7 @@ static void x86_machine_get_pit(Object *obj, Visitor *v, const char *name,
 static void x86_machine_set_pit(Object *obj, Visitor *v, const char *name,
                                     void *opaque, Error **errp)
 {
-    X86MachineState *x86ms = X86_MACHINE(obj);;
+    X86MachineState *x86ms = X86_MACHINE(obj);
 
     visit_type_OnOffAuto(v, name, &x86ms->pit, errp);
 }
Signature · 1 line
2.39.2
#4 lore raw

[PULL 03/16] accel/kvm/kvm-all: Fix superfluous trailing semicolon

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

---
 accel/kvm/kvm-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
accel/kvm/kvm-all.c +1 -1
index 2b4ab89679..64bf47a033 100644
@@ -3878,7 +3878,7 @@ static StatsList *add_kvmstat_entry(struct kvm_stats_desc *pdesc,
     /* Alloc and populate data list */
     stats = g_new0(Stats, 1);
     stats->name = g_strdup(pdesc->name);
-    stats->value = g_new0(StatsValue, 1);;
+    stats->value = g_new0(StatsValue, 1);
 
     if ((pdesc->flags & KVM_STATS_UNIT_MASK) == KVM_STATS_UNIT_BOOLEAN) {
         stats->value->u.boolean = *stats_data;
Signature · 1 line
2.39.2
#5 lore raw

[PULL 05/16] util/oslib-posix: Fix superfluous trailing semicolon

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

---
 util/oslib-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/oslib-posix.c +1 -1
index e76441695b..b090fe0eed 100644
@@ -263,7 +263,7 @@ int qemu_socketpair(int domain, int type, int protocol, int sv[2])
         return ret;
     }
 #endif
-    ret = socketpair(domain, type, protocol, sv);;
+    ret = socketpair(domain, type, protocol, sv);
     if (ret == 0) {
         qemu_set_cloexec(sv[0]);
         qemu_set_cloexec(sv[1]);
Signature · 1 line
2.39.2
#6 lore raw

[PULL 06/16] target/hexagon/imported/mmvec: Fix superfluous trailing semicolon

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

Fix the superfluous trailing semicolon in target/hexagon/imported/mmvec/ ext.idef.

---
 target/hexagon/imported/mmvec/ext.idef | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/hexagon/imported/mmvec/ext.idef +1 -1
index 98daabfb07..03d31f6181 100644
@@ -2855,7 +2855,7 @@ EXTINSN(V6_vscattermhw_add,  "vscatter(Rt32,Mu2,Vvv32.w).h+=Vw32", ATTRIBS(A_EXT
     fVALIGN(RtV, element_size);
     fVFOREACH(32, i) {
         for(j = 0; j < 2; j++) {
-             EA =  RtV + fVALIGN(VvvV.v[j].uw[i],ALIGNMENT);;
+             EA =  RtV + fVALIGN(VvvV.v[j].uw[i],ALIGNMENT);
              fVLOG_VTCM_HALFWORD_INCREMENT_DV(EA,VvvV.v[j].uw[i],VwV,(2*i+j),i,j,ALIGNMENT,MuV);
         }
     }
Signature · 1 line
2.39.2
#7 lore raw

[PULL 07/16] doc/net/l2tpv3: Update boolean fields' description to avoid short-form use

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

The short-form boolean options has been deprecated since v6.0 (refer to docs/about/deprecated.rst).

Update the description and example of boolean fields in l2tpv3 option to avoid deprecation warning.

---
 qemu-options.hx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
qemu-options.hx +5 -5
index ad6521ef5e..edeaefe2c7 100644
@@ -3353,7 +3353,7 @@ SRST
                          -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
                          -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
 
-``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6=on|off][,udp=on|off][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]``
+``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6=on|off][,udp=on|off][,cookie64=on|off][,counter=on|off][,pincounter=on|off][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]``
     Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931)
     is a popular protocol to transport Ethernet (and other Layer 2) data
     frames between two systems. It is present in routers, firewalls and
@@ -3368,7 +3368,7 @@ SRST
     ``dst=dstaddr``
         destination address (mandatory)
 
-    ``udp``
+    ``udp=on``
         select udp encapsulation (default is ip).
 
     ``srcport=srcport``
@@ -3377,7 +3377,7 @@ SRST
     ``dstport=dstport``
         destination udp port.
 
-    ``ipv6``
+    ``ipv6=on``
         force v6, otherwise defaults to v4.
 
     ``rxcookie=rxcookie``; \ ``txcookie=txcookie``
@@ -3385,7 +3385,7 @@ SRST
         Their function is mostly to prevent misconfiguration. By default
         they are 32 bit.
 
-    ``cookie64``
+    ``cookie64=on``
         Set cookie size to 64 bit instead of the default 32
 
     ``counter=off``
@@ -3419,7 +3419,7 @@ SRST
         # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
 
         |qemu_system| linux.img -device e1000,netdev=n1 \\
-            -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
+            -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp=on,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter=on
 
 ``-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]``
     Configure VDE backend to connect to PORT n of a vde switch running
Signature · 1 line
2.39.2
#8 lore raw

[PULL 09/16] hw/i386/sgx: Get rid of qemu_open_old()

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

Quoted 2 lines · osdep.h

Don't introduce new usage of this function, prefer the following qemu_open/qemu_create that take an "Error **errp".

So replace qemu_open_old() with qemu_open(). And considering the SGX enablement description is useful, convert it into a error message hint.

Cc Paolo Bonzini <[email protected]>
Cc Richard Henderson <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
---
 hw/i386/sgx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
hw/i386/sgx.c +4 -2
index de76397bcf..a14a84bc6f 100644
@@ -157,10 +157,12 @@ SGXInfo *qmp_query_sgx_capabilities(Error **errp)
 {
     SGXInfo *info = NULL;
     uint32_t eax, ebx, ecx, edx;
+    Error *local_err = NULL;
 
-    int fd = qemu_open_old("/dev/sgx_vepc", O_RDWR);
+    int fd = qemu_open("/dev/sgx_vepc", O_RDWR, &local_err);
     if (fd < 0) {
-        error_setg(errp, "SGX is not enabled in KVM");
+        error_append_hint(&local_err, "SGX is not enabled in KVM");
+        error_propagate(errp, local_err);
         return NULL;
     }
 
Signature · 1 line
2.39.2
#9 lore raw

[PULL 12/16] hw/vfio/container: Get rid of qemu_open_old()

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

Quoted 2 lines · osdep.h

Don't introduce new usage of this function, prefer the following qemu_open/qemu_create that take an "Error **errp".

So replace qemu_open_old() with qemu_open().

---
 hw/vfio/container.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
hw/vfio/container.c +2 -4
index 425db1a14c..38a9df3496 100644
@@ -600,9 +600,8 @@ static bool vfio_connect_container(VFIOGroup *group, AddressSpace *as,
         }
     }
 
-    fd = qemu_open_old("/dev/vfio/vfio", O_RDWR);
+    fd = qemu_open("/dev/vfio/vfio", O_RDWR, errp);
     if (fd < 0) {
-        error_setg_errno(errp, errno, "failed to open /dev/vfio/vfio");
         goto put_space_exit;
     }
 
@@ -743,9 +742,8 @@ static VFIOGroup *vfio_get_group(int groupid, AddressSpace *as, Error **errp)
     group = g_malloc0(sizeof(*group));
 
     snprintf(path, sizeof(path), "/dev/vfio/%d", groupid);
-    group->fd = qemu_open_old(path, O_RDWR);
+    group->fd = qemu_open(path, O_RDWR, errp);
     if (group->fd < 0) {
-        error_setg_errno(errp, errno, "failed to open %s", path);
         goto free_group_exit;
     }
 
Signature · 1 line
2.39.2
#10 lore raw

[PULL 13/16] backends/hostmem-epc: Get rid of qemu_open_old()

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

Quoted 2 lines · osdep.h

Don't introduce new usage of this function, prefer the following qemu_open/qemu_create that take an "Error **errp".

So replace qemu_open_old() with qemu_open().

---
 backends/hostmem-epc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
backends/hostmem-epc.c +1 -3
index f58fcf00a1..6c024d6217 100644
@@ -29,10 +29,8 @@ sgx_epc_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
         return false;
     }
 
-    fd = qemu_open_old("/dev/sgx_vepc", O_RDWR);
+    fd = qemu_open("/dev/sgx_vepc", O_RDWR, errp);
     if (fd < 0) {
-        error_setg_errno(errp, errno,
-                         "failed to open /dev/sgx_vepc to alloc SGX EPC");
         return false;
     }
 
Signature · 1 line
2.39.2
#11 lore raw

[PULL 15/16] backends/rng-random: Get rid of qemu_open_old()

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

Quoted 2 lines · osdep.h

Don't introduce new usage of this function, prefer the following qemu_open/qemu_create that take an "Error **errp".

So replace qemu_open_old() with qemu_open(). And considering rng_random_opened() will lose its obvious error handling case after removing error_setg_file_open(), add comment to remind here.

(mjt: drop superfluous commit as suggested by philmd)

---
 backends/rng-random.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
backends/rng-random.c +1 -4
index 80eb5be138..489c0917f0 100644
@@ -75,10 +75,7 @@ static void rng_random_opened(RngBackend *b, Error **errp)
         error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
                    "filename", "a valid filename");
     } else {
-        s->fd = qemu_open_old(s->filename, O_RDONLY | O_NONBLOCK);
-        if (s->fd == -1) {
-            error_setg_file_open(errp, errno, s->filename);
-        }
+        s->fd = qemu_open(s->filename, O_RDONLY | O_NONBLOCK, errp);
     }
 }
 
Signature · 1 line
2.39.2
#12 lore raw

[PULL 10/16] hw/usb/host-libusb: Get rid of qemu_open_old()

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

Quoted 2 lines · osdep.h

Don't introduce new usage of this function, prefer the following qemu_open/qemu_create that take an "Error **errp".

So replace qemu_open_old() with qemu_open().

---
 hw/usb/host-libusb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
hw/usb/host-libusb.c +1 -2
index 80122b4125..691bc881fb 100644
@@ -1212,9 +1212,8 @@ static void usb_host_realize(USBDevice *udev, Error **errp)
     if (s->hostdevice) {
         int fd;
         s->needs_autoscan = false;
-        fd = qemu_open_old(s->hostdevice, O_RDWR);
+        fd = qemu_open(s->hostdevice, O_RDWR, errp);
         if (fd < 0) {
-            error_setg_errno(errp, errno, "failed to open %s", s->hostdevice);
             return;
         }
         rc = usb_host_open(s, NULL, fd);
Signature · 1 line
2.39.2
#13 lore raw

[PULL 11/16] hw/usb/u2f-passthru: Get rid of qemu_open_old()

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

Quoted 2 lines · osdep.h

Don't introduce new usage of this function, prefer the following qemu_open/qemu_create that take an "Error **errp".

So replace qemu_open_old() with qemu_open().

---
 hw/usb/u2f-passthru.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
hw/usb/u2f-passthru.c +1 -3
index b7025d303d..c4a783d128 100644
@@ -482,10 +482,8 @@ static void u2f_passthru_realize(U2FKeyState *base, Error **errp)
         return;
 #endif
     } else {
-        fd = qemu_open_old(key->hidraw, O_RDWR);
+        fd = qemu_open(key->hidraw, O_RDWR, errp);
         if (fd < 0) {
-            error_setg(errp, "%s: Failed to open %s", TYPE_U2F_PASSTHRU,
-                       key->hidraw);
             return;
         }
 
Signature · 1 line
2.39.2
#14 lore raw

[PULL 08/16] tests/avocado: Remove the non-working virtio_check_params test

In reply to Michael Tokarev

From: Thomas Huth <[email protected]>

The test has been marked as broken more than 4 years ago [*], and so far nobody ever cared to fix it. Thus let's simply remove it now ... if somebody ever needs it again, they can restore the file from an older version of QEMU.

[*] https://lore.kernel.org/qemu-devel/[email protected]/

(mjt: add reference as suggested by philm)

---
 tests/avocado/virtio_check_params.py | 143 ---------------------------
 1 file changed, 143 deletions(-)
 delete mode 100644 tests/avocado/virtio_check_params.py
tests/avocado/virtio_check_params.py deleted +0 -143
deleted file mode 100644
index 5fe370a179..0000000000
@@ -1,143 +0,0 @@
-#
-# Test virtio-scsi and virtio-blk queue settings for all machine types
-#
-# Copyright (c) 2019 Virtuozzo International GmbH
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-import sys
-import os
-import re
-import logging
-
-from qemu.machine import QEMUMachine
-from avocado_qemu import QemuSystemTest
-from avocado import skip
-
-#list of machine types and virtqueue properties to test
-VIRTIO_SCSI_PROPS = {'seg_max_adjust': 'seg_max_adjust'}
-VIRTIO_BLK_PROPS = {'seg_max_adjust': 'seg-max-adjust'}
-
-DEV_TYPES = {'virtio-scsi-pci': VIRTIO_SCSI_PROPS,
-             'virtio-blk-pci': VIRTIO_BLK_PROPS}
-
-VM_DEV_PARAMS = {'virtio-scsi-pci': ['-device', 'virtio-scsi-pci,id=scsi0'],
-                 'virtio-blk-pci': ['-device',
-                                    'virtio-blk-pci,id=scsi0,drive=drive0',
-                                    '-drive',
-                                    'driver=null-co,id=drive0,if=none']}
-
-
-class VirtioMaxSegSettingsCheck(QemuSystemTest):
-    @staticmethod
-    def make_pattern(props):
-        pattern_items = [r'{0} = \w+'.format(prop) for prop in props]
-        return '|'.join(pattern_items)
-
-    def query_virtqueue(self, vm, dev_type_name):
-        query_ok = False
-        error = None
-        props = None
-
-        output = vm.cmd('human-monitor-command',
-                        command_line = 'info qtree')
-        props_list = DEV_TYPES[dev_type_name].values();
-        pattern = self.make_pattern(props_list)
-        res = re.findall(pattern, output)
-
-        if len(res) != len(props_list):
-            props_list = set(props_list)
-            res = set(res)
-            not_found = props_list.difference(res)
-            not_found = ', '.join(not_found)
-            error = '({0}): The following properties not found: {1}'\
-                     .format(dev_type_name, not_found)
-        else:
-            query_ok = True
-            props = dict()
-            for prop in res:
-                p = prop.split(' = ')
-                props[p[0]] = p[1]
-        return query_ok, props, error
-
-    def check_mt(self, mt, dev_type_name):
-        mt['device'] = dev_type_name # Only for the debug() call.
-        logger = logging.getLogger('machine')
-        logger.debug(mt)
-        with QEMUMachine(self.qemu_bin) as vm:
-            vm.set_machine(mt["name"])
-            vm.add_args('-nodefaults')
-            for s in VM_DEV_PARAMS[dev_type_name]:
-                vm.add_args(s)
-            try:
-                vm.launch()
-                query_ok, props, error = self.query_virtqueue(vm, dev_type_name)
-            except:
-                query_ok = False
-                error = sys.exc_info()[0]
-
-        if not query_ok:
-            self.fail('machine type {0}: {1}'.format(mt['name'], error))
-
-        for prop_name, prop_val in props.items():
-            expected_val = mt[prop_name]
-            self.assertEqual(expected_val, prop_val)
-
-    @staticmethod
-    def seg_max_adjust_enabled(mt):
-        # machine types >= 5.0 should have seg_max_adjust = true
-        # others seg_max_adjust = false
-        mt = mt.split("-")
-
-        # machine types with one line name and name like pc-x.x
-        if len(mt) <= 2:
-            return False
-
-        # machine types like pc-<chip_name>-x.x[.x]
-        ver = mt[2]
-        ver = ver.split(".");
-
-        # versions >= 5.0 goes with seg_max_adjust enabled
-        major = int(ver[0])
-
-        if major >= 5:
-            return True
-        return False
-
-    @skip("break multi-arch CI")
-    def test_machine_types(self):
-        # collect all machine types except 'none', 'isapc', 'microvm'
-        with QEMUMachine(self.qemu_bin) as vm:
-            vm.launch()
-            machines = [m['name'] for m in vm.cmd('query-machines')]
-            vm.shutdown()
-        machines.remove('none')
-        machines.remove('isapc')
-        machines.remove('microvm')
-
-        for dev_type in DEV_TYPES:
-            # create the list of machine types and their parameters.
-            mtypes = list()
-            for m in machines:
-                if self.seg_max_adjust_enabled(m):
-                    enabled = 'true'
-                else:
-                    enabled = 'false'
-                mtypes.append({'name': m,
-                               DEV_TYPES[dev_type]['seg_max_adjust']: enabled})
-
-            # test each machine type for a device type
-            for mt in mtypes:
-                self.check_mt(mt, dev_type)
Signature · 1 line
2.39.2
#15 lore raw

[PULL 14/16] backends/iommufd: Get rid of qemu_open_old()

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

Quoted 2 lines · osdep.h

Don't introduce new usage of this function, prefer the following qemu_open/qemu_create that take an "Error **errp".

So replace qemu_open_old() with qemu_open().

---
 backends/iommufd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
backends/iommufd.c +1 -2
index 84fefbc9ee..cabd1b5002 100644
@@ -77,9 +77,8 @@ bool iommufd_backend_connect(IOMMUFDBackend *be, Error **errp)
     int fd;
 
     if (be->owned && !be->users) {
-        fd = qemu_open_old("/dev/iommu", O_RDWR);
+        fd = qemu_open("/dev/iommu", O_RDWR, errp);
         if (fd < 0) {
-            error_setg_errno(errp, errno, "/dev/iommu opening failed");
             return false;
         }
         be->fd = fd;
Signature · 1 line
2.39.2
#16 lore raw

[PULL 16/16] meson: Update meson-buildoptions.sh

In reply to Michael Tokarev

From: Zhao Liu <[email protected]>

Update meson-buildoptions.sh to stay in sync with meson_options.txt.

---
 scripts/meson-buildoptions.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
scripts/meson-buildoptions.sh +7 -7
index cfadb5ea86..c97079a38c 100644
@@ -83,7 +83,7 @@ meson_options_help() {
   printf "%s\n" '                           (can be empty) [qemu]'
   printf "%s\n" '  --with-trace-file=VALUE  Trace file prefix for simple backend [trace]'
   printf "%s\n" '  --x86-version=CHOICE     tweak required x86_64 architecture version beyond'
-  printf "%s\n" '                           compiler default [1] (choices: 0/1/2/3)'
+  printf "%s\n" '                           compiler default [1] (choices: 0/1/2/3/4)'
   printf "%s\n" ''
   printf "%s\n" 'Optional features, enabled with --enable-FEATURE and'
   printf "%s\n" 'disabled with --disable-FEATURE, default is enabled if available'
@@ -166,6 +166,7 @@ meson_options_help() {
   printf "%s\n" '  qcow1           qcow1 image format support'
   printf "%s\n" '  qed             qed image format support'
   printf "%s\n" '  qga-vss         build QGA VSS support (broken with MinGW)'
+  printf "%s\n" '  qpl             Query Processing Library support'
   printf "%s\n" '  rbd             Ceph block device driver'
   printf "%s\n" '  rdma            Enable RDMA-based migration'
   printf "%s\n" '  replication     replication support'
@@ -187,6 +188,7 @@ meson_options_help() {
   printf "%s\n" '  tools           build support utilities that come with QEMU'
   printf "%s\n" '  tpm             TPM support'
   printf "%s\n" '  u2f             U2F emulation support'
+  printf "%s\n" '  uadk            UADK Library support'
   printf "%s\n" '  usb-redir       libusbredir support'
   printf "%s\n" '  vde             vde network backend support'
   printf "%s\n" '  vdi             vdi image format support'
@@ -221,8 +223,6 @@ meson_options_help() {
   printf "%s\n" '                  Xen PCI passthrough support'
   printf "%s\n" '  xkbcommon       xkbcommon support'
   printf "%s\n" '  zstd            zstd compression support'
-  printf "%s\n" '  qpl             Query Processing Library support'
-  printf "%s\n" '  uadk            UADK Library support'
 }
 _meson_option_parse() {
   case $1 in
@@ -440,6 +440,8 @@ _meson_option_parse() {
     --disable-qga-vss) printf "%s" -Dqga_vss=disabled ;;
     --enable-qom-cast-debug) printf "%s" -Dqom_cast_debug=true ;;
     --disable-qom-cast-debug) printf "%s" -Dqom_cast_debug=false ;;
+    --enable-qpl) printf "%s" -Dqpl=enabled ;;
+    --disable-qpl) printf "%s" -Dqpl=disabled ;;
     --enable-rbd) printf "%s" -Drbd=enabled ;;
     --disable-rbd) printf "%s" -Drbd=disabled ;;
     --enable-rdma) printf "%s" -Drdma=enabled ;;
@@ -501,6 +503,8 @@ _meson_option_parse() {
     --disable-tsan) printf "%s" -Dtsan=false ;;
     --enable-u2f) printf "%s" -Du2f=enabled ;;
     --disable-u2f) printf "%s" -Du2f=disabled ;;
+    --enable-uadk) printf "%s" -Duadk=enabled ;;
+    --disable-uadk) printf "%s" -Duadk=disabled ;;
     --enable-usb-redir) printf "%s" -Dusb_redir=enabled ;;
     --disable-usb-redir) printf "%s" -Dusb_redir=disabled ;;
     --enable-vde) printf "%s" -Dvde=enabled ;;
@@ -560,10 +564,6 @@ _meson_option_parse() {
     --disable-xkbcommon) printf "%s" -Dxkbcommon=disabled ;;
     --enable-zstd) printf "%s" -Dzstd=enabled ;;
     --disable-zstd) printf "%s" -Dzstd=disabled ;;
-    --enable-qpl) printf "%s" -Dqpl=enabled ;;
-    --disable-qpl) printf "%s" -Dqpl=disabled ;;
-    --enable-uadk) printf "%s" -Duadk=enabled ;;
-    --disable-uadk) printf "%s" -Duadk=disabled ;;
     *) return 1 ;;
   esac
 }
Signature · 1 line
2.39.2
#17 lore raw
In reply to Michael Tokarev
Quoted 6 lines · Michael Tokarev

The following changes since commit e2f346aa98646e84eabe0256f89d08e89b1837cf:

   Merge tag 'sdmmc-20240716' ofhttps://github.com/philmd/qemu into staging (2024-07-17 07:59:31 +1000)

are available in the Git repository at:

Quoted 8 lines

https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches

for you to fetch changes up to 66a8de9889ceb929e2abe7fb0e424f45210d9dda:

   meson: Update meson-buildoptions.sh (2024-07-17 14:04:15 +0300)

----------------------------------------------------------------
trivial patches for 2024-07-17

Applied, thanks.

r~