aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/ci/setup/build-environment.yml111
-rw-r--r--scripts/ci/setup/gitlab-runner.yml1
-rw-r--r--scripts/meson-buildoptions.sh25
-rw-r--r--scripts/qapi/parser.py141
-rw-r--r--scripts/symlink-install-tree.py3
5 files changed, 155 insertions, 126 deletions
diff --git a/scripts/ci/setup/build-environment.yml b/scripts/ci/setup/build-environment.yml
index 78b1021cd4..f344d1a850 100644
--- a/scripts/ci/setup/build-environment.yml
+++ b/scripts/ci/setup/build-environment.yml
@@ -24,7 +24,6 @@
when:
- ansible_facts['distribution'] == 'Ubuntu'
- ansible_facts['architecture'] == 'aarch64'
- - ansible_facts['distribution_version'] == '20.04'
- name: Update apt cache / upgrade packages via apt
apt:
@@ -33,87 +32,131 @@
when:
- ansible_facts['distribution'] == 'Ubuntu'
- - name: Install basic packages to build QEMU on Ubuntu 20.04
+ # lcitool variables -f json ubuntu-2204 qemu | jq -r '.pkgs[]' | xargs -n 1 echo "-"
+ - name: Install basic packages to build QEMU on Ubuntu 22.04
package:
name:
+ - bash
+ - bc
+ - bison
+ - bsdextrautils
+ - bzip2
+ - ca-certificates
- ccache
+ - clang
+ - dbus
+ - debianutils
+ - diffutils
+ - exuberant-ctags
+ - findutils
+ - flex
+ - g++
- gcc
+ - gcovr
+ - genisoimage
- gettext
- git
- - glusterfs-common
+ - hostname
- libaio-dev
+ - libasan5
+ - libasound2-dev
- libattr1-dev
+ - libbpf-dev
- libbrlapi-dev
- libbz2-dev
+ - libc6-dev
- libcacard-dev
- - libcapstone-dev
- libcap-ng-dev
+ - libcapstone-dev
+ - libcmocka-dev
- libcurl4-gnutls-dev
+ - libdaxctl-dev
- libdrm-dev
- libepoxy-dev
- libfdt-dev
+ - libffi-dev
- libgbm-dev
+ - libgcrypt20-dev
+ - libglib2.0-dev
+ - libglusterfs-dev
+ - libgnutls28-dev
- libgtk-3-dev
+ - libibumad-dev
- libibverbs-dev
- libiscsi-dev
- libjemalloc-dev
- libjpeg-turbo8-dev
+ - libjson-c-dev
+ - liblttng-ust-dev
- liblzo2-dev
- - libncurses5-dev
- libncursesw5-dev
- libnfs-dev
- - libnss3-dev
- libnuma-dev
+ - libpam0g-dev
+ - libpcre2-dev
- libpixman-1-dev
- - librados-dev
+ - libpmem-dev
+ - libpng-dev
+ - libpulse-dev
- librbd-dev
- librdmacm-dev
- libsasl2-dev
- libsdl2-dev
+ - libsdl2-image-dev
- libseccomp-dev
+ - libslirp-dev
- libsnappy-dev
- libspice-protocol-dev
+ - libspice-server-dev
- libssh-dev
+ - libsystemd-dev
+ - libtasn1-6-dev
+ - libubsan1
+ - libudev-dev
+ - liburing-dev
- libusb-1.0-0-dev
- libusbredirhost-dev
- libvdeplug-dev
+ - libvirglrenderer-dev
- libvte-2.91-dev
+ - libxen-dev
+ - libxml2-dev
- libzstd-dev
+ - llvm
+ - locales
- make
- - python3-yaml
+ - meson
+ - multipath-tools
+ - ncat
+ - nettle-dev
+ - ninja-build
+ - openssh-client
+ - pkgconf
+ - python3
+ - python3-numpy
+ - python3-opencv
+ - python3-pillow
+ - python3-pip
- python3-sphinx
- python3-sphinx-rtd-theme
- - ninja-build
+ - python3-venv
+ - python3-yaml
+ - rpm2cpio
+ - sed
- sparse
+ - systemtap-sdt-dev
+ - tar
+ - tesseract-ocr
+ - tesseract-ocr-eng
+ - texinfo
- xfslibs-dev
+ - zlib1g-dev
state: present
when:
- ansible_facts['distribution'] == 'Ubuntu'
+ - ansible_facts['distribution_version'] == '22.04'
- - name: Install packages to build QEMU on Ubuntu 20.04 on non-s390x
- package:
- name:
- - libspice-server-dev
- - libxen-dev
- state: present
- when:
- - ansible_facts['distribution'] == 'Ubuntu'
- - ansible_facts['architecture'] == 'aarch64' or ansible_facts['architecture'] == 'x86_64'
-
- - name: Install basic packages to build QEMU on Ubuntu 20.04
- package:
- name:
- # Originally from tests/docker/dockerfiles/ubuntu2004.docker
- - clang-10
- - genisoimage
- - liblttng-ust-dev
- - libslirp-dev
- - netcat-openbsd
- when:
- - ansible_facts['distribution'] == 'Ubuntu'
- - ansible_facts['distribution_version'] == '20.04'
-
- - name: Install armhf cross-compile packages to build QEMU on AArch64 Ubuntu 20.04
+ - name: Install armhf cross-compile packages to build QEMU on AArch64 Ubuntu 22.04
package:
name:
- binutils-arm-linux-gnueabihf
@@ -128,7 +171,7 @@
- zlib1g-dev:armhf
when:
- ansible_facts['distribution'] == 'Ubuntu'
- - ansible_facts['distribution_version'] == '20.04'
+ - ansible_facts['distribution_version'] == '22.04'
- ansible_facts['architecture'] == 'aarch64'
- name: Enable EPEL repo on EL8
diff --git a/scripts/ci/setup/gitlab-runner.yml b/scripts/ci/setup/gitlab-runner.yml
index 1a1b270ff2..7bdafab511 100644
--- a/scripts/ci/setup/gitlab-runner.yml
+++ b/scripts/ci/setup/gitlab-runner.yml
@@ -26,6 +26,7 @@
user:
user: gitlab-runner
group: gitlab-runner
+ groups: kvm
comment: GitLab Runner
home: /home/gitlab-runner
shell: /bin/bash
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index d4369a3ad8..52fb079a60 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -1,7 +1,8 @@
# This file is generated by meson-buildoptions.py, do not edit!
meson_options_help() {
- printf "%s\n" ' --audio-drv-list=CHOICES Set audio driver list [default] (choices: alsa/co'
- printf "%s\n" ' reaudio/default/dsound/jack/oss/pa/sdl/sndio)'
+ printf "%s\n" ' --audio-drv-list=CHOICES Set audio driver list [default] (choices: al'
+ printf "%s\n" ' sa/coreaudio/default/dsound/jack/oss/pa/'
+ printf "%s\n" ' pipewire/sdl/sndio)'
printf "%s\n" ' --block-drv-ro-whitelist=VALUE'
printf "%s\n" ' set block driver read-only whitelist (by default'
printf "%s\n" ' affects only QEMU, not tools like qemu-img)'
@@ -22,6 +23,8 @@ meson_options_help() {
printf "%s\n" ' QEMU'
printf "%s\n" ' --enable-cfi Control-Flow Integrity (CFI)'
printf "%s\n" ' --enable-cfi-debug Verbose errors in case of CFI violation'
+ printf "%s\n" ' --enable-debug-graph-lock'
+ printf "%s\n" ' graph lock debugging support'
printf "%s\n" ' --enable-debug-mutex mutex debugging support'
printf "%s\n" ' --enable-debug-stack-usage'
printf "%s\n" ' measure coroutine stack usage'
@@ -136,6 +139,7 @@ meson_options_help() {
printf "%s\n" ' oss OSS sound support'
printf "%s\n" ' pa PulseAudio sound support'
printf "%s\n" ' parallels parallels image format support'
+ printf "%s\n" ' pipewire Pipewire sound support'
printf "%s\n" ' png PNG support with libpng'
printf "%s\n" ' pvrdma Enable PVRDMA support'
printf "%s\n" ' qcow1 qcow1 image format support'
@@ -167,6 +171,7 @@ meson_options_help() {
printf "%s\n" ' VDUSE block export support'
printf "%s\n" ' vfio-user-server'
printf "%s\n" ' vfio-user server support'
+ printf "%s\n" ' vhdx vhdx image format support'
printf "%s\n" ' vhost-crypto vhost-user crypto backend support'
printf "%s\n" ' vhost-kernel vhost kernel backend support'
printf "%s\n" ' vhost-net vhost-net kernel acceleration support'
@@ -176,10 +181,14 @@ meson_options_help() {
printf "%s\n" ' vhost-vdpa vhost-vdpa kernel backend support'
printf "%s\n" ' virglrenderer virgl rendering support'
printf "%s\n" ' virtfs virtio-9p support'
+ printf "%s\n" ' virtfs-proxy-helper'
+ printf "%s\n" ' virtio-9p proxy helper support'
+ printf "%s\n" ' vmdk vmdk image format support'
printf "%s\n" ' vmnet vmnet.framework network backend support'
printf "%s\n" ' vnc VNC server'
printf "%s\n" ' vnc-jpeg JPEG lossy compression for VNC server'
printf "%s\n" ' vnc-sasl SASL authentication for VNC server'
+ printf "%s\n" ' vpc vpc image format support'
printf "%s\n" ' vte vte support for the gtk UI'
printf "%s\n" ' vvfat vvfat image format support'
printf "%s\n" ' whpx WHPX acceleration support'
@@ -249,6 +258,8 @@ _meson_option_parse() {
--datadir=*) quote_sh "-Ddatadir=$2" ;;
--enable-dbus-display) printf "%s" -Ddbus_display=enabled ;;
--disable-dbus-display) printf "%s" -Ddbus_display=disabled ;;
+ --enable-debug-graph-lock) printf "%s" -Ddebug_graph_lock=true ;;
+ --disable-debug-graph-lock) printf "%s" -Ddebug_graph_lock=false ;;
--enable-debug-mutex) printf "%s" -Ddebug_mutex=true ;;
--disable-debug-mutex) printf "%s" -Ddebug_mutex=false ;;
--enable-debug-stack-usage) printf "%s" -Ddebug_stack_usage=true ;;
@@ -370,6 +381,8 @@ _meson_option_parse() {
--disable-pa) printf "%s" -Dpa=disabled ;;
--enable-parallels) printf "%s" -Dparallels=enabled ;;
--disable-parallels) printf "%s" -Dparallels=disabled ;;
+ --enable-pipewire) printf "%s" -Dpipewire=enabled ;;
+ --disable-pipewire) printf "%s" -Dpipewire=disabled ;;
--with-pkgversion=*) quote_sh "-Dpkgversion=$2" ;;
--enable-png) printf "%s" -Dpng=enabled ;;
--disable-png) printf "%s" -Dpng=disabled ;;
@@ -445,6 +458,8 @@ _meson_option_parse() {
--disable-vduse-blk-export) printf "%s" -Dvduse_blk_export=disabled ;;
--enable-vfio-user-server) printf "%s" -Dvfio_user_server=enabled ;;
--disable-vfio-user-server) printf "%s" -Dvfio_user_server=disabled ;;
+ --enable-vhdx) printf "%s" -Dvhdx=enabled ;;
+ --disable-vhdx) printf "%s" -Dvhdx=disabled ;;
--enable-vhost-crypto) printf "%s" -Dvhost_crypto=enabled ;;
--disable-vhost-crypto) printf "%s" -Dvhost_crypto=disabled ;;
--enable-vhost-kernel) printf "%s" -Dvhost_kernel=enabled ;;
@@ -461,6 +476,10 @@ _meson_option_parse() {
--disable-virglrenderer) printf "%s" -Dvirglrenderer=disabled ;;
--enable-virtfs) printf "%s" -Dvirtfs=enabled ;;
--disable-virtfs) printf "%s" -Dvirtfs=disabled ;;
+ --enable-virtfs-proxy-helper) printf "%s" -Dvirtfs_proxy_helper=enabled ;;
+ --disable-virtfs-proxy-helper) printf "%s" -Dvirtfs_proxy_helper=disabled ;;
+ --enable-vmdk) printf "%s" -Dvmdk=enabled ;;
+ --disable-vmdk) printf "%s" -Dvmdk=disabled ;;
--enable-vmnet) printf "%s" -Dvmnet=enabled ;;
--disable-vmnet) printf "%s" -Dvmnet=disabled ;;
--enable-vnc) printf "%s" -Dvnc=enabled ;;
@@ -469,6 +488,8 @@ _meson_option_parse() {
--disable-vnc-jpeg) printf "%s" -Dvnc_jpeg=disabled ;;
--enable-vnc-sasl) printf "%s" -Dvnc_sasl=enabled ;;
--disable-vnc-sasl) printf "%s" -Dvnc_sasl=disabled ;;
+ --enable-vpc) printf "%s" -Dvpc=enabled ;;
+ --disable-vpc) printf "%s" -Dvpc=disabled ;;
--enable-vte) printf "%s" -Dvte=enabled ;;
--disable-vte) printf "%s" -Dvte=disabled ;;
--enable-vvfat) printf "%s" -Dvvfat=enabled ;;
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 878f90b458..4923a59d60 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -346,7 +346,7 @@ class QAPISchemaParser:
elif not self.tok.isspace():
# Show up to next structural, whitespace or quote
# character
- match = must_match('[^[\\]{}:,\\s\'"]+',
+ match = must_match('[^[\\]{}:,\\s\']+',
self.src[self.cursor-1:])
raise QAPIParseError(self, "stray '%s'" % match.group(0))
@@ -468,34 +468,39 @@ class QAPIDoc:
class Section:
# pylint: disable=too-few-public-methods
def __init__(self, parser: QAPISchemaParser,
- name: Optional[str] = None, indent: int = 0):
-
+ name: Optional[str] = None):
# parser, for error messages about indentation
self._parser = parser
# optional section name (argument/member or section name)
self.name = name
+ # section text without section name
self.text = ''
- # the expected indent level of the text of this section
- self._indent = indent
+ # indentation to strip (None means indeterminate)
+ self._indent = None if self.name else 0
def append(self, line: str) -> None:
- # Strip leading spaces corresponding to the expected indent level
- # Blank lines are always OK.
+ line = line.rstrip()
+
if line:
indent = must_match(r'\s*', line).end()
- if indent < self._indent:
+ if self._indent is None:
+ # indeterminate indentation
+ if self.text != '':
+ # non-blank, non-first line determines indentation
+ self._indent = indent
+ elif indent < self._indent:
raise QAPIParseError(
self._parser,
"unexpected de-indent (expected at least %d spaces)" %
self._indent)
line = line[self._indent:]
- self.text += line.rstrip() + '\n'
+ self.text += line + '\n'
class ArgSection(Section):
def __init__(self, parser: QAPISchemaParser,
- name: str, indent: int = 0):
- super().__init__(parser, name, indent)
+ name: str):
+ super().__init__(parser, name)
self.member: Optional['QAPISchemaMember'] = None
def connect(self, member: 'QAPISchemaMember') -> None:
@@ -558,12 +563,12 @@ class QAPIDoc:
self._switch_section(QAPIDoc.NullSection(self._parser))
@staticmethod
- def _is_section_tag(name: str) -> bool:
- return name in ('Returns:', 'Since:',
- # those are often singular or plural
- 'Note:', 'Notes:',
- 'Example:', 'Examples:',
- 'TODO:')
+ def _match_at_name_colon(string: str) -> re.Match:
+ return re.match(r'@([^:]*): *', string)
+
+ @staticmethod
+ def _match_section_tag(string: str) -> re.Match:
+ return re.match(r'(Returns|Since|Notes?|Examples?|TODO): *', string)
def _append_body_line(self, line: str) -> None:
"""
@@ -579,7 +584,6 @@ class QAPIDoc:
Else, append the line to the current section.
"""
- name = line.split(' ', 1)[0]
# FIXME not nice: things like '# @foo:' and '# @foo: ' aren't
# recognized, and get silently treated as ordinary text
if not self.symbol and not self.body.text and line.startswith('@'):
@@ -593,12 +597,12 @@ class QAPIDoc:
self._parser, "name required after '@'")
elif self.symbol:
# This is a definition documentation block
- if name.startswith('@') and name.endswith(':'):
+ if self._match_at_name_colon(line):
self._append_line = self._append_args_line
self._append_args_line(line)
elif line == 'Features:':
self._append_line = self._append_features_line
- elif self._is_section_tag(name):
+ elif self._match_section_tag(line):
self._append_line = self._append_various_line
self._append_various_line(line)
else:
@@ -619,25 +623,11 @@ class QAPIDoc:
Else, append the line to the current section.
"""
- name = line.split(' ', 1)[0]
-
- if name.startswith('@') and name.endswith(':'):
- # If line is "@arg: first line of description", find
- # the index of 'f', which is the indent we expect for any
- # following lines. We then remove the leading "@arg:"
- # from line and replace it with spaces so that 'f' has the
- # same index as it did in the original line and can be
- # handled the same way we will handle following lines.
- indent = must_match(r'@\S*:\s*', line).end()
- line = line[indent:]
- if not line:
- # Line was just the "@arg:" header; following lines
- # are not indented
- indent = 0
- else:
- line = ' ' * indent + line
- self._start_args_section(name[1:-1], indent)
- elif self._is_section_tag(name):
+ match = self._match_at_name_colon(line)
+ if match:
+ line = line[match.end():]
+ self._start_args_section(match.group(1))
+ elif self._match_section_tag(line):
self._append_line = self._append_various_line
self._append_various_line(line)
return
@@ -654,25 +644,11 @@ class QAPIDoc:
self._append_freeform(line)
def _append_features_line(self, line: str) -> None:
- name = line.split(' ', 1)[0]
-
- if name.startswith('@') and name.endswith(':'):
- # If line is "@arg: first line of description", find
- # the index of 'f', which is the indent we expect for any
- # following lines. We then remove the leading "@arg:"
- # from line and replace it with spaces so that 'f' has the
- # same index as it did in the original line and can be
- # handled the same way we will handle following lines.
- indent = must_match(r'@\S*:\s*', line).end()
- line = line[indent:]
- if not line:
- # Line was just the "@arg:" header; following lines
- # are not indented
- indent = 0
- else:
- line = ' ' * indent + line
- self._start_features_section(name[1:-1], indent)
- elif self._is_section_tag(name):
+ match = self._match_at_name_colon(line)
+ if match:
+ line = line[match.end():]
+ self._start_features_section(match.group(1))
+ elif self._match_section_tag(line):
self._append_line = self._append_various_line
self._append_various_line(line)
return
@@ -696,36 +672,22 @@ class QAPIDoc:
Else, append the line to the current section.
"""
- name = line.split(' ', 1)[0]
-
- if name.startswith('@') and name.endswith(':'):
+ match = self._match_at_name_colon(line)
+ if match:
raise QAPIParseError(self._parser,
- "'%s' can't follow '%s' section"
- % (name, self.sections[0].name))
- if self._is_section_tag(name):
- # If line is "Section: first line of description", find
- # the index of 'f', which is the indent we expect for any
- # following lines. We then remove the leading "Section:"
- # from line and replace it with spaces so that 'f' has the
- # same index as it did in the original line and can be
- # handled the same way we will handle following lines.
- indent = must_match(r'\S*:\s*', line).end()
- line = line[indent:]
- if not line:
- # Line was just the "Section:" header; following lines
- # are not indented
- indent = 0
- else:
- line = ' ' * indent + line
- self._start_section(name[:-1], indent)
+ "'@%s:' can't follow '%s' section"
+ % (match.group(1), self.sections[0].name))
+ match = self._match_section_tag(line)
+ if match:
+ line = line[match.end():]
+ self._start_section(match.group(1))
self._append_freeform(line)
def _start_symbol_section(
self,
symbols_dict: Dict[str, 'QAPIDoc.ArgSection'],
- name: str,
- indent: int) -> None:
+ name: str) -> None:
# FIXME invalid names other than the empty string aren't flagged
if not name:
raise QAPIParseError(self._parser, "invalid parameter name")
@@ -733,27 +695,26 @@ class QAPIDoc:
raise QAPIParseError(self._parser,
"'%s' parameter name duplicated" % name)
assert not self.sections
- new_section = QAPIDoc.ArgSection(self._parser, name, indent)
+ new_section = QAPIDoc.ArgSection(self._parser, name)
self._switch_section(new_section)
symbols_dict[name] = new_section
- def _start_args_section(self, name: str, indent: int) -> None:
- self._start_symbol_section(self.args, name, indent)
+ def _start_args_section(self, name: str) -> None:
+ self._start_symbol_section(self.args, name)
- def _start_features_section(self, name: str, indent: int) -> None:
- self._start_symbol_section(self.features, name, indent)
+ def _start_features_section(self, name: str) -> None:
+ self._start_symbol_section(self.features, name)
- def _start_section(self, name: Optional[str] = None,
- indent: int = 0) -> None:
+ def _start_section(self, name: Optional[str] = None) -> None:
if name in ('Returns', 'Since') and self.has_section(name):
raise QAPIParseError(self._parser,
"duplicated '%s' section" % name)
- new_section = QAPIDoc.Section(self._parser, name, indent)
+ new_section = QAPIDoc.Section(self._parser, name)
self._switch_section(new_section)
self.sections.append(new_section)
def _switch_section(self, new_section: 'QAPIDoc.Section') -> None:
- text = self._section.text = self._section.text.strip()
+ text = self._section.text = self._section.text.strip('\n')
# Only the 'body' section is allowed to have an empty body.
# All other sections, including anonymous ones, must have text.
diff --git a/scripts/symlink-install-tree.py b/scripts/symlink-install-tree.py
index 67cb86dd52..8ed97e3c94 100644
--- a/scripts/symlink-install-tree.py
+++ b/scripts/symlink-install-tree.py
@@ -28,5 +28,8 @@ for source, dest in json.loads(out).items():
os.symlink(source, bundle_dest)
except BaseException as e:
if not isinstance(e, OSError) or e.errno != errno.EEXIST:
+ if os.name == 'nt':
+ print('Please enable Developer Mode to support soft link '
+ 'without Administrator permission')
print(f'error making symbolic link {dest}', file=sys.stderr)
raise e