aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst6
-rw-r--r--accel/kvm/kvm-all.c2
-rw-r--r--backends/hostmem-epc.c4
-rw-r--r--backends/iommufd.c3
-rw-r--r--backends/rng-random.c5
-rw-r--r--block/curl.c44
-rw-r--r--hw/i386/sgx.c6
-rw-r--r--hw/i386/x86.c2
-rw-r--r--hw/usb/host-libusb.c3
-rw-r--r--hw/usb/u2f-passthru.c4
-rw-r--r--hw/vfio/container.c6
-rw-r--r--qemu-options.hx10
-rw-r--r--scripts/meson-buildoptions.sh14
-rw-r--r--target/hexagon/imported/mmvec/ext.idef2
-rw-r--r--tests/avocado/virtio_check_params.py143
-rw-r--r--util/oslib-posix.c2
16 files changed, 48 insertions, 208 deletions
diff --git a/README.rst b/README.rst
index 21df79ef43..b120a1f69e 100644
--- a/README.rst
+++ b/README.rst
@@ -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:qemu-devel@nongnu.org>`_
* `<https://lists.nongnu.org/mailman/listinfo/qemu-devel>`_
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 2b4ab89679..64bf47a033 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -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;
diff --git a/backends/hostmem-epc.c b/backends/hostmem-epc.c
index f58fcf00a1..6c024d6217 100644
--- a/backends/hostmem-epc.c
+++ b/backends/hostmem-epc.c
@@ -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;
}
diff --git a/backends/iommufd.c b/backends/iommufd.c
index 84fefbc9ee..cabd1b5002 100644
--- a/backends/iommufd.c
+++ b/backends/iommufd.c
@@ -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;
diff --git a/backends/rng-random.c b/backends/rng-random.c
index 80eb5be138..489c0917f0 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -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);
}
}
diff --git a/block/curl.c b/block/curl.c
index ef5252d00b..0fdb6d39ac 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -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;
}
diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
index de76397bcf..a14a84bc6f 100644
--- a/hw/i386/sgx.c
+++ b/hw/i386/sgx.c
@@ -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;
}
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index a4aa8e0810..01fc5e6562 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -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);
}
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 80122b4125..691bc881fb 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -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);
diff --git a/hw/usb/u2f-passthru.c b/hw/usb/u2f-passthru.c
index b7025d303d..c4a783d128 100644
--- a/hw/usb/u2f-passthru.c
+++ b/hw/usb/u2f-passthru.c
@@ -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;
}
diff --git a/hw/vfio/container.c b/hw/vfio/container.c
index 425db1a14c..38a9df3496 100644
--- a/hw/vfio/container.c
+++ b/hw/vfio/container.c
@@ -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;
}
diff --git a/qemu-options.hx b/qemu-options.hx
index 694fa37f28..369ae81d7c 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -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
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index cfadb5ea86..c97079a38c 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -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
}
diff --git a/target/hexagon/imported/mmvec/ext.idef b/target/hexagon/imported/mmvec/ext.idef
index 98daabfb07..03d31f6181 100644
--- a/target/hexagon/imported/mmvec/ext.idef
+++ b/target/hexagon/imported/mmvec/ext.idef
@@ -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);
}
}
diff --git a/tests/avocado/virtio_check_params.py b/tests/avocado/virtio_check_params.py
deleted file mode 100644
index 5fe370a179..0000000000
--- a/tests/avocado/virtio_check_params.py
+++ /dev/null
@@ -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)
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index e76441695b..b090fe0eed 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -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]);