Subdirectories 'virt/qemu virt/libvirt ' relocated to repo 'virt'
Required all reviews in the topic: https://review.opendev.org/q/topic:virt-repo Testing: build-pkgs -c -a: pass build-pkgs -p libvirt,qemu: pass Story: 2010317 Task: 47780 Signed-off-by: Scott Little <scott.little@windriver.com> Change-Id: Ia6138b2042fb344de3c2dadd4ce18f78ac2bf7d2 Depends-On: If81d59698b97e27a8013b2a0b93e2fadc0186205
This commit is contained in:
parent
2d3951f713
commit
4ed6cd1d49
6
virt/libvirt/.gitignore
vendored
6
virt/libvirt/.gitignore
vendored
@ -1,6 +0,0 @@
|
||||
!.distro
|
||||
.distro/centos7/rpmbuild/RPMS
|
||||
.distro/centos7/rpmbuild/SRPMS
|
||||
.distro/centos7/rpmbuild/BUILD
|
||||
.distro/centos7/rpmbuild/BUILDROOT
|
||||
.distro/centos7/rpmbuild/SOURCES/libvirt*tar.gz
|
@ -1,16 +0,0 @@
|
||||
Metadata-Version: 1.1
|
||||
Name: libvirt
|
||||
Version: 1.2.17
|
||||
Summary: Library providing a simple virtualization API
|
||||
Home-page:
|
||||
Author: Windriver
|
||||
Author-email: info@windriver.com
|
||||
License: Apache-2.0
|
||||
|
||||
Description:
|
||||
Libvirt is a C toolkit to interact with the virtualization capabilities
|
||||
of recent versions of Linux (and other OSes). The main package includes
|
||||
the libvirtd server exporting the virtualization support.
|
||||
|
||||
|
||||
Platform: UNKNOWN
|
@ -1,37 +0,0 @@
|
||||
The Centos 7 libvirt source rpm was taken from:
|
||||
http://vault.centos.org/centos/7/updates/Source/SPackages/libvirt-1.2.17-13.el7_2.3.src.rpm
|
||||
|
||||
It's possible to resolve the source rpm based on the yum repos:
|
||||
$ yumdownloader --source --urls libvirt
|
||||
|
||||
The libvirt source code was forked under .../cgcs/git/libvirt.
|
||||
Notes: - The branch is based on upstream tag v1.2.17-maint.
|
||||
- Then each RedHat patches have been committed one by one in the same
|
||||
order specified in the RedHat spec (actually this was automated to use
|
||||
'git am' for each of the patches mentionned in the spec).
|
||||
- The last patch from RedHat is tagged 'libvirt-1.2.17-13.el7_2.3'.
|
||||
- After this tag, all the patches are port from R2.
|
||||
|
||||
The libvirt git repository doesn't come with the ./configure script (and its
|
||||
dependancies). This has to be built using autoconf (but the libvirt releases
|
||||
comes with those, releases are generated using 'make dist').
|
||||
|
||||
One caveat is that bootstrap is made to be executed in a git tree. Trying to
|
||||
execute it out of tree, like the Centos build environment, was unsuccessfull
|
||||
so far.
|
||||
|
||||
The current workaround for now is to commit the configure scripts in the
|
||||
libvirt git repo:
|
||||
|
||||
$ NOCONFIGURE=1 ./autogen.sh --copy
|
||||
$ NOCONFIGURE=1 ./autogen.sh --copy
|
||||
# Remove all .gitignore temporarily for showing modified files
|
||||
$ find . -name .gitignore | xargs rm
|
||||
$ git add -A
|
||||
$ git reset HEAD .gitignore
|
||||
# Repeat last command for all .gitignore files removed
|
||||
$ git commit
|
||||
|
||||
Autogen is executed twice. The first time soft links are created under
|
||||
build-aux/. Running it a second time makes bootstrap copying them and
|
||||
replacing the soft links (there is most likely a smarter way to do this).
|
@ -1,9 +0,0 @@
|
||||
SRC_DIR="$CGCS_BASE/git/libvirt"
|
||||
COPY_LIST="\
|
||||
libvirt/* \
|
||||
libvirt/hooks/* \
|
||||
$CGCS_BASE/downloads/gnulib-ffc927e.tar.gz \
|
||||
$CGCS_BASE/downloads/keycodemapdb-16e5b07.tar.gz"
|
||||
TIS_BASE_SRCREV=ab58260efaa712650c63bb1917122f270070fa4b
|
||||
TIS_PATCH_VER=GITREVCOUNT+PKG_GITREVCOUNT
|
||||
BUILD_IS_SLOW=4
|
@ -1,44 +0,0 @@
|
||||
# Expected build arguments:
|
||||
# BASE: specify base layer
|
||||
# REPO_OPTS: yum options to enable StarlingX repo
|
||||
#
|
||||
ARG BASE
|
||||
FROM ${BASE}
|
||||
|
||||
# Location of the STX repo config file, which will be parsed for enabling repos
|
||||
ARG STX_REPO_FILE=/etc/yum.repos.d/stx.repo
|
||||
|
||||
ARG PROJECT=nova
|
||||
ARG UID=42424
|
||||
ARG GID=42424
|
||||
|
||||
RUN set -ex ;\
|
||||
yum install --disablerepo=* \
|
||||
$(grep '^name=' ${STX_REPO_FILE} | awk -F '=' '{printf "--enablerepo=" $2 " "}') \
|
||||
-y \
|
||||
ceph-common \
|
||||
dmidecode \
|
||||
ebtables \
|
||||
iproute \
|
||||
libcgroup-tools \
|
||||
libvirt \
|
||||
pm-utils \
|
||||
qemu \
|
||||
qemu-block-extra \
|
||||
qemu-efi \
|
||||
qemu-kvm-ev \
|
||||
qemu-kvm-tools-ev \
|
||||
perl-Error \
|
||||
perl-Data-Dumper \
|
||||
perl-TermReadKey \
|
||||
openvswitch ;\
|
||||
groupadd -g ${GID} ${PROJECT} ;\
|
||||
useradd -u ${UID} -g ${PROJECT} -M -d /var/lib/${PROJECT} -s /usr/sbin/nologin -c "${PROJECT} user" ${PROJECT} ;\
|
||||
mkdir -p /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} ;\
|
||||
chown ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} ;\
|
||||
usermod -a -G kvm ${PROJECT} ;\
|
||||
rm -rf \
|
||||
/var/log/* \
|
||||
/tmp/* \
|
||||
/var/tmp/*
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
||||
BUILDER=docker
|
||||
LABEL=stx-libvirt
|
@ -1,76 +0,0 @@
|
||||
From 4e4452b3bba71265864d9c46f135418ffd6113a0 Mon Sep 17 00:00:00 2001
|
||||
From: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
Date: Wed, 9 Nov 2022 09:07:21 -0300
|
||||
Subject: [PATCH] STX: Customize Debian build files
|
||||
|
||||
Adds to libvirt Debian build instructions, starlingx specific files
|
||||
based on how starlingx-staging/stx-libvirt was previously built and
|
||||
delivered on CentOS, adding to the following:
|
||||
* Enabling syslog for libvirtd
|
||||
* Setting "auth_tcp" to "none"
|
||||
* Logrotate files
|
||||
* Qemu hook
|
||||
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
debian/libvirt-daemon-system.install | 1 +
|
||||
debian/rules | 24 ++++++++++++++++++++++++
|
||||
2 files changed, 25 insertions(+)
|
||||
|
||||
diff --git a/debian/libvirt-daemon-system.install b/debian/libvirt-daemon-system.install
|
||||
index 04cf9052c..b2ce2ac75 100644
|
||||
--- a/debian/libvirt-daemon-system.install
|
||||
+++ b/debian/libvirt-daemon-system.install
|
||||
@@ -2,6 +2,7 @@ etc/default/libvirt-guests
|
||||
etc/default/libvirtd
|
||||
etc/default/virtlockd
|
||||
etc/default/virtlogd
|
||||
+etc/libvirt/hooks/qemu
|
||||
etc/libvirt/libvirtd.conf
|
||||
etc/libvirt/qemu-lockd.conf
|
||||
etc/libvirt/qemu.conf
|
||||
diff --git a/debian/rules b/debian/rules
|
||||
index a495870c4..a34132779 100755
|
||||
--- a/debian/rules
|
||||
+++ b/debian/rules
|
||||
@@ -15,6 +15,11 @@ DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions
|
||||
DPKG_EXPORT_BUILDFLAGS = 1
|
||||
include /usr/share/dpkg/buildflags.mk
|
||||
|
||||
+SOURCE1 = libvirt.logrotate
|
||||
+SOURCE2 = libvirt.lxc
|
||||
+SOURCE3 = libvirt.qemu
|
||||
+SOURCE4 = qemu
|
||||
+
|
||||
ARCHES_LXC = alpha amd64 arm64 armel armhf hppa i386 m68k mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sh4 sparc64 x32
|
||||
ARCHES_XEN = amd64 arm64 armhf i386
|
||||
ARCHES_VBOX = amd64 i386
|
||||
@@ -221,6 +226,25 @@ override_dh_auto_install:
|
||||
$(DEB_DESTDIR)/etc/libvirt/nwfilter/ \
|
||||
$(DEB_DESTDIR)/usr/share/libvirt/
|
||||
|
||||
+ # STX: Begin custom install
|
||||
+ # Enable syslog for libvirtd (/var/log/libvirtd.log)
|
||||
+ echo "log_outputs=\"3:syslog:libvirtd\"" >> $(DEB_DESTDIR)/etc/libvirt/libvirtd.conf
|
||||
+
|
||||
+ # Set auth_tcp to "none" for now to enable live migration.
|
||||
+ # We'll need to set up proper authentication later.
|
||||
+ sed -i '/#auth_tcp/a auth_tcp = "none"' $(DEB_DESTDIR)/etc/libvirt/libvirtd.conf
|
||||
+
|
||||
+ # Install logrotate files
|
||||
+ install -p -D -m 644 $(SOURCE1) $(DEB_DESTDIR)/etc/logrotate.d/libvirtd
|
||||
+ install -p -D -m 644 $(SOURCE2) $(DEB_DESTDIR)/etc/logrotate.d/libvirtd.lxc
|
||||
+ install -p -D -m 644 $(SOURCE3) $(DEB_DESTDIR)/etc/logrotate.d/libvirtd.qemu
|
||||
+
|
||||
+ # Install hooks
|
||||
+ mkdir -p $(DEB_DESTDIR)/etc/libvirt/hooks
|
||||
+ install -m 0500 $(SOURCE4) $(DEB_DESTDIR)/etc/libvirt/hooks/qemu
|
||||
+
|
||||
+ # STX: End custom install
|
||||
+
|
||||
override_dh_install-arch:
|
||||
dh_install
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1 +0,0 @@
|
||||
0001-STX-Customize-Debian-build-files.patch
|
@ -1,54 +0,0 @@
|
||||
# Expected build arguments:
|
||||
# BASE: specify base layer
|
||||
# REPO_OPTS: yum options to enable StarlingX repo
|
||||
#
|
||||
ARG BASE
|
||||
FROM ${BASE} AS stx
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
ARG PROJECT=nova
|
||||
ARG UID=42424
|
||||
ARG GID=42424
|
||||
|
||||
RUN apt-get -y update \
|
||||
&& apt-get -y install \
|
||||
ceph-common \
|
||||
dmidecode \
|
||||
iptables \
|
||||
iproute2 \
|
||||
cgroup-tools \
|
||||
libcgroup1 \
|
||||
libnss-libvirt \
|
||||
libvirt0 \
|
||||
libvirt-clients \
|
||||
libvirt-daemon \
|
||||
libvirt-daemon-config-network \
|
||||
libvirt-daemon-config-nwfilter \
|
||||
libvirt-daemon-driver-lxc \
|
||||
libvirt-daemon-driver-qemu \
|
||||
libvirt-daemon-driver-storage-gluster \
|
||||
libvirt-daemon-system \
|
||||
libvirt-daemon-system-systemd \
|
||||
libvirt-login-shell \
|
||||
pm-utils \
|
||||
qemu \
|
||||
qemu-block-extra \
|
||||
qemu-system-common \
|
||||
qemu-system-data \
|
||||
qemu-system-x86 \
|
||||
qemu-guest-agent \
|
||||
openvswitch-common \
|
||||
openvswitch-switch \
|
||||
openvswitch-switch-dpdk \
|
||||
python3-openvswitch \
|
||||
&& apt-get -y clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN groupadd -g ${GID} ${PROJECT} ;\
|
||||
useradd -u ${UID} -g ${PROJECT} -M -d /var/lib/${PROJECT} -s /usr/sbin/nologin -c "${PROJECT} user" ${PROJECT} ;\
|
||||
mkdir -p /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} ;\
|
||||
chown ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} ;\
|
||||
usermod -a -G kvm ${PROJECT} ;\
|
||||
rm -rf /var/log/* /tmp/* /var/tmp/*
|
||||
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
debname: libvirt
|
||||
debver: 7.0.0-3
|
||||
dl_path:
|
||||
name: libvirt-debian-7.0.0-3.tar.gz
|
||||
url: https://salsa.debian.org/libvirt-team/libvirt/-/archive/debian/7.0.0-3/libvirt-debian-7.0.0-3.tar.gz
|
||||
md5sum: 371673c35fda957748ce3a19a0cd8539
|
||||
sha256sum: 6f6acf34b2ae20ec9cfa64e89c3245ccf44321c86cd5606abe718ca25e443b2f
|
||||
src_files:
|
||||
- libvirt/libvirt.logrotate
|
||||
- libvirt/libvirt.lxc
|
||||
- libvirt/libvirt.qemu
|
||||
- libvirt/hooks/qemu
|
||||
revision:
|
||||
dist: $STX_DIST
|
||||
GITREVCOUNT:
|
||||
BASE_SRCREV: 1f37f8b5d4c953a71070410745195f33d58a7a60
|
||||
SRC_DIR: ${MY_REPO}/stx/integ/virt/libvirt
|
@ -1,35 +0,0 @@
|
||||
From 2721c79b6cd8caf0f7d1796c2316567cd44b2caa Mon Sep 17 00:00:00 2001
|
||||
From: Ludovic Beliveau <ludovic.beliveau@windriver.com>
|
||||
Date: Mon, 21 Mar 2016 17:46:41 -0400
|
||||
Subject: [PATCH] STX: CPU pinning not working over live-migration
|
||||
|
||||
Commit carried over from pre-CentOS
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
src/conf/domain_conf.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index 01b718763..70d29475d 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -23184,10 +23184,14 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src,
|
||||
goto error;
|
||||
}
|
||||
|
||||
+ /* STX: Disable this check since it is problematic.
|
||||
+ - Note that disabling this check is not critical since
|
||||
+ this section is regenerated at destination.
|
||||
for (i = 0; i < src->nconsoles; i++)
|
||||
if (!virDomainConsoleDefCheckABIStability(src->consoles[i],
|
||||
dst->consoles[i]))
|
||||
goto error;
|
||||
+ */
|
||||
|
||||
if (src->nhubs != dst->nhubs) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,47 +0,0 @@
|
||||
From fbc79d575f283055d5c19fce96e97f1e27038922 Mon Sep 17 00:00:00 2001
|
||||
From: Ludovic Beliveau <ludovic.beliveau@windriver.com>
|
||||
Date: Mon, 21 Mar 2016 18:12:32 -0400
|
||||
Subject: [PATCH] STX: System Logging: set group read permission on log files
|
||||
|
||||
Commit carried over from pre-CentOS
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
src/qemu/qemu_domain.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||
index 0765dc72d..72cccd1e9 100644
|
||||
--- a/src/qemu/qemu_domain.c
|
||||
+++ b/src/qemu/qemu_domain.c
|
||||
@@ -6339,7 +6339,7 @@ qemuDomainLogContextPtr qemuDomainLogContextNew(virQEMUDriverPtr driver,
|
||||
if (ctxt->writefd < 0)
|
||||
goto error;
|
||||
} else {
|
||||
- if ((ctxt->writefd = open(ctxt->path, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR)) < 0) {
|
||||
+ if ((ctxt->writefd = open(ctxt->path, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP)) < 0) {
|
||||
virReportSystemError(errno, _("failed to create logfile %s"),
|
||||
ctxt->path);
|
||||
goto error;
|
||||
@@ -6506,7 +6506,7 @@ qemuDomainLogAppendMessage(virQEMUDriverPtr driver,
|
||||
vm->def->name, path, message, 0) < 0)
|
||||
goto cleanup;
|
||||
} else {
|
||||
- if ((writefd = open(path, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR)) < 0) {
|
||||
+ if ((writefd = open(path, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP)) < 0) {
|
||||
virReportSystemError(errno, _("failed to create logfile %s"),
|
||||
path);
|
||||
goto cleanup;
|
||||
@@ -11060,7 +11060,7 @@ virQEMUFileOpenAs(uid_t fallback_uid,
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
- if ((fd = virFileOpenAs(path, oflags, S_IRUSR | S_IWUSR, uid, gid,
|
||||
+ if ((fd = virFileOpenAs(path, oflags, S_IRUSR | S_IWUSR | S_IRGRP, uid, gid,
|
||||
vfoflags | VIR_FILE_OPEN_NOFORK)) < 0) {
|
||||
/* If we failed as root, and the error was permission-denied
|
||||
(EACCES or EPERM), assume it's on a network-connected share
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,29 +0,0 @@
|
||||
From fdf5e7a69587cebdccf1608f3de48fbdaa8ee7ef Mon Sep 17 00:00:00 2001
|
||||
From: Ludovic Beliveau <ludovic.beliveau@windriver.com>
|
||||
Date: Mon, 21 Mar 2016 18:15:20 -0400
|
||||
Subject: [PATCH] STX: Drop migration poll times to 10mS
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
src/qemu/qemu_migration.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 5353c7ee0..741ab986a 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -1846,8 +1846,8 @@ qemuMigrationSrcWaitForCompletion(virQEMUDriverPtr driver,
|
||||
return -2;
|
||||
}
|
||||
} else {
|
||||
- /* Poll every 50ms for progress & to allow cancellation */
|
||||
- struct timespec ts = { .tv_sec = 0, .tv_nsec = 50 * 1000 * 1000ull };
|
||||
+ /* Poll every 10ms for progress & to allow cancellation */
|
||||
+ struct timespec ts = { .tv_sec = 0, .tv_nsec = 10 * 1000 * 1000ull };
|
||||
|
||||
virObjectUnlock(vm);
|
||||
nanosleep(&ts, NULL);
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,351 +0,0 @@
|
||||
From e4c5a64fb4134ce2a57fe5263824ed5e85ec97eb Mon Sep 17 00:00:00 2001
|
||||
From: Ludovic Beliveau <ludovic.beliveau@windriver.com>
|
||||
Date: Tue, 22 Mar 2016 09:58:36 -0400
|
||||
Subject: [PATCH] STX: DPDK parms handling
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
[ Removed deprecated macros ]
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
src/conf/domain_conf.c | 152 ++++++++++++++++++++++++++++++++++++++++
|
||||
src/conf/domain_conf.h | 25 +++++++
|
||||
src/qemu/qemu.conf | 4 +-
|
||||
src/qemu/qemu_command.c | 35 +++++++++
|
||||
4 files changed, 214 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index 70d29475d..e760e61fb 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -1195,6 +1195,14 @@ VIR_ENUM_IMPL(virDomainVsockModel,
|
||||
"virtio-non-transitional",
|
||||
);
|
||||
|
||||
+/* STX: DPDK Customization */
|
||||
+VIR_ENUM_IMPL(virDomainDpdkProcess,
|
||||
+ VIR_DOMAIN_DPDK_PROCTYPE_LAST,
|
||||
+ "auto",
|
||||
+ "primary",
|
||||
+ "secondary",
|
||||
+);
|
||||
+
|
||||
VIR_ENUM_IMPL(virDomainDiskDiscard,
|
||||
VIR_DOMAIN_DISK_DISCARD_LAST,
|
||||
"default",
|
||||
@@ -1612,6 +1620,103 @@ virBlkioDeviceArrayClear(virBlkioDevicePtr devices,
|
||||
VIR_FREE(devices[i].path);
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * STX: virDomainDpdkParamsDefPtr
|
||||
+ *
|
||||
+ * this function parses a XML node:
|
||||
+ *
|
||||
+ * <dpdk>
|
||||
+ * <process type='secondary'/>
|
||||
+ * <file prefix='vs'/>
|
||||
+ * <memory channels='4'/>
|
||||
+ * <cpu list='0,2-3'/>
|
||||
+ * </dpdk>
|
||||
+ *
|
||||
+ * and fills a virDpdkParams struct.
|
||||
+ */
|
||||
+static int
|
||||
+virDomainDpdkParamsParseXML(xmlNodePtr ctxt,
|
||||
+ virDomainDpdkParamsDefPtr dpdk)
|
||||
+{
|
||||
+ char *channels = NULL;
|
||||
+ char *process_type = NULL;
|
||||
+ char *file_prefix = NULL;
|
||||
+ char *cpu_list = NULL;
|
||||
+ xmlNodePtr cur;
|
||||
+ int ret = -EINVAL;
|
||||
+
|
||||
+ cur = ctxt->children;
|
||||
+ while (cur != NULL) {
|
||||
+ if (cur->type == XML_ELEMENT_NODE) {
|
||||
+ if (!process_type && xmlStrEqual(cur->name, BAD_CAST "process")) {
|
||||
+ process_type = virXMLPropString(cur, "type");
|
||||
+ }
|
||||
+ if (!file_prefix && xmlStrEqual(cur->name, BAD_CAST "file")) {
|
||||
+ file_prefix = virXMLPropString(cur, "prefix");
|
||||
+ }
|
||||
+ if (!cpu_list && xmlStrEqual(cur->name, BAD_CAST "cpu")) {
|
||||
+ cpu_list = virXMLPropString(cur, "list");
|
||||
+ }
|
||||
+ if (!channels && xmlStrEqual(cur->name, BAD_CAST "memory")) {
|
||||
+ channels = virXMLPropString(cur, "channels");
|
||||
+ }
|
||||
+ }
|
||||
+ cur = cur->next;
|
||||
+ }
|
||||
+
|
||||
+ if (!process_type) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
+ _("missing DPDK process type"));
|
||||
+ goto error;
|
||||
+ }
|
||||
+ if (!file_prefix) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
+ _("missing DPDK file prefix"));
|
||||
+ goto error;
|
||||
+ }
|
||||
+ if (!cpu_list) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
+ _("missing DPDK CPU list"));
|
||||
+ goto error;
|
||||
+ }
|
||||
+ if (!channels) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
+ _("missing DPDK memory channel count"));
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ dpdk->process_type = virDomainDpdkProcessTypeFromString(process_type);
|
||||
+ if (virStrToLong_ui(channels, NULL, 10, &dpdk->nchannels) < 0) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
+ _("could not parse DPDK memory channels %s"),
|
||||
+ channels);
|
||||
+ goto error;
|
||||
+ }
|
||||
+ if (virBitmapParse(cpu_list, &dpdk->cpumask, 128) < 0) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
+ _("could not parse DPDK CPU list %s"),
|
||||
+ cpu_list);
|
||||
+ goto error;
|
||||
+ }
|
||||
+ if (!(dpdk->file_prefix = g_strdup(file_prefix))) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ ret = 0;
|
||||
+
|
||||
+cleanup:
|
||||
+ VIR_FREE(process_type);
|
||||
+ VIR_FREE(file_prefix);
|
||||
+ VIR_FREE(cpu_list);
|
||||
+ VIR_FREE(channels);
|
||||
+
|
||||
+ return ret;
|
||||
+error:
|
||||
+ virDomainDpdkParamsDefFree(dpdk);
|
||||
+ ret = -EINVAL;
|
||||
+ goto cleanup;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* virDomainBlkioDeviceParseXML
|
||||
*
|
||||
@@ -3221,6 +3326,16 @@ virDomainClockDefClear(virDomainClockDefPtr def)
|
||||
VIR_FREE(def->timers);
|
||||
}
|
||||
|
||||
+/* STX: DPDK Customization */
|
||||
+void
|
||||
+virDomainDpdkParamsDefFree(virDomainDpdkParamsDefPtr dpdk)
|
||||
+{
|
||||
+ if (!dpdk)
|
||||
+ return;
|
||||
+
|
||||
+ virBitmapFree(dpdk->cpumask);
|
||||
+ VIR_FREE(dpdk->file_prefix);
|
||||
+}
|
||||
|
||||
static bool
|
||||
virDomainIOThreadIDArrayHasPin(virDomainDefPtr def)
|
||||
@@ -3397,6 +3512,10 @@ void virDomainDefFree(virDomainDefPtr def)
|
||||
virDomainVcpuDefFree(def->vcpus[i]);
|
||||
VIR_FREE(def->vcpus);
|
||||
|
||||
+ /* STX: DPDK Customization */
|
||||
+ virDomainDpdkParamsDefFree(def->dpdk);
|
||||
+ VIR_FREE(def->dpdk);
|
||||
+
|
||||
/* hostdevs must be freed before nets (or any future "intelligent
|
||||
* hostdevs") because the pointer to the hostdev is really
|
||||
* pointing into the middle of the higher level device's object,
|
||||
@@ -19786,6 +19905,15 @@ virDomainDefParseMemory(virDomainDefPtr def,
|
||||
if (virXPathBoolean("boolean(./memoryBacking/discard)", ctxt))
|
||||
def->mem.discard = VIR_TRISTATE_BOOL_YES;
|
||||
|
||||
+ /* STX: Extract dpdk parameters */
|
||||
+ if ((node = virXPathNode("./dpdk", ctxt))) {
|
||||
+ def->dpdk = (virDomainDpdkParamsDefPtr)calloc(1, sizeof(*(def->dpdk)));
|
||||
+ if (def->dpdk == NULL)
|
||||
+ goto error;
|
||||
+ if (virDomainDpdkParamsParseXML(node, def->dpdk) < 0)
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
|
||||
error:
|
||||
@@ -28466,6 +28594,8 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
unsigned char *uuid;
|
||||
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||
const char *type = NULL;
|
||||
+ /* STX: DPDK Customization */
|
||||
+ char *cpu_list = NULL;
|
||||
int n;
|
||||
size_t i;
|
||||
|
||||
@@ -28511,6 +28641,28 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
virBufferEscapeString(buf, "<description>%s</description>\n",
|
||||
def->description);
|
||||
|
||||
+ /* STX: DPDK Customization */
|
||||
+ if (def->dpdk) {
|
||||
+ virBufferAsprintf(buf, " <dpdk>\n");
|
||||
+ if (!(type = virDomainDpdkProcessTypeToString(def->dpdk->process_type))) {
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("unexpected DPDK process type %d"),
|
||||
+ def->dpdk->process_type);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (!(cpu_list = virBitmapFormat(def->dpdk->cpumask))) {
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("unexpected CPU CPU list"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ virBufferAsprintf(buf, " <process type='%s'/>\n", type);
|
||||
+ virBufferAsprintf(buf, " <file prefix='%s'/>\n", def->dpdk->file_prefix);
|
||||
+ virBufferAsprintf(buf, " <cpu list='%s'/>\n", cpu_list);
|
||||
+ virBufferAsprintf(buf, " <memory channels='%u'/>\n", def->dpdk->nchannels);
|
||||
+ virBufferAsprintf(buf, " </dpdk>\n");
|
||||
+ VIR_FREE(cpu_list);
|
||||
+ }
|
||||
+
|
||||
if (def->metadata) {
|
||||
g_autoptr(xmlBuffer) xmlbuf = NULL;
|
||||
int oldIndentTreeOutput = xmlIndentTreeOutput;
|
||||
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
|
||||
index ec43bbe18..c5a0a16d3 100644
|
||||
--- a/src/conf/domain_conf.h
|
||||
+++ b/src/conf/domain_conf.h
|
||||
@@ -2143,6 +2143,24 @@ struct _virDomainOSDef {
|
||||
virDomainBIOSDef bios;
|
||||
};
|
||||
|
||||
+/* STX: DPDK Customization */
|
||||
+enum virDomainDpdkProcessType {
|
||||
+ VIR_DOMAIN_DPDK_PROCTYPE_AUTO,
|
||||
+ VIR_DOMAIN_DPDK_PROCTYPE_PRIMARY,
|
||||
+ VIR_DOMAIN_DPDK_PROCTYPE_SECONDARY,
|
||||
+
|
||||
+ VIR_DOMAIN_DPDK_PROCTYPE_LAST
|
||||
+};
|
||||
+
|
||||
+typedef struct _virDomainDpdkParamsDef virDomainDpdkParamsDef;
|
||||
+typedef virDomainDpdkParamsDef *virDomainDpdkParamsDefPtr;
|
||||
+struct _virDomainDpdkParamsDef {
|
||||
+ enum virDomainDpdkProcessType process_type;
|
||||
+ char *file_prefix;
|
||||
+ unsigned nchannels;
|
||||
+ virBitmapPtr cpumask;
|
||||
+};
|
||||
+
|
||||
typedef enum {
|
||||
VIR_DOMAIN_TIMER_NAME_PLATFORM = 0,
|
||||
VIR_DOMAIN_TIMER_NAME_PIT,
|
||||
@@ -2569,6 +2587,9 @@ struct _virDomainDef {
|
||||
char *title;
|
||||
char *description;
|
||||
|
||||
+ /* STX: DPDK Customization */
|
||||
+ virDomainDpdkParamsDefPtr dpdk;
|
||||
+
|
||||
virDomainBlkiotune blkio;
|
||||
virDomainMemtune mem;
|
||||
|
||||
@@ -3062,6 +3083,8 @@ int virDomainObjWaitUntil(virDomainObjPtr vm,
|
||||
|
||||
void virDomainPanicDefFree(virDomainPanicDefPtr panic);
|
||||
void virDomainResourceDefFree(virDomainResourceDefPtr resource);
|
||||
+/* STX: DPDK Customization */
|
||||
+void virDomainDpdkParamsDefFree(virDomainDpdkParamsDefPtr dpdk);
|
||||
void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def);
|
||||
const char *virDomainInputDefGetPath(virDomainInputDefPtr input);
|
||||
void virDomainInputDefFree(virDomainInputDefPtr def);
|
||||
@@ -3711,6 +3734,8 @@ VIR_ENUM_DECL(virDomainRNGBackend);
|
||||
VIR_ENUM_DECL(virDomainTPMModel);
|
||||
VIR_ENUM_DECL(virDomainTPMBackend);
|
||||
VIR_ENUM_DECL(virDomainTPMVersion);
|
||||
+/* STX: DPDK Customization */
|
||||
+VIR_ENUM_DECL(virDomainDpdkProcess);
|
||||
VIR_ENUM_DECL(virDomainMemoryModel);
|
||||
VIR_ENUM_DECL(virDomainMemoryBackingModel);
|
||||
VIR_ENUM_DECL(virDomainMemorySource);
|
||||
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
|
||||
index 0c1054f19..754161254 100644
|
||||
--- a/src/qemu/qemu.conf
|
||||
+++ b/src/qemu/qemu.conf
|
||||
@@ -516,11 +516,11 @@
|
||||
# user = "+0" # Super user (uid=0)
|
||||
# user = "100" # A user named "100" or a user with uid=100
|
||||
#
|
||||
-#user = "root"
|
||||
+user = "root"
|
||||
|
||||
# The group for QEMU processes run by the system instance. It can be
|
||||
# specified in a similar way to user.
|
||||
-#group = "root"
|
||||
+group = "root"
|
||||
|
||||
# Whether libvirt should dynamically change file ownership
|
||||
# to match the configured user/group above. Defaults to 1.
|
||||
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||
index 6f970a312..4f2908085 100644
|
||||
--- a/src/qemu/qemu_command.c
|
||||
+++ b/src/qemu/qemu_command.c
|
||||
@@ -1873,6 +1873,35 @@ qemuCommandAddExtDevice(virCommandPtr cmd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/* STX: DPDK Customization */
|
||||
+static int
|
||||
+qemuBuildDpdkArgStr(virCommandPtr cmd,
|
||||
+ const virDomainDpdkParamsDefPtr dpdk)
|
||||
+{
|
||||
+ char *cpumask;
|
||||
+
|
||||
+ if (!dpdk) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ cpumask = virBitmapToString(dpdk->cpumask);
|
||||
+ if (!cpumask) {
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("Unable to format DPDK cpumask as string"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ virCommandAddArgFormat(cmd, "-c %s", cpumask);
|
||||
+ virCommandAddArgFormat(cmd, "-n %u", dpdk->nchannels);
|
||||
+ virCommandAddArgFormat(cmd, "--proc-type=%s", "secondary");
|
||||
+ virCommandAddArgFormat(cmd, "--file-prefix=%s", dpdk->file_prefix);
|
||||
+ virCommandAddArg(cmd, "--");
|
||||
+ virCommandAddArg(cmd, "-enable-dpdk");
|
||||
+ VIR_FREE(cpumask);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
qemuBuildFloppyCommandLineControllerOptions(virCommandPtr cmd,
|
||||
const virDomainDef *def,
|
||||
@@ -9816,6 +9845,12 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
|
||||
virCommandAddEnvXDG(cmd, priv->libDir);
|
||||
}
|
||||
|
||||
+ /* STX: DPDK Customization */
|
||||
+ if (def->dpdk) {
|
||||
+ if (qemuBuildDpdkArgStr(cmd, def->dpdk) < 0)
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
if (qemuBuildNameCommandLine(cmd, cfg, def, qemuCaps) < 0)
|
||||
return NULL;
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,39 +0,0 @@
|
||||
From 28b73b8bcb7f010f3d7ff026056d1284b6172e8c Mon Sep 17 00:00:00 2001
|
||||
From: Ludovic Beliveau <ludovic.beliveau@windriver.com>
|
||||
Date: Tue, 29 Mar 2016 19:51:01 -0400
|
||||
Subject: [PATCH] STX: Fixed default libvirtd systemd service
|
||||
|
||||
- 'Restart=no' (pmond will monitor the process)
|
||||
- 'PIDFile=/var/run/libvirtd.pid' (pmond uses the pidfile to monitor the
|
||||
processes)
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
src/remote/libvirtd.service.in | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
|
||||
index cc0d4e369..19e9526a5 100644
|
||||
--- a/src/remote/libvirtd.service.in
|
||||
+++ b/src/remote/libvirtd.service.in
|
||||
@@ -32,7 +32,7 @@ EnvironmentFile=-@sysconfdir@/sysconfig/libvirtd
|
||||
ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
KillMode=process
|
||||
-Restart=on-failure
|
||||
+Restart=no
|
||||
# At least 1 FD per guest, often 2 (eg qemu monitor + qemu agent).
|
||||
# eg if we want to support 4096 guests, we'll typically need 8192 FDs
|
||||
# If changing this, also consider virtlogd.service & virtlockd.service
|
||||
@@ -49,6 +49,7 @@ TasksMax=32768
|
||||
# with program takes 12k per guest. After rounding up we will get 64M to
|
||||
# support 4096 guests.
|
||||
LimitMEMLOCK=64M
|
||||
+PIDFile=/var/run/libvirtd.pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,27 +0,0 @@
|
||||
From d8b544aca712c9a84839100a6d61506fc0f7a16e Mon Sep 17 00:00:00 2001
|
||||
From: Don Penney <don.penney@windriver.com>
|
||||
Date: Sun, 2 Oct 2016 18:12:51 -0400
|
||||
Subject: [PATCH] STX: Adding systemd dependencies against pmon.service
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
[ Trimmed the shortlog ]
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
src/remote/libvirtd.service.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
|
||||
index 19e9526a5..b12bad4d9 100644
|
||||
--- a/src/remote/libvirtd.service.in
|
||||
+++ b/src/remote/libvirtd.service.in
|
||||
@@ -21,6 +21,7 @@ After=local-fs.target
|
||||
After=remote-fs.target
|
||||
After=systemd-logind.service
|
||||
After=systemd-machined.service
|
||||
+Before=pmon.service
|
||||
After=xencommons.service
|
||||
Conflicts=xendomains.service
|
||||
Documentation=man:libvirtd(8)
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,35 +0,0 @@
|
||||
From dedd074269d21f5eb5114705baac1ae43a166e8a Mon Sep 17 00:00:00 2001
|
||||
From: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Date: Tue, 19 Dec 2017 16:50:34 -0500
|
||||
Subject: [PATCH] STX: Stop processing memory stats if balloon fails
|
||||
|
||||
We were seeing deadlock on the second query because the VM
|
||||
had already been destroyed. In that case, the first query
|
||||
fails but unfortunately we ignore the return code and charge
|
||||
ahead anyway and do the second query which then hangs. We
|
||||
now respect the return code if it indicates failure on the
|
||||
first query.
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
[ Trimmed the shortlog ]
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
src/qemu/qemu_monitor_json.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
|
||||
index 8a75a2734..d2a21ebbd 100644
|
||||
--- a/src/qemu/qemu_monitor_json.c
|
||||
+++ b/src/qemu/qemu_monitor_json.c
|
||||
@@ -2260,6 +2260,8 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
|
||||
int got = 0;
|
||||
|
||||
ret = qemuMonitorJSONGetBalloonInfo(mon, &mem);
|
||||
+ if (ret < 0)
|
||||
+ goto cleanup;
|
||||
if (ret == 1 && (got < nr_stats)) {
|
||||
stats[got].tag = VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON;
|
||||
stats[got].val = mem;
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,38 +0,0 @@
|
||||
From c49366803061c7fdac854cee5920bc91ce3552ba Mon Sep 17 00:00:00 2001
|
||||
From: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Date: Fri, 2 Feb 2018 13:20:24 -0500
|
||||
Subject: [PATCH] STX: Increase timeout for connecting to monitor
|
||||
|
||||
When launching a large number of VMs concurrently on a
|
||||
single host, eg. 10, it can take a while
|
||||
for them to zero memory and attach to the monitor. After
|
||||
measuring many such delays in this concurrent launch
|
||||
stress test, we conclude that an extra minute
|
||||
of waiting should suffice.
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
src/qemu/qemu_process.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
||||
index 202d86728..6dae07215 100644
|
||||
--- a/src/qemu/qemu_process.c
|
||||
+++ b/src/qemu/qemu_process.c
|
||||
@@ -2024,6 +2024,12 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob,
|
||||
* 1GiB of guest RAM. */
|
||||
timeout = vm->def->mem.total_memory / (1024 * 1024);
|
||||
|
||||
+ /* STX: When launching a number of large VMs concurrently on
|
||||
+ * a single host, the above timeout may not be good enough.
|
||||
+ * Pad the timeout to deal with delays seen under stress testing.
|
||||
+ */
|
||||
+ timeout = timeout + 60; /* Wait for a full extra minute */
|
||||
+
|
||||
ignore_value(virTimeMillisNow(&priv->monStart));
|
||||
|
||||
mon = qemuMonitorOpen(vm,
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,163 +0,0 @@
|
||||
From 0d92d8a0f0b53c32490ce9623e1a402eb369a7d4 Mon Sep 17 00:00:00 2001
|
||||
From: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Date: Sun, 25 Feb 2018 11:32:54 -0500
|
||||
Subject: [PATCH] STX: pci-sriov perform limited retry on netlink
|
||||
|
||||
We now also perform retries on other netlink errors that previously
|
||||
would have just done an immediate bailout.
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
[ Trimmed shortlog ]
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
src/util/virnetdev.c | 100 +++++++++++++++++++++++++++----------------
|
||||
1 file changed, 62 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
|
||||
index a73e5f72f..f787b4919 100644
|
||||
--- a/src/util/virnetdev.c
|
||||
+++ b/src/util/virnetdev.c
|
||||
@@ -36,6 +36,7 @@
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
+#include <time.h>
|
||||
|
||||
#ifdef __linux__
|
||||
# include <linux/sockios.h>
|
||||
@@ -1533,6 +1534,8 @@ static struct nla_policy ifla_vfstats_policy[IFLA_VF_STATS_MAX+1] = {
|
||||
[IFLA_VF_STATS_MULTICAST] = { .type = NLA_U64 },
|
||||
};
|
||||
|
||||
+#define VIR_NET_DEV_NUM_RETRY 3
|
||||
+#define VIR_NET_DEV_DELAY_NS 250000000
|
||||
|
||||
static int
|
||||
virNetDevSetVfConfig(const char *ifname, int vf,
|
||||
@@ -1540,6 +1543,7 @@ virNetDevSetVfConfig(const char *ifname, int vf,
|
||||
bool *allowRetry)
|
||||
{
|
||||
int rc = -1;
|
||||
+ int i;
|
||||
char macstr[VIR_MAC_STRING_BUFLEN];
|
||||
g_autofree struct nlmsghdr *resp = NULL;
|
||||
struct nlmsgerr *err;
|
||||
@@ -1602,50 +1606,53 @@ virNetDevSetVfConfig(const char *ifname, int vf,
|
||||
nla_nest_end(nl_msg, vfinfo);
|
||||
nla_nest_end(nl_msg, vfinfolist);
|
||||
|
||||
- if (virNetlinkCommand(nl_msg, &resp, &recvbuflen, 0, 0,
|
||||
- NETLINK_ROUTE, 0) < 0)
|
||||
- goto cleanup;
|
||||
-
|
||||
- if (recvbuflen < NLMSG_LENGTH(0) || resp == NULL)
|
||||
- goto malformed_resp;
|
||||
+ for (i=0; i<VIR_NET_DEV_NUM_RETRY; i++) {
|
||||
+ if (virNetlinkCommand(nl_msg, &resp, &recvbuflen, 0, 0,
|
||||
+ NETLINK_ROUTE, 0) < 0)
|
||||
+ goto cleanup;
|
||||
|
||||
- switch (resp->nlmsg_type) {
|
||||
- case NLMSG_ERROR:
|
||||
- err = (struct nlmsgerr *)NLMSG_DATA(resp);
|
||||
- if (resp->nlmsg_len < NLMSG_LENGTH(sizeof(*err)))
|
||||
+ if (recvbuflen < NLMSG_LENGTH(0) || resp == NULL)
|
||||
goto malformed_resp;
|
||||
|
||||
- /* if allowRetry is true and the error was EINVAL, then
|
||||
- * silently return a failure so the caller can retry with a
|
||||
- * different MAC address
|
||||
- */
|
||||
- if (err->error == -EINVAL && *allowRetry &&
|
||||
- macaddr && !virMacAddrCmp(macaddr, &zeroMAC)) {
|
||||
- goto cleanup;
|
||||
- } else if (err->error) {
|
||||
- /* other errors are permanent */
|
||||
- virReportSystemError(-err->error,
|
||||
- _("Cannot set interface MAC/vlanid to %s/%d "
|
||||
- "for ifname %s vf %d"),
|
||||
- (macaddr
|
||||
- ? virMacAddrFormat(macaddr, macstr)
|
||||
- : "(unchanged)"),
|
||||
- vlanid,
|
||||
- ifname ? ifname : "(unspecified)",
|
||||
- vf);
|
||||
- *allowRetry = false; /* no use retrying */
|
||||
- goto cleanup;
|
||||
- }
|
||||
- break;
|
||||
+ switch (resp->nlmsg_type) {
|
||||
+ case NLMSG_ERROR:
|
||||
+ err = (struct nlmsgerr *)NLMSG_DATA(resp);
|
||||
+ if (resp->nlmsg_len < NLMSG_LENGTH(sizeof(*err)))
|
||||
+ goto malformed_resp;
|
||||
|
||||
- case NLMSG_DONE:
|
||||
- break;
|
||||
+ /* if allowRetry is true and the error was EINVAL, then
|
||||
+ * silently return a failure so the caller can retry with a
|
||||
+ * different MAC address
|
||||
+ */
|
||||
+ if (err->error == -EINVAL && *allowRetry &&
|
||||
+ macaddr && !virMacAddrCmp(macaddr, &zeroMAC)) {
|
||||
+ goto cleanup;
|
||||
+ } else if (err->error) {
|
||||
+ /* other errors are permanent */
|
||||
+ virReportSystemError(-err->error,
|
||||
+ _("Cannot set interface MAC/vlanid to %s/%d "
|
||||
+ "for ifname %s vf %d"),
|
||||
+ (macaddr
|
||||
+ ? virMacAddrFormat(macaddr, macstr)
|
||||
+ : "(unchanged)"),
|
||||
+ vlanid,
|
||||
+ ifname ? ifname : "(unspecified)",
|
||||
+ vf);
|
||||
+ *allowRetry = false; /* no use retrying */
|
||||
+ /* STX: but we do attempt local retry here within this procedure
|
||||
+ * goto cleanup; */
|
||||
+ goto retry;
|
||||
+ }
|
||||
+ break;
|
||||
|
||||
- default:
|
||||
- goto malformed_resp;
|
||||
- }
|
||||
+ case NLMSG_DONE:
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ goto malformed_resp;
|
||||
+ }
|
||||
|
||||
- rc = 0;
|
||||
+ rc = 0;
|
||||
cleanup:
|
||||
VIR_DEBUG("RTM_SETLINK %s vf %d MAC=%s vlanid=%d - %s",
|
||||
ifname, vf,
|
||||
@@ -1664,6 +1671,23 @@ virNetDevSetVfConfig(const char *ifname, int vf,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("allocated netlink buffer is too small"));
|
||||
goto cleanup;
|
||||
+
|
||||
+ /*STX: local retry logic*/
|
||||
+ retry:
|
||||
+ VIR_ERROR(_("Retry: %u"), i);
|
||||
+ {
|
||||
+ static struct timespec delay = {
|
||||
+ .tv_sec = 0,
|
||||
+ .tv_nsec = VIR_NET_DEV_DELAY_NS };
|
||||
+
|
||||
+ if (nanosleep(&delay, NULL) < 0) {
|
||||
+ virReportSystemError(errno, "%s", _("Failed to sleep"));
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ } /* End of local retry loop */
|
||||
+ goto cleanup; /* we exhausted our local retries */
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,9 +0,0 @@
|
||||
0001-STX-CPU-pinning-not-working-over-live-migration.patch
|
||||
0002-STX-System-Logging-set-group-read-permission-on-log.patch
|
||||
0003-STX-Drop-migration-poll-times-to-10mS.patch
|
||||
0004-STX-DPDK-parms-handling.patch
|
||||
0005-STX-Fixed-default-libvirtd-systemd-service.patch
|
||||
0006-STX-Adding-systemd-dependencies-against-pmon.service.patch
|
||||
0007-STX-Stop-processing-memory-stats-if-balloon-info.patch
|
||||
0008-STX-Increase-timeout-for-connecting-to-monitor.patch
|
||||
0009-STX-pci-sriov-perform-limited-retry-on-netlink.patch
|
@ -1,2 +0,0 @@
|
||||
BUILDER=docker
|
||||
LABEL=stx-libvirt
|
@ -1,70 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2019 Wind River Systems, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# This script logs to user.log
|
||||
#
|
||||
# The script is called with the following parameters
|
||||
# e.g. /etc/libvirt/hooks/qemu <guest_name> <operation>
|
||||
#
|
||||
|
||||
# Save the instance's XML. The guest qemu hook scrips are given the full XML description
|
||||
# on their stdin.
|
||||
XML_DATA=$(/bin/cat)
|
||||
|
||||
GUEST_NAME=$1
|
||||
|
||||
shift
|
||||
OPERATION=$*
|
||||
|
||||
logger -p info -t ${0} "hook qemu file guest ${GUEST_NAME} with operation ${OPERATION}"
|
||||
|
||||
# CPU Low latency setup:
|
||||
#
|
||||
# A cpu is set to low latency when:
|
||||
# 1) host is set to subfunction=lowlatency in platform.conf and
|
||||
# 2) domain has dedicated pinning
|
||||
#
|
||||
# example of <cputune> section when domain has dedicated pinning:
|
||||
# <cputune>
|
||||
# <vcpupin vcpu='0' cpuset='5'/>
|
||||
# <vcpupin vcpu='1' cpuset='6'/>
|
||||
# <vcpupin vcpu='2' cpuset='7'/>
|
||||
# <emulatorpin cpuset='5'/>
|
||||
# </cputune>
|
||||
#
|
||||
# example of <cputune> section when domain has shared pinning:
|
||||
# <cputune>
|
||||
# <shares>4096</shares>
|
||||
# <vcpupin vcpu='0' cpuset='5-21'/>
|
||||
# <vcpupin vcpu='1' cpuset='5-21'/>
|
||||
# <vcpupin vcpu='2' cpuset='5-21'/>
|
||||
# <vcpupin vcpu='3' cpuset='5-21'/>
|
||||
# <emulatorpin cpuset='5-21'/>
|
||||
# </cputune>
|
||||
|
||||
if [ "${OPERATION}" == "prepare begin -" ] || [ "${OPERATION}" == "stopped end -" ]; then
|
||||
# verify this host is set as lowlatency
|
||||
lowlat=$(cat /etc/platform/platform.conf 2>/dev/null | grep -E 'subfunction.*lowlatency')
|
||||
if [ -n "${lowlat}" ]; then
|
||||
# grab the <cputune> settings and remove single quotes
|
||||
CPUTUNE=$(echo ${XML_DATA} | grep -oP '(?<=<cputune).*?(?=</cputune>)' | sed "s/'//g")
|
||||
|
||||
# grab all cpuset pinned to a unique CPU. Treat them as dedicated
|
||||
CPUSET=($(echo ${CPUTUNE} | grep -oP '(?<=cpuset=)[^/]+(?=.+emulator)' | grep -vP '[^0-9]'))
|
||||
if [ ${#CPUSET[@]} -ne 0 ]; then
|
||||
# convert to a comma separated list
|
||||
CPUS=$(IFS=, ; echo "${CPUSET[*]}")
|
||||
if [ "${OPERATION}" == "prepare begin -" ]; then
|
||||
/usr/bin/set-cpu-wakeup-latency.sh "low" "${CPUS}"
|
||||
else
|
||||
/usr/bin/set-cpu-wakeup-latency.sh "high" "${CPUS}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@ -1,14 +0,0 @@
|
||||
/var/log/libvirt/libvirtd.log
|
||||
{
|
||||
nodateext
|
||||
size 10M
|
||||
start 1
|
||||
rotate 20
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
sharedscripts
|
||||
postrotate
|
||||
/etc/init.d/syslog reload > /dev/null 2>&1 || true
|
||||
endscript
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
/var/log/libvirt/lxc/*.log
|
||||
{
|
||||
nodateext
|
||||
size 10M
|
||||
start 1
|
||||
rotate 20
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
sharedscripts
|
||||
postrotate
|
||||
/etc/init.d/syslog reload > /dev/null 2>&1 || true
|
||||
endscript
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
/var/log/libvirt/qemu/*.log
|
||||
{
|
||||
nodateext
|
||||
size 10M
|
||||
start 1
|
||||
rotate 4
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
sharedscripts
|
||||
postrotate
|
||||
/etc/init.d/syslog reload > /dev/null 2>&1 || true
|
||||
endscript
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
/var/log/libvirt/uml/*.log
|
||||
{
|
||||
nodateext
|
||||
size 10M
|
||||
start 1
|
||||
rotate 4
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
sharedscripts
|
||||
postrotate
|
||||
/etc/init.d/syslog reload > /dev/null 2>&1 || true
|
||||
endscript
|
||||
}
|
||||
|
6
virt/qemu/.gitignore
vendored
6
virt/qemu/.gitignore
vendored
@ -1,6 +0,0 @@
|
||||
!.distro
|
||||
.distro/centos7/rpmbuild/RPMS
|
||||
.distro/centos7/rpmbuild/SRPMS
|
||||
.distro/centos7/rpmbuild/BUILD
|
||||
.distro/centos7/rpmbuild/BUILDROOT
|
||||
.distro/centos7/rpmbuild/SOURCES/qemu*tar.gz
|
@ -1,19 +0,0 @@
|
||||
Metadata-Version: 1.1
|
||||
Name: qemu
|
||||
Version: 2.3.0
|
||||
Summary: QEMU is a FAST! processor emulator
|
||||
Home-page:
|
||||
Author: Windriver
|
||||
Author-email: info@windriver.com
|
||||
License: Apache-2.0
|
||||
|
||||
Description:
|
||||
qemu-kvm is an open source virtualizer that provides hardware emulation for
|
||||
the KVM hypervisor. qemu-kvm acts as a virtual machine monitor together with
|
||||
the KVM kernel modules, and emulates the hardware for a full system such as
|
||||
a PC and its assocated peripherals.
|
||||
|
||||
As qemu-kvm requires no host kernel patches to run, it is safe and easy to use.
|
||||
|
||||
|
||||
Platform: UNKNOWN
|
@ -1,17 +0,0 @@
|
||||
Get the RedHat source rpm from:
|
||||
$ wget wget http://cbs.centos.org/kojifiles/packages/qemu-kvm-ev/2.3.0/31.el7_2.7.1/src/qemu-kvm-ev-2.3.0-31.el7_2.7.1.src.rpm
|
||||
|
||||
Uncompress the source rpm:
|
||||
$ rpm2cpio qemu-kvm-ev-2.3.0-31.el7_2.7.1.src.rpm | cpio -idmv
|
||||
|
||||
All the patches from the redhat source rpm have been applied in git/qemu using
|
||||
scripts/autopatch.sh.
|
||||
|
||||
Some of these patches can't be applied cleanly with 'git am'. So this script
|
||||
attempd to execute 'git am' on each of them, if it fails it tries to patch
|
||||
the files manually with 'git apply --index'.
|
||||
|
||||
A git tag 'qemu-kvm-ev-2.3.0-31.el7_2.7.1' has been added to the last patch
|
||||
applied.
|
||||
|
||||
The Titanium Cloud specific patches will be added after this tag.
|
@ -1,11 +0,0 @@
|
||||
SRC_DIR="$CGCS_BASE/git/qemu"
|
||||
COPY_LIST="$CGCS_BASE/downloads/kvm-unit-tests.git-4ea7633.tar.bz2 \
|
||||
$CGCS_BASE/downloads/keycodemapdb-16e5b07.tar.gz \
|
||||
$FILES_BASE/* \
|
||||
$PKG_BASE/qemu/qemu_clean \
|
||||
$PKG_BASE/qemu/qemu_clean.service \
|
||||
$PKG_BASE/qemu/qemu-system-x86.conf"
|
||||
TIS_BASE_SRCREV=38441756b70eec5807b5f60dad11a93a91199866
|
||||
TIS_PATCH_VER=GITREVCOUNT+PKG_GITREVCOUNT
|
||||
|
||||
BUILD_IS_BIG=6
|
@ -1 +0,0 @@
|
||||
KERNEL=="kvm", GROUP="kvm", MODE="0666"
|
@ -1,5 +0,0 @@
|
||||
# Enable kvm-setup by default. This can have odd side effects on
|
||||
# PowerNV systems that aren't intended as KVM hosts, but at present we
|
||||
# only support RHEL on PowerNV for the purpose of being a RHEV host.
|
||||
|
||||
enable kvm-setup.service
|
@ -1,10 +0,0 @@
|
||||
# The KVM HV implementation on Power can require a significant amount
|
||||
# of unswappable memory (about half of which also needs to be host
|
||||
# physically contiguous) to hold the guest's Hash Page Table (HPT) -
|
||||
# roughly 1/64th of the guest's RAM size, minimum 16MiB.
|
||||
#
|
||||
# These limits allow unprivileged users to start smallish VMs, such as
|
||||
# those used by libguestfs.
|
||||
#
|
||||
* hard memlock 65536
|
||||
* soft memlock 65536
|
@ -1,2 +0,0 @@
|
||||
SUBSYSTEM=="virtio-ports", ATTR{name}=="org.qemu.guest_agent.0", \
|
||||
TAG+="systemd" ENV{SYSTEMD_WANTS}="qemu-guest-agent.service"
|
@ -1,9 +0,0 @@
|
||||
The ROM images on /usr/share/qemu-kvm/rhel6-*.rom come from the
|
||||
Red Hat Enterprise Linux 6.4 package gpxe-roms-qemu-0.9.7-6.9.el6.noarch.rpm.
|
||||
|
||||
The source code for those images can be downloaded from:
|
||||
http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/gpxe-0.9.7-6.9.el6.src.rpm
|
||||
|
||||
For more information on how to obtain source code for Red Hat Enterprise Linux
|
||||
software, you can refer to Chapter 1. Obtaining Red Hat Enterprise Linux of the
|
||||
Red Hat Enterprise Linux Installation Guide.
|
Binary file not shown.
@ -1 +0,0 @@
|
||||
allow virbr0
|
@ -1,117 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
_prefix=$1
|
||||
shift
|
||||
_libdir=$1
|
||||
shift
|
||||
_sysconfdir=$1
|
||||
shift
|
||||
_localstatedir=$1
|
||||
shift
|
||||
_libexecdir=$1
|
||||
shift
|
||||
pkgname=$1
|
||||
shift
|
||||
arch=$1
|
||||
shift
|
||||
nvr=$1
|
||||
shift
|
||||
optflags=$1
|
||||
shift
|
||||
have_fdt=$1
|
||||
shift
|
||||
have_gluster=$1
|
||||
shift
|
||||
have_guest_agent=$1
|
||||
shift
|
||||
have_numa=$1
|
||||
shift
|
||||
have_rbd=$1
|
||||
shift
|
||||
have_rdma=$1
|
||||
shift
|
||||
have_seccomp=$1
|
||||
shift
|
||||
have_spice=$1
|
||||
shift
|
||||
have_usbredir=$1
|
||||
shift
|
||||
have_tcmalloc=$1
|
||||
shift
|
||||
|
||||
|
||||
if [ "$have_rbd" == "enable" ]; then
|
||||
rbd_driver=rbd,
|
||||
fi
|
||||
|
||||
if [ "$have_gluster" == "enable" ]; then
|
||||
gluster_driver=gluster,
|
||||
fi
|
||||
|
||||
./configure \
|
||||
--prefix=${_prefix} \
|
||||
--libdir=${_libdir} \
|
||||
--sysconfdir=${_sysconfdir} \
|
||||
--interp-prefix=${_prefix}/qemu-%M \
|
||||
--localstatedir=${_localstatedir} \
|
||||
--libexecdir=${_libexecdir} \
|
||||
--extra-ldflags="$extraldflags -pie -Wl,-z,relro -Wl,-z,now" \
|
||||
--extra-cflags="${optflags} -fPIE -DPIE -O2" \
|
||||
--with-pkgversion=${nvr} \
|
||||
--with-confsuffix=/${pkgname} \
|
||||
--with-coroutine=ucontext \
|
||||
--disable-bluez \
|
||||
--disable-brlapi \
|
||||
--enable-cap-ng \
|
||||
--enable-coroutine-pool \
|
||||
--disable-curl \
|
||||
--enable-curses \
|
||||
--disable-debug-tcg \
|
||||
--enable-docs \
|
||||
--disable-gtk \
|
||||
--enable-kvm \
|
||||
--disable-libiscsi \
|
||||
--disable-libnfs \
|
||||
--disable-libssh2 \
|
||||
--disable-libusb \
|
||||
--disable-bzip2 \
|
||||
--enable-linux-aio \
|
||||
--enable-live-block-migration \
|
||||
--disable-lzo \
|
||||
--disable-opengl \
|
||||
--enable-pie \
|
||||
--disable-qom-cast-debug \
|
||||
--disable-sdl \
|
||||
--enable-snappy \
|
||||
--disable-sparse \
|
||||
--disable-strip \
|
||||
--enable-tpm \
|
||||
--enable-trace-backend=nop \
|
||||
--disable-uuid \
|
||||
--disable-vde \
|
||||
--disable-vhdx \
|
||||
--disable-vhost-scsi \
|
||||
--enable-vhost-net \
|
||||
--enable-virtfs \
|
||||
--disable-vnc-jpeg \
|
||||
--disable-vnc-png \
|
||||
--disable-vnc-sasl \
|
||||
--disable-vte \
|
||||
--enable-werror \
|
||||
--disable-xen \
|
||||
--disable-xfsctl \
|
||||
--enable-attr \
|
||||
--${have_fdt}-fdt \
|
||||
--${have_gluster}-glusterfs \
|
||||
--${have_guest_agent}-guest-agent \
|
||||
--${have_numa}-numa \
|
||||
--${have_rbd}-rbd \
|
||||
--${have_rdma}-rdma \
|
||||
--${have_seccomp}-seccomp \
|
||||
--${have_spice}-spice \
|
||||
--${have_usbredir}-usb-redir \
|
||||
--${have_tcmalloc}-tcmalloc \
|
||||
--audio-drv-list=pa,alsa \
|
||||
--block-drv-rw-whitelist=qcow2,raw,file,host_device,nbd,iscsi,${gluster_driver}${rbd_driver}blkdebug \
|
||||
--block-drv-ro-whitelist=vmdk,vhdx,vpc,https,ssh \
|
||||
"$@"
|
@ -1,13 +0,0 @@
|
||||
[Unit]
|
||||
Description=Kernel Samepage Merging
|
||||
ConditionPathExists=/sys/kernel/mm/ksm
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/sysconfig/ksm
|
||||
ExecStart=/usr/libexec/ksmctl start
|
||||
ExecStop=/usr/libexec/ksmctl stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,4 +0,0 @@
|
||||
# The maximum number of unswappable kernel pages
|
||||
# which may be allocated by ksm (0 for unlimited)
|
||||
# If unset, defaults to half of total memory
|
||||
# KSM_MAX_KERNEL_PAGES=
|
@ -1,77 +0,0 @@
|
||||
/* Start/stop KSM, for systemd.
|
||||
* Copyright (C) 2009, 2011 Red Hat, Inc.
|
||||
* Written by Paolo Bonzini <pbonzini@redhat.com>.
|
||||
* Based on the original sysvinit script by Dan Kenigsberg <danken@redhat.com>
|
||||
* This file is distributed under the GNU General Public License, version 2
|
||||
* or later. */
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define KSM_MAX_KERNEL_PAGES_FILE "/sys/kernel/mm/ksm/max_kernel_pages"
|
||||
#define KSM_RUN_FILE "/sys/kernel/mm/ksm/run"
|
||||
|
||||
char *program_name;
|
||||
|
||||
int usage(void)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s {start|stop}\n", program_name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int write_value(uint64_t value, char *filename)
|
||||
{
|
||||
FILE *fp;
|
||||
if (!(fp = fopen(filename, "w")) ||
|
||||
fprintf(fp, "%llu\n", (unsigned long long) value) == EOF ||
|
||||
fflush(fp) == EOF ||
|
||||
fclose(fp) == EOF)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t ksm_max_kernel_pages()
|
||||
{
|
||||
char *var = getenv("KSM_MAX_KERNEL_PAGES");
|
||||
char *endptr;
|
||||
uint64_t value;
|
||||
if (var && *var) {
|
||||
value = strtoll(var, &endptr, 0);
|
||||
if (value < LLONG_MAX && !*endptr)
|
||||
return value;
|
||||
}
|
||||
/* Unless KSM_MAX_KERNEL_PAGES is set, let KSM munch up to half of
|
||||
* total memory. */
|
||||
return sysconf(_SC_PHYS_PAGES) / 2;
|
||||
}
|
||||
|
||||
int start(void)
|
||||
{
|
||||
if (access(KSM_MAX_KERNEL_PAGES_FILE, R_OK) >= 0)
|
||||
write_value(ksm_max_kernel_pages(), KSM_MAX_KERNEL_PAGES_FILE);
|
||||
return write_value(1, KSM_RUN_FILE);
|
||||
}
|
||||
|
||||
int stop(void)
|
||||
{
|
||||
return write_value(0, KSM_RUN_FILE);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
program_name = argv[0];
|
||||
if (argc < 2) {
|
||||
return usage();
|
||||
} else if (!strcmp(argv[1], "start")) {
|
||||
return start();
|
||||
} else if (!strcmp(argv[1], "stop")) {
|
||||
return stop();
|
||||
} else {
|
||||
return usage();
|
||||
}
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2009 Red Hat, Inc. and/or its affiliates.
|
||||
# Released under the GPL
|
||||
#
|
||||
# Author: Dan Kenigsberg <danken@redhat.com>
|
||||
#
|
||||
# ksmtuned - a simple script that controls whether (and with what vigor) ksm
|
||||
# should search for duplicated pages.
|
||||
#
|
||||
# starts ksm when memory commited to qemu processes exceeds a threshold, and
|
||||
# make ksm work harder and harder untill memory load falls below that
|
||||
# threshold.
|
||||
#
|
||||
# send SIGUSR1 to this process right after a new qemu process is started, or
|
||||
# following its death, to retune ksm accordingly
|
||||
#
|
||||
# needs testing and ironing. contact danken@redhat.com if something breaks.
|
||||
|
||||
if [ -f /etc/ksmtuned.conf ]; then
|
||||
. /etc/ksmtuned.conf
|
||||
fi
|
||||
|
||||
debug() {
|
||||
if [ -n "$DEBUG" ]; then
|
||||
s="`/bin/date`: $*"
|
||||
[ -n "$LOGFILE" ] && echo "$s" >> "$LOGFILE" || echo "$s"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
KSM_MONITOR_INTERVAL=${KSM_MONITOR_INTERVAL:-60}
|
||||
KSM_NPAGES_BOOST=${KSM_NPAGES_BOOST:-300}
|
||||
KSM_NPAGES_DECAY=${KSM_NPAGES_DECAY:--50}
|
||||
|
||||
KSM_NPAGES_MIN=${KSM_NPAGES_MIN:-64}
|
||||
KSM_NPAGES_MAX=${KSM_NPAGES_MAX:-1250}
|
||||
# millisecond sleep between ksm scans for 16Gb server. Smaller servers sleep
|
||||
# more, bigger sleep less.
|
||||
KSM_SLEEP_MSEC=${KSM_SLEEP_MSEC:-10}
|
||||
|
||||
KSM_THRES_COEF=${KSM_THRES_COEF:-20}
|
||||
KSM_THRES_CONST=${KSM_THRES_CONST:-2048}
|
||||
|
||||
total=`awk '/^MemTotal:/ {print $2}' /proc/meminfo`
|
||||
debug total $total
|
||||
|
||||
npages=0
|
||||
sleep=$[KSM_SLEEP_MSEC * 16 * 1024 * 1024 / total]
|
||||
[ $sleep -le 10 ] && sleep=10
|
||||
debug sleep $sleep
|
||||
thres=$[total * KSM_THRES_COEF / 100]
|
||||
if [ $KSM_THRES_CONST -gt $thres ]; then
|
||||
thres=$KSM_THRES_CONST
|
||||
fi
|
||||
debug thres $thres
|
||||
|
||||
KSMCTL () {
|
||||
case x$1 in
|
||||
xstop)
|
||||
echo 0 > /sys/kernel/mm/ksm/run
|
||||
;;
|
||||
xstart)
|
||||
echo $2 > /sys/kernel/mm/ksm/pages_to_scan
|
||||
echo $3 > /sys/kernel/mm/ksm/sleep_millisecs
|
||||
echo 1 > /sys/kernel/mm/ksm/run
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
committed_memory () {
|
||||
local pidlist
|
||||
pidlist=$(pgrep -d ' ' -- '^qemu(-kvm|:.{1,11})$')
|
||||
if [ -n "$pidlist" ]; then
|
||||
ps -p "$pidlist" -o rsz=
|
||||
fi | awk '{ sum += $1 }; END { print 0+sum }'
|
||||
}
|
||||
|
||||
free_memory () {
|
||||
awk '/^(MemFree|Buffers|Cached):/ {free += $2}; END {print free}' \
|
||||
/proc/meminfo
|
||||
}
|
||||
|
||||
increase_npages() {
|
||||
local delta
|
||||
delta=${1:-0}
|
||||
npages=$[npages + delta]
|
||||
if [ $npages -lt $KSM_NPAGES_MIN ]; then
|
||||
npages=$KSM_NPAGES_MIN
|
||||
elif [ $npages -gt $KSM_NPAGES_MAX ]; then
|
||||
npages=$KSM_NPAGES_MAX
|
||||
fi
|
||||
echo $npages
|
||||
}
|
||||
|
||||
|
||||
adjust () {
|
||||
local free committed
|
||||
free=`free_memory`
|
||||
committed=`committed_memory`
|
||||
debug committed $committed free $free
|
||||
if [ $[committed + thres] -lt $total -a $free -gt $thres ]; then
|
||||
KSMCTL stop
|
||||
debug "$[committed + thres] < $total and free > $thres, stop ksm"
|
||||
return 1
|
||||
fi
|
||||
debug "$[committed + thres] > $total, start ksm"
|
||||
if [ $free -lt $thres ]; then
|
||||
npages=`increase_npages $KSM_NPAGES_BOOST`
|
||||
debug "$free < $thres, boost"
|
||||
else
|
||||
npages=`increase_npages $KSM_NPAGES_DECAY`
|
||||
debug "$free > $thres, decay"
|
||||
fi
|
||||
KSMCTL start $npages $sleep
|
||||
debug "KSMCTL start $npages $sleep"
|
||||
return 0
|
||||
}
|
||||
|
||||
function nothing () {
|
||||
:
|
||||
}
|
||||
|
||||
loop () {
|
||||
trap nothing SIGUSR1
|
||||
while true
|
||||
do
|
||||
sleep $KSM_MONITOR_INTERVAL &
|
||||
wait $!
|
||||
adjust
|
||||
done
|
||||
}
|
||||
|
||||
PIDFILE=${PIDFILE-/var/run/ksmtune.pid}
|
||||
if touch "$PIDFILE"; then
|
||||
loop &
|
||||
echo $! > "$PIDFILE"
|
||||
fi
|
@ -1,21 +0,0 @@
|
||||
# Configuration file for ksmtuned.
|
||||
|
||||
# How long ksmtuned should sleep between tuning adjustments
|
||||
# KSM_MONITOR_INTERVAL=60
|
||||
|
||||
# Millisecond sleep between ksm scans for 16Gb server.
|
||||
# Smaller servers sleep more, bigger sleep less.
|
||||
# KSM_SLEEP_MSEC=10
|
||||
|
||||
# KSM_NPAGES_BOOST=300
|
||||
# KSM_NPAGES_DECAY=-50
|
||||
# KSM_NPAGES_MIN=64
|
||||
# KSM_NPAGES_MAX=1250
|
||||
|
||||
# KSM_THRES_COEF=20
|
||||
# KSM_THRES_CONST=2048
|
||||
|
||||
# uncomment the following if you want ksmtuned debug info
|
||||
|
||||
# LOGFILE=/var/log/ksmtuned
|
||||
# DEBUG=1
|
@ -1,12 +0,0 @@
|
||||
[Unit]
|
||||
Description=Kernel Samepage Merging (KSM) Tuning Daemon
|
||||
After=ksm.service
|
||||
Requires=ksm.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/ksmtuned
|
||||
ExecReload=/bin/kill -USR1 $MAINPID
|
||||
Type=forking
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,31 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
kvm_setup_powerpc () {
|
||||
if grep '^platform[[:space:]]*:[[:space:]]*PowerNV' /proc/cpuinfo > /dev/null; then
|
||||
# PowerNV platform, which is KVM HV capable
|
||||
|
||||
if [ -z "$SUBCORES" ]; then
|
||||
SUBCORES=1
|
||||
fi
|
||||
|
||||
# Step 1. Load the KVM HVmodule
|
||||
if ! modprobe -b kvm_hv; then
|
||||
return
|
||||
fi
|
||||
|
||||
# Step 2. Configure subcore mode
|
||||
# FIXME: Should we check for POWER8 first?
|
||||
/usr/sbin/ppc64_cpu --subcores-per-core=$SUBCORES
|
||||
|
||||
# Step 3. Disable SMT (multithreading)
|
||||
/usr/sbin/ppc64_cpu --smt=off
|
||||
fi
|
||||
}
|
||||
|
||||
case $(uname -m) in
|
||||
ppc64|ppc64le)
|
||||
kvm_setup_powerpc
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Perform system configuration to prepare system to run KVM guests
|
||||
# Offlining CPUs can cause irqbalance to throw warnings if it's running
|
||||
Before=irqbalance.service
|
||||
# libvirtd reads CPU topology at startup, so change it before
|
||||
Before=libvirtd.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=-/etc/sysconfig/kvm
|
||||
ExecStart=/usr/lib/systemd/kvm-setup
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,12 +0,0 @@
|
||||
# Setting modprobe kvm_intel/kvm_amd nested = 1
|
||||
# only enables Nested Virtualization until the next reboot or
|
||||
# module reload. Uncomment the option applicable
|
||||
# to your system below to enable the feature permanently.
|
||||
#
|
||||
# User changes in this file are preserved across upgrades.
|
||||
#
|
||||
# For Intel
|
||||
#options kvm_intel nested=1
|
||||
#
|
||||
# For AMD
|
||||
#options kvm_amd nested=1
|
@ -1,19 +0,0 @@
|
||||
# This is a systemd environment file, not a shell script.
|
||||
# It provides settings for "/lib/systemd/system/qemu-guest-agent.service".
|
||||
|
||||
# Comma-separated blacklist of RPCs to disable, or empty list to enable all.
|
||||
#
|
||||
# You can get the list of RPC commands using "qemu-ga --blacklist='?'".
|
||||
# There should be no spaces between commas and commands in the blacklist.
|
||||
BLACKLIST_RPC=guest-file-open,guest-file-close,guest-file-read,guest-file-write,guest-file-seek,guest-file-flush
|
||||
|
||||
# Fsfreeze hook script specification.
|
||||
#
|
||||
# FSFREEZE_HOOK_PATHNAME=/dev/null : disables the feature.
|
||||
#
|
||||
# FSFREEZE_HOOK_PATHNAME=/path/to/executable : enables the feature with the
|
||||
# specified binary or shell script.
|
||||
#
|
||||
# FSFREEZE_HOOK_PATHNAME= : enables the feature with the
|
||||
# default value (invoke "qemu-ga --help" to interrogate).
|
||||
FSFREEZE_HOOK_PATHNAME=/etc/qemu-ga/fsfreeze-hook
|
@ -1,18 +0,0 @@
|
||||
[Unit]
|
||||
Description=QEMU Guest Agent
|
||||
BindsTo=dev-virtio\x2dports-org.qemu.guest_agent.0.device
|
||||
After=dev-virtio\x2dports-org.qemu.guest_agent.0.device
|
||||
|
||||
[Service]
|
||||
UMask=0077
|
||||
EnvironmentFile=/etc/sysconfig/qemu-ga
|
||||
ExecStart=/usr/bin/qemu-ga \
|
||||
--method=virtio-serial \
|
||||
--path=/dev/virtio-ports/org.qemu.guest_agent.0 \
|
||||
--blacklist=${BLACKLIST_RPC} \
|
||||
-F${FSFREEZE_HOOK_PATHNAME}
|
||||
StandardError=syslog
|
||||
Restart=always
|
||||
RestartSec=0
|
||||
|
||||
[Install]
|
@ -1,17 +0,0 @@
|
||||
:qemu-i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:
|
||||
:qemu-i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:
|
||||
:qemu-alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha:
|
||||
:qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:
|
||||
:qemu-armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:
|
||||
:qemu-sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc:
|
||||
:qemu-ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:
|
||||
:qemu-m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k:
|
||||
:qemu-mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips:
|
||||
:qemu-mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel:
|
||||
:qemu-mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32:
|
||||
:qemu-mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el:
|
||||
:qemu-mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64:
|
||||
:qemu-mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el:
|
||||
:qemu-sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:
|
||||
:qemu-sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:
|
||||
:qemu-s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x:
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
# Increase default vhost memory map limit to match
|
||||
# KVM's memory slot limit
|
||||
options vhost max_mem_regions=509
|
File diff suppressed because it is too large
Load Diff
@ -1,419 +0,0 @@
|
||||
From 33716964e8381628d575160b6a015a3f8ba68640 Mon Sep 17 00:00:00 2001
|
||||
From: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
Date: Fri, 18 Nov 2022 16:59:35 -0300
|
||||
Subject: [PATCH] Customize Debian build files for STX
|
||||
|
||||
Change the Debian build files to generate qemu Debian packages as
|
||||
they are needed for StarlingX qemu use case.
|
||||
Building the upstream qemu was taking ~30 minutes and generating
|
||||
an output directory with 30 packages and ~1.1G in size. Removing
|
||||
the unnecessary packages resulted in a build that takes ~15min and
|
||||
in an output directory with only 10 needed packages and ~320M.
|
||||
|
||||
We mainly remove UI/Graphical modules and focus on building
|
||||
qemu-system-x86 only. We do not need other qemu-system-* packages
|
||||
for different architectures neither the build dependencies for
|
||||
cross-compiling those packages.
|
||||
|
||||
Removed packages:
|
||||
* qemu-system-gui
|
||||
* qemu-system-[misc|arm|mips|ppc|sparc]
|
||||
* qemu-user
|
||||
* qemu-user-static
|
||||
* qemu-user-binftmt
|
||||
|
||||
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
|
||||
---
|
||||
debian/control | 215 +++----------------------------------------------
|
||||
debian/rules | 80 +-----------------
|
||||
2 files changed, 14 insertions(+), 281 deletions(-)
|
||||
|
||||
diff --git a/debian/control b/debian/control
|
||||
index 6534765..7cc0fb4 100644
|
||||
--- a/debian/control
|
||||
+++ b/debian/control
|
||||
@@ -21,14 +21,10 @@ Build-Depends: debhelper-compat (= 12),
|
||||
libcapstone-dev (>> 4.0.2~),
|
||||
# --enable-linux-aio linux-*
|
||||
libaio-dev [linux-any],
|
||||
-# --audio-drv-list=pa,alsa,oss linux-*
|
||||
-# --audio-drv-list=pa,oss kfreebsd-*
|
||||
- libpulse-dev,
|
||||
- libasound2-dev [linux-any],
|
||||
# for virtfs (now in libc6)
|
||||
# --enable-attr
|
||||
-# --enable-brlapi
|
||||
- libbrlapi-dev,
|
||||
+# --disable-brlapi
|
||||
+# libbrlapi-dev,
|
||||
# --enable-virtfs linux-*
|
||||
# needed for virtfs
|
||||
# --enable-cap-ng linux-*
|
||||
@@ -85,8 +81,8 @@ Build-Depends: debhelper-compat (= 12),
|
||||
# vde is debian-only since ubuntu/vde2 is in universe
|
||||
# --enable-vde
|
||||
libvdeplug-dev,
|
||||
-# --enable-xen linux-amd64|linux-i386
|
||||
- libxen-dev [linux-amd64 linux-i386],
|
||||
+# --disable-xen linux-amd64|linux-i386
|
||||
+# libxen-dev [linux-amd64 linux-i386],
|
||||
# --enable-nettle
|
||||
nettle-dev,
|
||||
## always enabled: --enable-uuid
|
||||
@@ -114,18 +110,18 @@ Build-Depends: debhelper-compat (= 12),
|
||||
## auth-pam - for auth for vnc&Co using PAM
|
||||
## gio-2.0 - for -display=spice-app
|
||||
Build-Depends-Indep:
|
||||
- gcc-s390x-linux-gnu,
|
||||
+# gcc-s390x-linux-gnu,
|
||||
# libc6.1-dev-alpha-cross isn't really needed but the code,
|
||||
# for whatever reason, #include's string.h which needs libc6.1-dev
|
||||
gcc-alpha-linux-gnu, libc6.1-dev-alpha-cross,
|
||||
# skiboot firmware, openbios
|
||||
- gcc-powerpc64-linux-gnu,
|
||||
+# gcc-powerpc64-linux-gnu,
|
||||
# openbios
|
||||
- gcc-sparc64-linux-gnu, fcode-utils, xsltproc,
|
||||
+# gcc-sparc64-linux-gnu, fcode-utils, xsltproc,
|
||||
# hppa-firmware
|
||||
- gcc-hppa-linux-gnu,
|
||||
+# gcc-hppa-linux-gnu,
|
||||
# opensbi
|
||||
- gcc-riscv64-linux-gnu,
|
||||
+# gcc-riscv64-linux-gnu,
|
||||
Build-Conflicts: oss4-dev
|
||||
Standards-Version: 4.5.1
|
||||
Homepage: http://www.qemu.org/
|
||||
@@ -218,141 +214,12 @@ Description: QEMU full system emulation binaries (common files)
|
||||
This package provides common files needed for target-specific
|
||||
full system emulation (qemu-system-*) packages.
|
||||
|
||||
-Package: qemu-system-gui
|
||||
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
-Multi-Arch: same
|
||||
-Depends: ${misc:Depends}, ${shlibs:Depends},
|
||||
- qemu-system-x86 (= ${binary:Version}) | qemu-system-arm (= ${binary:Version}) | qemu-system-mips (= ${binary:Version}) | qemu-system-ppc (= ${binary:Version}) | qemu-system-sparc (= ${binary:Version}) | qemu-system-misc (= ${binary:Version}) | qemu-system-s390x (= ${binary:Version}) | qemu-system-x86-xen (= ${binary:Version}),
|
||||
-Description: QEMU full system emulation binaries (user interface and audio support)
|
||||
- This package provides local graphical user interface (currently GTK)
|
||||
- and audio backends for full system emulation (qemu-system-*) packages.
|
||||
-
|
||||
-Package: qemu-system-misc
|
||||
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
-Multi-Arch: foreign
|
||||
-Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> ${source:Version}~), qemu-system-data (>> ${source:Version}~),
|
||||
-Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
|
||||
-# alpha uses vgabios
|
||||
-# alpha m68k sh4 uses bootroms
|
||||
- seabios, ipxe-qemu (>= 1.0.0+git-20131111.c3d1e78-1~)
|
||||
-Suggests: samba, vde2, qemu-block-extra (= ${binary:Version}),
|
||||
-Provides: ${sysprovides:misc}
|
||||
-Description: QEMU full system emulation binaries (miscellaneous)
|
||||
- QEMU is a fast processor emulator: currently the package supports
|
||||
- ARM, CRIS, M68k (ColdFire), MicroBlaze, and SH4
|
||||
- emulation. By using dynamic translation it achieves
|
||||
- reasonable speed while being easy to port on new host CPUs.
|
||||
- .
|
||||
- This package provides the full system emulation binaries to emulate
|
||||
- various other hardware which did not made into separate packages.
|
||||
- Emulators for the following architectures are provided:
|
||||
- ${sysarch:misc}.
|
||||
- .
|
||||
- In system emulation mode QEMU emulates a full system, including a processor
|
||||
- and various peripherals. It enables easier testing and debugging of system
|
||||
- code. It can also be used to provide virtual hosting of several virtual
|
||||
- machines on a single server.
|
||||
-
|
||||
-Package: qemu-system-arm
|
||||
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
-Multi-Arch: foreign
|
||||
-Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> ${source:Version}~), qemu-system-data (>> ${source:Version}~),
|
||||
-Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
|
||||
-# aarch64 arm uses bootroms
|
||||
- ipxe-qemu (>= 1.0.0+git-20131111.c3d1e78-1~),
|
||||
- qemu-efi-aarch64, qemu-efi-arm
|
||||
-Suggests: samba, vde2, qemu-block-extra (= ${binary:Version}),
|
||||
-Provides: qemu-kvm [linux-arm64 linux-armhf linux-armel], ${sysprovides:arm}
|
||||
-Breaks: qemu-kvm [linux-arm64 linux-armhf linux-armel]
|
||||
-Replaces: qemu-kvm [linux-arm64 linux-armhf linux-armel]
|
||||
-Description: QEMU full system emulation binaries (arm)
|
||||
- QEMU is a fast processor emulator: currently the package supports
|
||||
- ARM emulation. By using dynamic translation it achieves
|
||||
- reasonable speed while being easy to port on new host CPUs.
|
||||
- .
|
||||
- This package provides the full system emulation binaries to emulate
|
||||
- the following arm hardware: ${sysarch:arm}.
|
||||
- .
|
||||
- In system emulation mode QEMU emulates a full system, including a processor
|
||||
- and various peripherals. It enables easier testing and debugging of system
|
||||
- code. It can also be used to provide virtual hosting of several virtual
|
||||
- machines on a single server.
|
||||
-
|
||||
-Package: qemu-system-mips
|
||||
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
-Multi-Arch: foreign
|
||||
-Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> ${source:Version}~), qemu-system-data (>> ${source:Version}~),
|
||||
-Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
|
||||
-# all mips targets uses vgabios and bootroms
|
||||
- seabios, ipxe-qemu (>= 1.0.0+git-20131111.c3d1e78-1~)
|
||||
-Suggests: samba, vde2, qemu-block-extra (= ${binary:Version}),
|
||||
-Provides: ${sysprovides:mips}
|
||||
-Description: QEMU full system emulation binaries (mips)
|
||||
- QEMU is a fast processor emulator: currently the package supports
|
||||
- MIPS emulation. By using dynamic translation it achieves
|
||||
- reasonable speed while being easy to port on new host CPUs.
|
||||
- .
|
||||
- This package provides the full system emulation binaries to emulate
|
||||
- the following mips hardware: ${sysarch:mips}.
|
||||
- .
|
||||
- In system emulation mode QEMU emulates a full system, including a processor
|
||||
- and various peripherals. It enables easier testing and debugging of system
|
||||
- code. It can also be used to provide virtual hosting of several virtual
|
||||
- machines on a single server.
|
||||
-
|
||||
-Package: qemu-system-ppc
|
||||
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
-Multi-Arch: foreign
|
||||
-Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> ${source:Version}~), qemu-system-data (>> ${source:Version}~),
|
||||
-Suggests: samba, vde2, qemu-block-extra (= ${binary:Version}),
|
||||
-Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
|
||||
-# ppc targets use vgabios-stdvga and bootroms
|
||||
- seabios, ipxe-qemu (>= 1.0.0+git-20131111.c3d1e78-1~)
|
||||
-Provides: qemu-kvm [linux-ppc64 linux-ppc64el linux-powerpc], ${sysprovides:ppc}
|
||||
-Breaks: qemu-kvm [linux-ppc64 linux-ppc64el linux-powerpc]
|
||||
-Replaces: qemu-kvm [linux-ppc64 linux-ppc64el linux-powerpc]
|
||||
-Description: QEMU full system emulation binaries (ppc)
|
||||
- QEMU is a fast processor emulator: currently the package supports
|
||||
- PowerPC emulation. By using dynamic translation it achieves
|
||||
- reasonable speed while being easy to port on new host CPUs.
|
||||
- .
|
||||
- This package provides the full system emulation binaries to emulate
|
||||
- the following PowerPC hardware: ${sysarch:ppc}.
|
||||
- .
|
||||
- In system emulation mode QEMU emulates a full system, including a processor
|
||||
- and various peripherals. It enables easier testing and debugging of system
|
||||
- code. It can also be used to provide virtual hosting of several virtual
|
||||
- machines on a single server.
|
||||
-
|
||||
-Package: qemu-system-sparc
|
||||
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
-Multi-Arch: foreign
|
||||
-Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> ${source:Version}~), qemu-system-data (>> ${source:Version}~),
|
||||
-Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
|
||||
-# sparc64 uses vgabios-stdvga and bootroms
|
||||
- seabios, ipxe-qemu (>= 1.0.0+git-20131111.c3d1e78-1~)
|
||||
-Suggests: samba, vde2, qemu-block-extra (= ${binary:Version}),
|
||||
-Provides: ${sysprovides:sparc}
|
||||
-Description: QEMU full system emulation binaries (sparc)
|
||||
- QEMU is a fast processor emulator: currently the package supports
|
||||
- SPARC emulation. By using dynamic translation it achieves
|
||||
- reasonable speed while being easy to port on new host CPUs.
|
||||
- .
|
||||
- This package provides the full system emulation binaries to emulate
|
||||
- the following sparc hardware: ${sysarch:sparc}.
|
||||
- .
|
||||
- In system emulation mode QEMU emulates a full system, including a processor
|
||||
- and various peripherals. It enables easier testing and debugging of system
|
||||
- code. It can also be used to provide virtual hosting of several virtual
|
||||
- machines on a single server.
|
||||
-
|
||||
Package: qemu-system-x86
|
||||
Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
Multi-Arch: foreign
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> ${source:Version}~), qemu-system-data (>> ${source:Version}~),
|
||||
seabios (>= 1.10.2-1~), ipxe-qemu (>= 1.0.0+git-20131111.c3d1e78-1~)
|
||||
-Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
|
||||
- ovmf,
|
||||
+Recommends: qemu-utils, ovmf
|
||||
Suggests: samba, vde2, qemu-block-extra (= ${binary:Version}),
|
||||
sgabios,
|
||||
Provides: qemu-kvm [linux-amd64 linux-i386], ${sysprovides:x86}
|
||||
@@ -374,68 +241,6 @@ Description: QEMU full system emulation binaries (x86)
|
||||
On x86 host hardware this package also enables KVM kernel virtual machine
|
||||
usage on systems which supports it.
|
||||
|
||||
-Package: qemu-user
|
||||
-Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
-Multi-Arch: foreign
|
||||
-Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
-Recommends: qemu-user-binfmt
|
||||
-Description: QEMU user mode emulation binaries
|
||||
- QEMU is a fast processor emulator: currently the package supports
|
||||
- ARM, CRIS, i386, M68k (ColdFire), MicroBlaze, MIPS, PowerPC, SH4,
|
||||
- SPARC and x86-64 emulation. By using dynamic translation it achieves
|
||||
- reasonable speed while being easy to port on new host CPUs.
|
||||
- .
|
||||
- This package provides the user mode emulation binaries. In this mode
|
||||
- QEMU can launch Linux processes compiled for one CPU on another CPU.
|
||||
- .
|
||||
- If qemu-user-binfmt package is also installed, it will register binary
|
||||
- format handlers from this qemu-user package with the kernel so it will
|
||||
- be possible to run foreign binaries directly. However, this might not
|
||||
- be suitable for using inside foreign chroots, in which case it is
|
||||
- possible to use qemu-user-static package instead of qemu-user-binmft, --
|
||||
- qemu-user-static will register statically linked binfmt handlers instead.
|
||||
-
|
||||
-Package: qemu-user-static
|
||||
-Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
-Built-Using: ${built-using}
|
||||
-Multi-Arch: foreign
|
||||
-Depends: ${misc:Depends}
|
||||
-Recommends: binfmt-support
|
||||
-Breaks: binfmt-support (<< 2.1.7~)
|
||||
-Provides: qemu-user-binfmt
|
||||
-Conflicts: qemu-user-binfmt
|
||||
-Suggests: sudo
|
||||
-Description: QEMU user mode emulation binaries (static version)
|
||||
- QEMU is a fast processor emulator: currently the package supports
|
||||
- ARM, CRIS, i386, M68k (ColdFire), MicroBlaze, MIPS, PowerPC, SH4,
|
||||
- SPARC and x86-64 emulation. By using dynamic translation it achieves
|
||||
- reasonable speed while being easy to port on new host CPUs.
|
||||
- .
|
||||
- This package provides the user mode emulation binaries, built
|
||||
- statically. In this mode QEMU can launch Linux processes compiled for
|
||||
- one CPU on another CPU.
|
||||
- .
|
||||
- qemu-user-static package will register binary formats which the provided
|
||||
- emulators can handle, so that it will be possible to run foreign binaries
|
||||
- directly.
|
||||
-
|
||||
-Package: qemu-user-binfmt
|
||||
-Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
-Multi-Arch: foreign
|
||||
-Depends: ${misc:Depends}, qemu-user (= ${binary:Version}), binfmt-support
|
||||
-Breaks: binfmt-support (<< 2.1.7~)
|
||||
-Conflicts: qemu-user-static
|
||||
-Description: QEMU user mode binfmt registration for qemu-user
|
||||
- QEMU is a fast processor emulator: currently the package supports
|
||||
- ARM, CRIS, i386, M68k (ColdFire), MicroBlaze, MIPS, PowerPC, SH4,
|
||||
- SPARC and x86-64 emulation. By using dynamic translation it achieves
|
||||
- reasonable speed while being easy to port on new host CPUs.
|
||||
- .
|
||||
- This package provides binfmt support registration for the user mode
|
||||
- emulation binaries from qemu-user. This is an empty package, it does
|
||||
- not contain any additional files, only registration scripts which run
|
||||
- at install and remove times.
|
||||
-
|
||||
Package: qemu-utils
|
||||
Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
|
||||
Multi-Arch: foreign
|
||||
diff --git a/debian/rules b/debian/rules
|
||||
index 9d9f18f..d6778c3 100755
|
||||
--- a/debian/rules
|
||||
+++ b/debian/rules
|
||||
@@ -72,14 +72,11 @@ endif
|
||||
ifeq (${enable_system},enable)
|
||||
|
||||
# list of system (softmmu) targets, from ./configure
|
||||
-system_targets = \
|
||||
- i386 x86_64 alpha aarch64 arm avr cris hppa m68k microblaze microblazeel \
|
||||
- mips mipsel mips64 mips64el moxie nios2 or1k ppc ppc64 riscv32 riscv64 rx \
|
||||
- sh4 sh4eb sparc sparc64 s390x tricore xtensa xtensaeb
|
||||
+system_targets = i386 x86_64
|
||||
|
||||
# qemu-system subpackages, from d/control
|
||||
sys_systems = arm mips ppc sparc x86 $(if $(filter ${VENDOR},UBUNTU),s390x,)
|
||||
-systems = ${sys_systems} misc
|
||||
+systems = x86
|
||||
sysarch_arm = $(filter aarch64 arm,${system_targets})
|
||||
sysarch_mips = $(filter mips mipsel mips64 mips64el,${system_targets})
|
||||
sysarch_ppc = $(filter ppc ppc64,${system_targets})
|
||||
@@ -348,9 +345,11 @@ endif # enable_linux_user
|
||||
|
||||
dh_install -a
|
||||
dh_missing --list-missing
|
||||
+ifeq ($(enable_linux_user),enable)
|
||||
dh_installdocs -a -Nqemu-user-binfmt
|
||||
dh_installchangelogs -a -Nqemu-user-binfmt -XChangelog
|
||||
dh_installdocs -a -pqemu-user-binfmt --link-doc=qemu-user
|
||||
+endif
|
||||
dh_installman -a
|
||||
dh_installudev -a
|
||||
ifeq (${enable_system},enable)
|
||||
@@ -393,35 +392,6 @@ debian/control: debian/control-in debian/rules
|
||||
chmod -w $@
|
||||
endif
|
||||
|
||||
-### openbios rules
|
||||
-b/openbios/config-host.mak:
|
||||
- mkdir -p b/openbios
|
||||
- cd b/openbios && ../../roms/openbios/config/scripts/switch-arch builtin-ppc builtin-sparc32 builtin-sparc64
|
||||
-build-openbios: $(addprefix b/openbios/obj-, $(addsuffix /.built, ppc sparc32 sparc64))
|
||||
-b/openbios/obj-%/.built: b/openbios/config-host.mak
|
||||
- ${MAKE} -C ${@D} V=${V} EXTRACFLAGS="-ffreestanding -fno-pic -fno-stack-protector"
|
||||
- @touch $@
|
||||
-install-openbios: build-openbios
|
||||
- install -m 0644 b/openbios/obj-ppc/openbios-qemu.elf "${sysdatadir}/openbios-ppc"
|
||||
- install -m 0644 b/openbios/obj-sparc32/openbios-builtin.elf "${sysdatadir}/openbios-sparc32"
|
||||
- install -m 0644 b/openbios/obj-sparc64/openbios-builtin.elf "${sysdatadir}/openbios-sparc64"
|
||||
- install -m 0644 -t "${sysdatadir}" \
|
||||
- b/openbios/obj-sparc32/QEMU,tcx.bin \
|
||||
- b/openbios/obj-sparc32/QEMU,cgthree.bin \
|
||||
- b/openbios/obj-sparc64/QEMU,VGA.bin
|
||||
-sysdata-components += openbios
|
||||
-
|
||||
-### powernv firmware in roms/skiboot
|
||||
-build-skiboot: b/skiboot/skiboot.lid
|
||||
-b/skiboot/skiboot.lid:
|
||||
- mkdir -p b/skiboot
|
||||
- ${MAKE} -C b/skiboot -f ${CURDIR}/roms/skiboot/Makefile \
|
||||
- SRC=${CURDIR}/roms/skiboot \
|
||||
- CROSS_COMPILE=${PPC64_CROSSPFX} V=${V}
|
||||
-install-skiboot: b/skiboot/skiboot.lid
|
||||
- install -m 0644 -t "${sysdatadir}" $<
|
||||
-sysdata-components += skiboot
|
||||
-
|
||||
### x86 optionrom
|
||||
build-x86-optionrom: b/optionrom/built
|
||||
b/optionrom/built:
|
||||
@@ -471,48 +441,6 @@ install-palcode-clipper: b/qemu-palcode/palcode-clipper
|
||||
install -m 0644 $< ${sysdatadir}/palcode-clipper
|
||||
sysdata-components += palcode-clipper
|
||||
|
||||
-### SLOF
|
||||
-build-slof: b/SLOF/boot_rom.bin
|
||||
-b/SLOF/boot_rom.bin:
|
||||
- cp -al roms/SLOF b/
|
||||
- env -u LDFLAGS -u CFLAGS $(MAKE) -C b/SLOF qemu CROSS="powerpc64-linux-gnu-" V=${V}
|
||||
-install-slof: b/SLOF/boot_rom.bin
|
||||
- install -m 0644 $< ${sysdatadir}/slof.bin
|
||||
-sysdata-components += slof
|
||||
-
|
||||
-### s390x firmware in pc-bios/s390-ccw
|
||||
-build-s390x-fw: b/s390fw/built
|
||||
-b/s390fw/built:
|
||||
- mkdir -p b/s390fw
|
||||
- ${MAKE} -f debian/s390fw.mak OUT=b/s390fw/
|
||||
- touch $@
|
||||
-install-s390x-fw: build-s390x-fw
|
||||
- install -m 0644 -t "${sysdatadir}" b/s390fw/s390*.img
|
||||
-sysdata-components += s390x-fw
|
||||
-
|
||||
-### hppa-firmware (roms/seabios-hppa)
|
||||
-build-hppa-fw: b/hppafw/hppa-firmware.img
|
||||
-b/hppafw/hppa-firmware.img: | b
|
||||
- mkdir -p b/hppafw
|
||||
- ${MAKE} -C roms/seabios-hppa OUT=../../b/hppafw/ PYTHON=python3 parisc
|
||||
- hppa-linux-gnu-strip -R.note -R.comment $@
|
||||
-install-hppa-fw: b/hppafw/hppa-firmware.img
|
||||
- install -m 0644 $< ${sysdatadir}
|
||||
-sysdata-components += hppa-fw
|
||||
-
|
||||
-### opensbi (riscv firmware)
|
||||
-# we only build v64 variants, not v32
|
||||
-build-opensbi: b/opensbi/.built
|
||||
-b/opensbi/.built: | b
|
||||
- mkdir -p b/opensbi
|
||||
- ${MAKE} -C roms/opensbi O=../../b/opensbi CROSS_COMPILE=riscv64-linux-gnu- V=${V} PLATFORM=generic
|
||||
- riscv64-linux-gnu-strip --strip-unneeded -R.comment -R.note b/opensbi/platform/generic/firmware/fw_dynamic.elf
|
||||
- touch $@
|
||||
-install-opensbi: build-opensbi
|
||||
- install -m 0644 b/opensbi/platform/generic/firmware/fw_dynamic.bin ${sysdatadir}/opensbi-riscv64-generic-fw_dynamic.bin
|
||||
- install -m 0644 b/opensbi/platform/generic/firmware/fw_dynamic.elf ${sysdatadir}/opensbi-riscv64-generic-fw_dynamic.elf
|
||||
-sysdata-components += opensbi
|
||||
-
|
||||
build-indep: $(addprefix build-, ${sysdata-components})
|
||||
|
||||
b/install-indep-prep.stamp:
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1 +0,0 @@
|
||||
0001-Customize-Debian-build-files-for-STX.patch
|
@ -1,9 +0,0 @@
|
||||
---
|
||||
debname: qemu
|
||||
debver: 5.2+dfsg-11+deb11u2
|
||||
archive: https://snapshot.debian.org/archive/debian/20221109T211529Z/pool/main/q/qemu/
|
||||
revision:
|
||||
dist: $STX_DIST
|
||||
GITREVCOUNT:
|
||||
BASE_SRCREV: 75a234904ff66d8656bcac85c54b93cfc9f058df
|
||||
SRC_DIR: ${MY_REPO}/stx/integ/virt/qemu
|
@ -1,63 +0,0 @@
|
||||
From d8d9a42d7e243f0874f77c0fc932f32ecbde42e6 Mon Sep 17 00:00:00 2001
|
||||
From: Eduardo Habkost <ehabkost@redhat.com>
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: Add support statement to -help output
|
||||
|
||||
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
|
||||
Message-id: <1386183197-27761-1-git-send-email-ehabkost@redhat.com>
|
||||
Patchwork-id: 55994
|
||||
O-Subject: [qemu-kvm RHEL7 PATCH] Add support statement to -help output
|
||||
Bugzilla: 972773
|
||||
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||
RH-Acked-by: knoel@redhat.com
|
||||
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
Bugzilla: 972773
|
||||
Brew scratch build:
|
||||
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6676272
|
||||
|
||||
Add support statement to -help output, reporting direct qemu-kvm usage
|
||||
as unsupported by Red Hat, and advising users to use libvirt instead.
|
||||
|
||||
Change the above to say StarlingX instead of Red Hat.
|
||||
STX-Author: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
|
||||
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
softmmu/vl.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/softmmu/vl.c b/softmmu/vl.c
|
||||
index e6e0ad5a92..27ce96f671 100644
|
||||
--- a/softmmu/vl.c
|
||||
+++ b/softmmu/vl.c
|
||||
@@ -1688,9 +1688,17 @@ static void version(void)
|
||||
QEMU_COPYRIGHT "\n");
|
||||
}
|
||||
|
||||
+static void print_stx_warning(void)
|
||||
+{
|
||||
+ printf("\nWARNING: Direct use of qemu-kvm from the command line is not supported by StarlingX.\n"
|
||||
+ "WARNING: Use libvirt as the stable management interface.\n"
|
||||
+ "WARNING: Some command line options listed here may not be available in future releases.\n\n");
|
||||
+}
|
||||
+
|
||||
static void help(int exitcode)
|
||||
{
|
||||
version();
|
||||
+ print_stx_warning();
|
||||
printf("usage: %s [options] [disk_image]\n\n"
|
||||
"'disk_image' is a raw hard disk image for IDE hard disk 0\n\n",
|
||||
error_get_progname());
|
||||
@@ -1707,6 +1715,7 @@ static void help(int exitcode)
|
||||
"\n"
|
||||
QEMU_HELP_BOTTOM "\n");
|
||||
|
||||
+ print_stx_warning();
|
||||
exit(exitcode);
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
@ -1,272 +0,0 @@
|
||||
From 049547fec5faedf6127cd7bf3c6e72f5a2fc16ab Mon Sep 17 00:00:00 2001
|
||||
From: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: migration thread affinity and priority qmp
|
||||
|
||||
This includes de-blacklisting the scheduler and affinity
|
||||
setting syscalls.
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
[ Update hmp-commands struc ]
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
hmp-commands.hx | 30 ++++++++++++++++++++++++
|
||||
include/monitor/hmp.h | 2 ++
|
||||
migration/migration.c | 53 ++++++++++++++++++++++++++++++++++++++++++
|
||||
monitor/hmp-cmds.c | 26 +++++++++++++++++++++
|
||||
qapi/misc.json | 30 ++++++++++++++++++++++++
|
||||
softmmu/qemu-seccomp.c | 5 ----
|
||||
softmmu/trace-events | 1 +
|
||||
7 files changed, 142 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/hmp-commands.hx b/hmp-commands.hx
|
||||
index ff2d7aa8f3..c5db85593b 100644
|
||||
--- a/hmp-commands.hx
|
||||
+++ b/hmp-commands.hx
|
||||
@@ -1103,6 +1103,36 @@ SRST
|
||||
once migration finished successfully. Only implemented for SPICE.
|
||||
ERST
|
||||
|
||||
+ {
|
||||
+ .name = "migrate_set_thread_cpumask",
|
||||
+ .args_type = "value:o",
|
||||
+ .params = "value",
|
||||
+ .help = "Set CPU mask for the migration thread."
|
||||
+ "Defaults to CPU 0 if no mask is specified",
|
||||
+ .cmd = hmp_migrate_set_thread_cpumask,
|
||||
+ },
|
||||
+
|
||||
+SRST
|
||||
+``migrate_set_thread_cpumask`` *value*
|
||||
+ Set CPU mask for the migration thread
|
||||
+ERST
|
||||
+
|
||||
+ {
|
||||
+ .name = "migrate_set_thread_priority",
|
||||
+ .args_type = "value:o",
|
||||
+ .params = "value",
|
||||
+ .help = "Set real time priority for the the migration thread."
|
||||
+ "Defaults to no change migration thread priority if not"
|
||||
+ "specified or out of range. Range [1-99].Scheduling"
|
||||
+ "policy will always be- SCHED_FIFO",
|
||||
+ .cmd = hmp_migrate_set_thread_priority,
|
||||
+ },
|
||||
+
|
||||
+SRST
|
||||
+``migrate_set_thread_priority`` *value*
|
||||
+ Set real time priority for the the migration thread
|
||||
+ERST
|
||||
+
|
||||
{
|
||||
.name = "dump-guest-memory",
|
||||
.args_type = "paging:-p,detach:-d,windmp:-w,zlib:-z,lzo:-l,snappy:-s,filename:F,begin:l?,length:l?",
|
||||
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
|
||||
index ed2913fd18..85100cd33d 100644
|
||||
--- a/include/monitor/hmp.h
|
||||
+++ b/include/monitor/hmp.h
|
||||
@@ -72,6 +72,8 @@ void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict);
|
||||
void hmp_client_migrate_info(Monitor *mon, const QDict *qdict);
|
||||
void hmp_migrate_start_postcopy(Monitor *mon, const QDict *qdict);
|
||||
void hmp_x_colo_lost_heartbeat(Monitor *mon, const QDict *qdict);
|
||||
+void hmp_migrate_set_thread_cpumask(Monitor *mon, const QDict *qdict);
|
||||
+void hmp_migrate_set_thread_priority(Monitor *mon, const QDict *qdict);
|
||||
void hmp_set_password(Monitor *mon, const QDict *qdict);
|
||||
void hmp_expire_password(Monitor *mon, const QDict *qdict);
|
||||
void hmp_change(Monitor *mon, const QDict *qdict);
|
||||
diff --git a/migration/migration.c b/migration/migration.c
|
||||
index 87a9b59f83..b7415a52ca 100644
|
||||
--- a/migration/migration.c
|
||||
+++ b/migration/migration.c
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "qapi/qapi-visit-migration.h"
|
||||
#include "qapi/qapi-visit-sockets.h"
|
||||
#include "qapi/qapi-commands-migration.h"
|
||||
+#include "qapi/qapi-commands-misc.h"
|
||||
#include "qapi/qapi-events-migration.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
#include "qapi/qmp/qnull.h"
|
||||
@@ -56,6 +57,16 @@
|
||||
#include "net/announce.h"
|
||||
#include "qemu/queue.h"
|
||||
#include "multifd.h"
|
||||
+#include <sched.h>
|
||||
+
|
||||
+/* #define DEBUG */
|
||||
+
|
||||
+#ifdef DEBUG
|
||||
+#define DPRINTF(fmt, ...) \
|
||||
+ printf(fmt, ## __VA_ARGS__)
|
||||
+#else
|
||||
+#define DPRINTF(fmt, ...)
|
||||
+#endif
|
||||
|
||||
#ifdef CONFIG_VFIO
|
||||
#include "hw/vfio/vfio-common.h"
|
||||
@@ -118,6 +129,11 @@
|
||||
static NotifierList migration_state_notifiers =
|
||||
NOTIFIER_LIST_INITIALIZER(migration_state_notifiers);
|
||||
|
||||
+/* variables for pinning the migration thread to a CPU and assigning the
|
||||
+ * realtime priority to it */
|
||||
+static uint64_t migrate_thread_cpumask=0;
|
||||
+static uint64_t migrate_thread_priority=0;
|
||||
+
|
||||
static bool deferred_incoming;
|
||||
|
||||
/* Messages sent on the return path from destination to source */
|
||||
@@ -2215,6 +2231,30 @@ void qmp_migrate_set_cache_size(int64_t value, Error **errp)
|
||||
qmp_migrate_set_parameters(&p, errp);
|
||||
}
|
||||
|
||||
+void qmp_migrate_set_thread_cpumask(int64_t value, Error **errp)
|
||||
+{
|
||||
+ /* Check for truncation */
|
||||
+ if (value != (size_t)value) {
|
||||
+ error_setg(errp, "Migration thread CPU Mask exceeding address space");
|
||||
+ return;
|
||||
+ }
|
||||
+ /*resize the value */
|
||||
+ value >>= 20; /*Magic */
|
||||
+ migrate_thread_cpumask = value;
|
||||
+}
|
||||
+
|
||||
+void qmp_migrate_set_thread_priority(int64_t value, Error **errp)
|
||||
+{
|
||||
+ /* Check for truncation */
|
||||
+ if (value != (size_t)value) {
|
||||
+ error_setg(errp, "Migration thread Priority exceeding address space");
|
||||
+ return;
|
||||
+ }
|
||||
+ /*resize the value */
|
||||
+ value >>= 20;
|
||||
+ migrate_thread_priority = value;
|
||||
+}
|
||||
+
|
||||
int64_t qmp_query_migrate_cache_size(Error **errp)
|
||||
{
|
||||
return migrate_xbzrle_cache_size();
|
||||
@@ -3540,6 +3580,19 @@ static void *migration_thread(void *opaque)
|
||||
qemu_savevm_send_postcopy_advise(s->to_dst_file);
|
||||
}
|
||||
|
||||
+ /* Bind Migration thread to the processor specified by the user */
|
||||
+ if (sched_setaffinity(0, sizeof(migrate_thread_cpumask), (cpu_set_t *)&migrate_thread_cpumask) <0) {
|
||||
+ DPRINTF("Error setting user input affinity. Switching to default.\n");
|
||||
+ }
|
||||
+
|
||||
+ /* Change the realtime priority of the migration thread specified by the user */
|
||||
+ struct sched_param schedp;
|
||||
+ memset(&schedp, 0, sizeof(schedp));
|
||||
+ schedp.sched_priority = migrate_thread_priority;
|
||||
+ if (sched_setscheduler(0, SCHED_FIFO, &schedp) < 0) {
|
||||
+ DPRINTF("Error setting user input priority. Switching to default.\n");
|
||||
+ }
|
||||
+
|
||||
if (migrate_colo_enabled()) {
|
||||
/* Notify migration destination that we enable COLO */
|
||||
qemu_savevm_send_colo_enable(s->to_dst_file);
|
||||
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
|
||||
index 65d8ff4849..a079ec3ace 100644
|
||||
--- a/monitor/hmp-cmds.c
|
||||
+++ b/monitor/hmp-cmds.c
|
||||
@@ -1471,6 +1471,32 @@ void hmp_x_colo_lost_heartbeat(Monitor *mon, const QDict *qdict)
|
||||
hmp_handle_error(mon, err);
|
||||
}
|
||||
|
||||
+void hmp_migrate_set_thread_cpumask(Monitor *mon, const QDict *qdict)
|
||||
+{
|
||||
+ int64_t value = qdict_get_int(qdict, "value");
|
||||
+ Error *err = NULL;
|
||||
+
|
||||
+ qmp_migrate_set_thread_cpumask(value, &err);
|
||||
+ if (err) {
|
||||
+ monitor_printf(mon, "%s\n", error_get_pretty(err));
|
||||
+ error_free(err);
|
||||
+ return;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void hmp_migrate_set_thread_priority(Monitor *mon, const QDict *qdict)
|
||||
+{
|
||||
+ int64_t value = qdict_get_int(qdict, "value");
|
||||
+ Error *err = NULL;
|
||||
+
|
||||
+ qmp_migrate_set_thread_priority(value, &err);
|
||||
+ if (err) {
|
||||
+ monitor_printf(mon, "%s\n", error_get_pretty(err));
|
||||
+ error_free(err);
|
||||
+ return;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void hmp_set_password(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
const char *protocol = qdict_get_str(qdict, "protocol");
|
||||
diff --git a/qapi/misc.json b/qapi/misc.json
|
||||
index 40df513856..1c75d85126 100644
|
||||
--- a/qapi/misc.json
|
||||
+++ b/qapi/misc.json
|
||||
@@ -238,6 +238,36 @@
|
||||
'returns': 'str',
|
||||
'features': [ 'savevm-monitor-nodes' ] }
|
||||
|
||||
+##
|
||||
+# @migrate_set_thread_cpumask:
|
||||
+#
|
||||
+# Set migration thread CPU mask.
|
||||
+#
|
||||
+# @value: CPU mask.
|
||||
+#
|
||||
+# Returns: nothing on success
|
||||
+#
|
||||
+# Notes: A value lesser than zero will be automatically round up to zero.
|
||||
+#
|
||||
+# Since: 0.14.0
|
||||
+##
|
||||
+{ 'command': 'migrate_set_thread_cpumask', 'data': {'value': 'int'} }
|
||||
+
|
||||
+##
|
||||
+# @migrate_set_thread_priority:
|
||||
+#
|
||||
+# Set migration thread Real Timer priority mask.
|
||||
+#
|
||||
+# @value: Thread Priority.
|
||||
+#
|
||||
+# Returns: nothing on success
|
||||
+#
|
||||
+# Notes: A value lesser than zero will be automatically round up to zero.
|
||||
+#
|
||||
+# Since: 0.14.0
|
||||
+##
|
||||
+{ 'command': 'migrate_set_thread_priority', 'data': {'value': 'int'} }
|
||||
+
|
||||
##
|
||||
# @change:
|
||||
#
|
||||
diff --git a/softmmu/qemu-seccomp.c b/softmmu/qemu-seccomp.c
|
||||
index 8325ecb766..b1b8431eb3 100644
|
||||
--- a/softmmu/qemu-seccomp.c
|
||||
+++ b/softmmu/qemu-seccomp.c
|
||||
@@ -101,11 +101,6 @@ static const struct QemuSeccompSyscall blacklist[] = {
|
||||
{ SCMP_SYS(setpriority), QEMU_SECCOMP_SET_RESOURCECTL },
|
||||
{ SCMP_SYS(sched_setparam), QEMU_SECCOMP_SET_RESOURCECTL },
|
||||
{ SCMP_SYS(sched_getparam), QEMU_SECCOMP_SET_RESOURCECTL },
|
||||
- { SCMP_SYS(sched_setscheduler), QEMU_SECCOMP_SET_RESOURCECTL,
|
||||
- ARRAY_SIZE(sched_setscheduler_arg), sched_setscheduler_arg },
|
||||
- { SCMP_SYS(sched_getscheduler), QEMU_SECCOMP_SET_RESOURCECTL },
|
||||
- { SCMP_SYS(sched_setaffinity), QEMU_SECCOMP_SET_RESOURCECTL },
|
||||
- { SCMP_SYS(sched_getaffinity), QEMU_SECCOMP_SET_RESOURCECTL },
|
||||
{ SCMP_SYS(sched_get_priority_max), QEMU_SECCOMP_SET_RESOURCECTL },
|
||||
{ SCMP_SYS(sched_get_priority_min), QEMU_SECCOMP_SET_RESOURCECTL },
|
||||
};
|
||||
diff --git a/softmmu/trace-events b/softmmu/trace-events
|
||||
index b80ca042e1..b0210d70c3 100644
|
||||
--- a/softmmu/trace-events
|
||||
+++ b/softmmu/trace-events
|
||||
@@ -26,3 +26,4 @@ runstate_set(int current_state, const char *current_state_str, int new_state, co
|
||||
system_wakeup_request(int reason) "reason=%d"
|
||||
qemu_system_shutdown_request(int reason) "reason=%d"
|
||||
qemu_system_powerdown_request(void) ""
|
||||
+migrate_thread(uint64_t migrate_thread_cpumask, uint64_t migrate_thread_priority) "migration Thread pinned to %" PRIu64 "with Priority %" PRIu64
|
||||
--
|
||||
2.25.1
|
@ -1,197 +0,0 @@
|
||||
From 31ae2e35caa16dcf4cc1fa2ff5e3c1aa825b5352 Mon Sep 17 00:00:00 2001
|
||||
From: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: qemu dpdk changes for openvswitch dpdk
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
configure | 26 ++++++++++++++++++
|
||||
hw/net/virtio-net.c | 5 ++++
|
||||
softmmu/vl.c | 67 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 98 insertions(+)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 18c26e0389..cb6d3c08fc 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -1106,6 +1106,11 @@ for opt do
|
||||
;;
|
||||
--enable-whpx) whpx="enabled"
|
||||
;;
|
||||
+ --disable-dpdk) dpdk="no"
|
||||
+ ;;
|
||||
+ --dpdkdir=*) rte_sdk="$optarg"
|
||||
+ dpdk="yes"
|
||||
+ ;;
|
||||
--disable-tcg-interpreter) tcg_interpreter="no"
|
||||
;;
|
||||
--enable-tcg-interpreter) tcg_interpreter="yes"
|
||||
@@ -5993,6 +5998,27 @@ if test "$guest_agent" = "yes" ; then
|
||||
echo "CONFIG_GUEST_AGENT=y" >> $config_host_mak
|
||||
fi
|
||||
echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
|
||||
+if test "$dpdk" = "yes"; then
|
||||
+ if test "${rte_sdk+set}" != set; then
|
||||
+ echo "No dpdkdir given"
|
||||
+ exit 1
|
||||
+ fi
|
||||
+ echo "dpdk_dir=`eval echo $rte_sdk`" >> $config_host_mak
|
||||
+ echo "dpdk_lib_dir=\$(dpdk_dir)/x86_64-default-linuxapp-gcc/lib" >> $config_host_mak
|
||||
+ echo "dpdk_inc_dir=\$(dpdk_dir)/x86_64-default-linuxapp-gcc/include" >> $config_host_mak
|
||||
+ echo "" >> $config_host_mak
|
||||
+ echo "dpdk_libs=\$(dpdk_lib_dir)/librte_eal.a \\" >> $config_host_mak
|
||||
+ echo " \$(dpdk_lib_dir)/libethdev.a \\" >> $config_host_mak
|
||||
+ echo " \$(dpdk_lib_dir)/librte_cmdline.a \\" >> $config_host_mak
|
||||
+ echo " \$(dpdk_lib_dir)/librte_hash.a \\" >> $config_host_mak
|
||||
+ echo " \$(dpdk_lib_dir)/librte_lpm.a \\" >> $config_host_mak
|
||||
+ echo " \$(dpdk_lib_dir)/librte_mbuf.a \\" >> $config_host_mak
|
||||
+ echo " \$(dpdk_lib_dir)/librte_mempool.a \\" >> $config_host_mak
|
||||
+ echo " \$(dpdk_lib_dir)/librte_ring.a \\" >> $config_host_mak
|
||||
+ echo " \$(dpdk_lib_dir)/librte_malloc.a" >> $config_host_mak
|
||||
+ LIBS="\$(dpdk_libs) $LIBS"
|
||||
+ QEMU_INCLUDES="-I\$(dpdk_inc_dir) $QEMU_INCLUDES"
|
||||
+fi
|
||||
if test "$vde" = "yes" ; then
|
||||
echo "CONFIG_VDE=y" >> $config_host_mak
|
||||
echo "VDE_LIBS=$vde_libs" >> $config_host_mak
|
||||
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
|
||||
index 9179013ac4..a25381c452 100644
|
||||
--- a/hw/net/virtio-net.c
|
||||
+++ b/hw/net/virtio-net.c
|
||||
@@ -2,6 +2,7 @@
|
||||
* Virtio Network Device
|
||||
*
|
||||
* Copyright IBM, Corp. 2007
|
||||
+ * Copyright 2012-2013 Intel Corporation All Rights Reserved.
|
||||
*
|
||||
* Authors:
|
||||
* Anthony Liguori <aliguori@us.ibm.com>
|
||||
@@ -1509,6 +1510,7 @@ static void receive_header(VirtIONet *n, const struct iovec *iov, int iov_cnt,
|
||||
}
|
||||
}
|
||||
|
||||
+#if 0
|
||||
static int receive_filter(VirtIONet *n, const uint8_t *buf, int size)
|
||||
{
|
||||
static const uint8_t bcast[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
@@ -1559,6 +1561,7 @@ static int receive_filter(VirtIONet *n, const uint8_t *buf, int size)
|
||||
|
||||
return 0;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static uint8_t virtio_net_get_hash_type(bool isip4,
|
||||
bool isip6,
|
||||
@@ -1687,8 +1690,10 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ #if 0
|
||||
if (!receive_filter(n, buf, size))
|
||||
return size;
|
||||
+ #endif
|
||||
|
||||
offset = i = 0;
|
||||
|
||||
diff --git a/softmmu/vl.c b/softmmu/vl.c
|
||||
index 27ce96f671..5f556f1a0e 100644
|
||||
--- a/softmmu/vl.c
|
||||
+++ b/softmmu/vl.c
|
||||
@@ -2445,6 +2445,35 @@ static const QEMUOption *lookup_opt(int argc, char **argv,
|
||||
return popt;
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_ENABLE_DPDK
|
||||
+static const QEMUOption *quick_scan_opt(int argc, char **argv, int *poptind)
|
||||
+{
|
||||
+ const QEMUOption *popt;
|
||||
+ int optind = *poptind;
|
||||
+ char *r = argv[optind];
|
||||
+
|
||||
+ loc_set_cmdline(argv, optind, 1);
|
||||
+ optind++;
|
||||
+ /* Treat --foo the same as -foo. */
|
||||
+ if (r[1] == '-')
|
||||
+ r++;
|
||||
+ popt = qemu_options;
|
||||
+ for(;;) {
|
||||
+ /* need to ignore non qemu args, e.g. dpdk args */
|
||||
+ if (!popt->name) {
|
||||
+ *poptind = optind;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ if (!strcmp(popt->name, r + 1))
|
||||
+ break;
|
||||
+ popt++;
|
||||
+ }
|
||||
+
|
||||
+ *poptind = optind;
|
||||
+ return popt;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static MachineClass *select_machine(void)
|
||||
{
|
||||
GSList *machines = object_class_get_list(TYPE_MACHINE, false);
|
||||
@@ -2901,6 +2930,10 @@ void qemu_init(int argc, char **argv, char **envp)
|
||||
FILE *vmstate_dump_file = NULL;
|
||||
Error *main_loop_err = NULL;
|
||||
Error *err = NULL;
|
||||
+#ifdef CONFIG_ENABLE_DPDK
|
||||
+ bool use_dpdk = false;
|
||||
+ int retval;
|
||||
+#endif
|
||||
bool list_data_dirs = false;
|
||||
char **dirs;
|
||||
const char *mem_path = NULL;
|
||||
@@ -2922,6 +2955,37 @@ void qemu_init(int argc, char **argv, char **envp)
|
||||
atexit(qemu_run_exit_notifiers);
|
||||
qemu_init_exec_dir(argv[0]);
|
||||
|
||||
+#ifdef CONFIG_ENABLE_DPDK
|
||||
+ /* need to check for -enable-dpdk before calling rte_eal_init. If
|
||||
+ * it is not found, don't call rte_eal_init */
|
||||
+ optind = 1;
|
||||
+ while (optind < argc) {
|
||||
+ if (argv[optind][0] != '-') {
|
||||
+ /* disk image */
|
||||
+ optind++;
|
||||
+ continue;
|
||||
+ } else {
|
||||
+ const QEMUOption *popt;
|
||||
+ popt = quick_scan_opt(argc, argv, &optind);
|
||||
+ if (popt) {
|
||||
+ switch (popt->index) {
|
||||
+ case QEMU_OPTION_enable_dpdk:
|
||||
+ use_dpdk = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (use_dpdk) {
|
||||
+ if ((retval = rte_eal_init(argc, argv)) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ argc -= retval;
|
||||
+ argv += retval;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
module_call_init(MODULE_INIT_QOM);
|
||||
module_call_init(MODULE_INIT_MIGRATION);
|
||||
|
||||
@@ -3869,6 +3933,9 @@ void qemu_init(int argc, char **argv, char **envp)
|
||||
|
||||
user_register_global_props();
|
||||
|
||||
+ extern int
|
||||
+ rte_eal_init(int argc, char **argv);
|
||||
+
|
||||
replay_configure(icount_opts);
|
||||
|
||||
if (incoming && !preconfig_exit_requested) {
|
||||
--
|
||||
2.25.1
|
@ -1,53 +0,0 @@
|
||||
From 6b809649650c367ea0458928434600ca064206c1 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Barrette <paul.barrette@windriver.com>
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: qemu: add -enable-dpdk runtime flag
|
||||
|
||||
For Intel's dpdk openvswitch support, qemu takes a set of dpdk
|
||||
specific command line args. Qemu will dump and error if it doesn't
|
||||
recognize the CLI args. So, add a new runtime flag to tell qemu that
|
||||
it is using dpdk and then the main function can take the appropriate
|
||||
action. This way, qemu can take dpdk args or run normally without
|
||||
dpdk.
|
||||
|
||||
Signed-off-by: Paul Barrette <paul.barrette@windriver.com>
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
[ Update qemu-options.hx struc ]
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
qemu-options.hx | 7 +++++++
|
||||
softmmu/vl.c | 1 +
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/qemu-options.hx b/qemu-options.hx
|
||||
index 104632ea34..1a339453e4 100644
|
||||
--- a/qemu-options.hx
|
||||
+++ b/qemu-options.hx
|
||||
@@ -906,6 +906,13 @@ DEFHEADING()
|
||||
|
||||
DEFHEADING(Block device options:)
|
||||
|
||||
+DEF("enable-dpdk", 0, QEMU_OPTION_enable_dpdk,
|
||||
+ "-enable-dpdk initialized DPDK EAL environment\n", QEMU_ARCH_ALL)
|
||||
+SRST
|
||||
+``-enable-dpdk``
|
||||
+ Enable DPDK EAL environment at init time (expecting DPDK CLI params).
|
||||
+ERST
|
||||
+
|
||||
DEF("fda", HAS_ARG, QEMU_OPTION_fda,
|
||||
"-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
|
||||
DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
|
||||
diff --git a/softmmu/vl.c b/softmmu/vl.c
|
||||
index 5f556f1a0e..a398697d0d 100644
|
||||
--- a/softmmu/vl.c
|
||||
+++ b/softmmu/vl.c
|
||||
@@ -3899,6 +3899,7 @@ void qemu_init(int argc, char **argv, char **envp)
|
||||
qsp_enable();
|
||||
break;
|
||||
case QEMU_OPTION_nouserconfig:
|
||||
+ case QEMU_OPTION_enable_dpdk:
|
||||
/* Nothing to be parsed here. Especially, do not error out below. */
|
||||
break;
|
||||
default:
|
||||
--
|
||||
2.25.1
|
@ -1,32 +0,0 @@
|
||||
From 93451fe51ab37bf8663a766ce1d77d3ac883ee1f Mon Sep 17 00:00:00 2001
|
||||
From: Paul Barrette <paul.barrette@windriver.com>
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: qemu: add compile define for CONFIG_DPDK
|
||||
|
||||
Dpdk build linkage will be detected if --dpdkdir is specified at
|
||||
configure time, which is the default. In the dpdk=yes section, add a
|
||||
compile time define that can be used internally.
|
||||
|
||||
Signed-off-by: Paul Barrette <paul.barrette@windriver.com>
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
configure | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index cb6d3c08fc..d0c4b79446 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6003,7 +6003,8 @@ if test "$dpdk" = "yes"; then
|
||||
echo "No dpdkdir given"
|
||||
exit 1
|
||||
fi
|
||||
- echo "dpdk_dir=`eval echo $rte_sdk`" >> $config_host_mak
|
||||
+ echo "CONFIG_ENABLE_DPDK=y" >> $config_host_mak
|
||||
+ echo "dpdk_dir=`eval echo $rte_sdk`" >> $config_host_mak
|
||||
echo "dpdk_lib_dir=\$(dpdk_dir)/x86_64-default-linuxapp-gcc/lib" >> $config_host_mak
|
||||
echo "dpdk_inc_dir=\$(dpdk_dir)/x86_64-default-linuxapp-gcc/include" >> $config_host_mak
|
||||
echo "" >> $config_host_mak
|
||||
--
|
||||
2.25.1
|
@ -1,41 +0,0 @@
|
||||
From 95ba02087f976256a91045286628fb797e3f0af1 Mon Sep 17 00:00:00 2001
|
||||
From: Amy Fong <amy.fong@windriver.com>
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: add libdl
|
||||
|
||||
qemu/dpdk 1.7* compile errors
|
||||
|
||||
In dpdk 1.7.*, librte_eal needs -ldl, otherwise, we'll
|
||||
get errors like:
|
||||
|
||||
LINK x86_64-softmmu/qemu-system-x86_64
|
||||
/usr/bin/ld:
|
||||
.../x86_64-ivshmem-linuxapp-gcc/lib/librte_eal.a(eal.o):
|
||||
undefined reference to symbol 'dlopen@@GLIBC_2.2.5'
|
||||
/usr/bin/ld: note: 'dlopen@@GLIBC_2.2.5' is defined in DSO
|
||||
/lib64/libdl.so.2 so try adding it to the linker command line
|
||||
/lib64/libdl.so.2: could not read symbols: Invalid operation
|
||||
collect2: error: ld returned 1 exit status
|
||||
|
||||
Signed-off-by: Amy Fong <amy.fong@windriver.com>
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
configure | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index d0c4b79446..e90a4e8fe0 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6017,7 +6017,7 @@ if test "$dpdk" = "yes"; then
|
||||
echo " \$(dpdk_lib_dir)/librte_mempool.a \\" >> $config_host_mak
|
||||
echo " \$(dpdk_lib_dir)/librte_ring.a \\" >> $config_host_mak
|
||||
echo " \$(dpdk_lib_dir)/librte_malloc.a" >> $config_host_mak
|
||||
- LIBS="\$(dpdk_libs) $LIBS"
|
||||
+ LIBS="\$(dpdk_libs) -ldl $LIBS"
|
||||
QEMU_INCLUDES="-I\$(dpdk_inc_dir) $QEMU_INCLUDES"
|
||||
fi
|
||||
if test "$vde" = "yes" ; then
|
||||
--
|
||||
2.25.1
|
@ -1,39 +0,0 @@
|
||||
From 2e53239f58b4faeeca9f1ae279207edb3aa4f30c Mon Sep 17 00:00:00 2001
|
||||
From: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: qemu dpdk custom config
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
configure | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index e90a4e8fe0..77c0321b5f 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -1111,6 +1111,8 @@ for opt do
|
||||
--dpdkdir=*) rte_sdk="$optarg"
|
||||
dpdk="yes"
|
||||
;;
|
||||
+ --dpdktarget=*) rte_target="$optarg"
|
||||
+ ;;
|
||||
--disable-tcg-interpreter) tcg_interpreter="no"
|
||||
;;
|
||||
--enable-tcg-interpreter) tcg_interpreter="yes"
|
||||
@@ -6005,9 +6007,10 @@ if test "$dpdk" = "yes"; then
|
||||
fi
|
||||
echo "CONFIG_ENABLE_DPDK=y" >> $config_host_mak
|
||||
echo "dpdk_dir=`eval echo $rte_sdk`" >> $config_host_mak
|
||||
- echo "dpdk_lib_dir=\$(dpdk_dir)/x86_64-default-linuxapp-gcc/lib" >> $config_host_mak
|
||||
- echo "dpdk_inc_dir=\$(dpdk_dir)/x86_64-default-linuxapp-gcc/include" >> $config_host_mak
|
||||
echo "" >> $config_host_mak
|
||||
+ echo "dpdk_target=`eval echo $rte_target`" >> $config_host_mak
|
||||
+ echo "dpdk_lib_dir=\$(dpdk_dir)/\$(dpdk_target)/lib" >> $config_host_mak
|
||||
+ echo "dpdk_inc_dir=\$(dpdk_dir)/\$(dpdk_target)/include" >> $config_host_mak
|
||||
echo "dpdk_libs=\$(dpdk_lib_dir)/librte_eal.a \\" >> $config_host_mak
|
||||
echo " \$(dpdk_lib_dir)/libethdev.a \\" >> $config_host_mak
|
||||
echo " \$(dpdk_lib_dir)/librte_cmdline.a \\" >> $config_host_mak
|
||||
--
|
||||
2.25.1
|
@ -1,102 +0,0 @@
|
||||
From f06fb5c1bf146f661fdca218943018fcf25c5ca6 Mon Sep 17 00:00:00 2001
|
||||
From: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: realtime uses mlock instead of mlockall
|
||||
|
||||
This enhances qemu to use mlock() instead of mlockall() when
|
||||
'-realtime mlock=on' is specified, so that memory is engineerable.
|
||||
|
||||
mlockall() is not practically engineerable since it requires significant
|
||||
4K reserved memory per process. It will lock pages of the code, data and
|
||||
stack segment, shared libraries, user space kernel data, shared memory,
|
||||
and memory-mapped files. This easily translates to >> 1GiB when you
|
||||
consider [heap] segment of 225MiB and VmData near 500 MiB to 900 MiB.
|
||||
|
||||
Using mlock() only in ram_block_add(), we no longer lock stack / data,
|
||||
shared libraries, and heap.
|
||||
|
||||
NOTE: This degrades the guarantee provided by '-realtime mlock=on'
|
||||
since we may end up delaying the instance to fault in code pages from
|
||||
disk or allocate memory, thus breaking any realtime guarantees.
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
softmmu/physmem.c | 13 ++++++++++++-
|
||||
softmmu/vl.c | 8 ++++----
|
||||
2 files changed, 16 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
|
||||
index 3027747c03..e63fad9b13 100644
|
||||
--- a/softmmu/physmem.c
|
||||
+++ b/softmmu/physmem.c
|
||||
@@ -1464,6 +1464,7 @@ static void *file_ram_alloc(RAMBlock *block,
|
||||
Error **errp)
|
||||
{
|
||||
void *area;
|
||||
+ int flags;
|
||||
|
||||
block->page_size = qemu_fd_getpagesize(fd);
|
||||
if (block->mr->align % block->page_size) {
|
||||
@@ -1510,8 +1511,13 @@ static void *file_ram_alloc(RAMBlock *block,
|
||||
perror("ftruncate");
|
||||
}
|
||||
|
||||
+ /* WRS - enable mlock */
|
||||
+ flags = block->flags & RAM_SHARED;
|
||||
+ if (enable_mlock) {
|
||||
+ flags |= MAP_LOCKED;
|
||||
+ }
|
||||
area = qemu_ram_mmap(fd, memory, block->mr->align,
|
||||
- block->flags & RAM_SHARED, block->flags & RAM_PMEM);
|
||||
+ flags, block->flags & RAM_PMEM);
|
||||
if (area == MAP_FAILED) {
|
||||
error_setg_errno(errp, errno,
|
||||
"unable to map backing store for guest RAM");
|
||||
@@ -1937,6 +1943,11 @@ static void ram_block_add(RAMBlock *new_block, Error **errp, bool shared)
|
||||
QEMU_MADV_DONTFORK);
|
||||
}
|
||||
ram_block_notify_add(new_block->host, new_block->max_length);
|
||||
+ if (enable_mlock) {
|
||||
+ if (mlock(new_block->host, new_block->max_length) < 0) {
|
||||
+ perror("mlock");
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/softmmu/vl.c b/softmmu/vl.c
|
||||
index a398697d0d..527fe4e961 100644
|
||||
--- a/softmmu/vl.c
|
||||
+++ b/softmmu/vl.c
|
||||
@@ -2,6 +2,7 @@
|
||||
* QEMU System Emulator
|
||||
*
|
||||
* Copyright (c) 2003-2008 Fabrice Bellard
|
||||
+ * Copyright (c) 2013-2016 Wind River Systems, Inc. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -38,6 +39,7 @@
|
||||
#include "sysemu/tcg.h"
|
||||
#include "sysemu/xen.h"
|
||||
|
||||
+#include "qemu-common.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "sysemu/accel.h"
|
||||
@@ -1111,10 +1113,8 @@ static QemuOptsList qemu_smp_opts = {
|
||||
static void realtime_init(void)
|
||||
{
|
||||
if (enable_mlock) {
|
||||
- if (os_mlock() < 0) {
|
||||
- error_report("locking memory failed");
|
||||
- exit(1);
|
||||
- }
|
||||
+ /* WRS - do not call os_mlock(), prevent call to mlockall */
|
||||
+ ;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.25.1
|
@ -1,95 +0,0 @@
|
||||
From ad19f7aad9e2ff9a007eddbd9a19b61a9c1af769 Mon Sep 17 00:00:00 2001
|
||||
From: Jim Somerville <Jim.Somerville@windriver.com
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: Suspend/Resume for VMs with PCIPT+Virtio
|
||||
|
||||
When we have a Passthrough or a SR-IOV device, the plug/unplug of these
|
||||
devices causes the guest memory map to change.
|
||||
|
||||
When the vhost code in qemu detects that the guest memory map changed,
|
||||
it verifies that the virtio vring mappings into its own address space
|
||||
did not change and sends the vhost backend the VHOST_SET_MEM_TABLE
|
||||
message so that the backend can update its mapping based on the new
|
||||
guest memory map.
|
||||
|
||||
If this guest memory map change happens after the virtio device has
|
||||
been initialized and started, we get into the situation where ports
|
||||
are brought down as part of the VHOST_SET_MEM_TABLE message handling
|
||||
and has nothing to restart the device.
|
||||
|
||||
The root cause of this issue was that the mappings for the vring was
|
||||
changing when we get a new VHOST_USER_SET_MEM_TABLE message and we
|
||||
were trying to restart the device with the old vring mapping.
|
||||
|
||||
The correct fix is to send a VHOST_SET_VRING_ADDR message from qemu
|
||||
which will force the mapping to be recalculated based on the new
|
||||
memory map.
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
[ Trimmed the shortlog ]
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
hw/virtio/vhost.c | 26 +++++++++++++++++++++++++-
|
||||
1 file changed, 25 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
|
||||
index 614ccc2bcb..05c045925a 100644
|
||||
--- a/hw/virtio/vhost.c
|
||||
+++ b/hw/virtio/vhost.c
|
||||
@@ -61,6 +61,10 @@ bool vhost_has_free_slot(void)
|
||||
return slots_limit > used_memslots;
|
||||
}
|
||||
|
||||
+static int vhost_virtqueue_set_addr(struct vhost_dev *dev,
|
||||
+ struct vhost_virtqueue *vq,
|
||||
+ unsigned idx, bool enable_log);
|
||||
+
|
||||
static void vhost_dev_sync_region(struct vhost_dev *dev,
|
||||
MemoryRegionSection *section,
|
||||
uint64_t mfirst, uint64_t mlast,
|
||||
@@ -448,6 +452,21 @@ static void vhost_begin(MemoryListener *listener)
|
||||
dev->n_tmp_sections = 0;
|
||||
}
|
||||
|
||||
+static void vhost_update_backend_ring_mappings(struct vhost_dev *dev)
|
||||
+{
|
||||
+ int i,r;
|
||||
+
|
||||
+ if(dev->vhost_ops->backend_type != VHOST_BACKEND_TYPE_USER) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < dev->nvqs; ++i) {
|
||||
+ r = vhost_virtqueue_set_addr(dev, dev->vqs + i, i, dev->log_enabled);
|
||||
+ assert(r >= 0);
|
||||
+ }
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
static void vhost_commit(MemoryListener *listener)
|
||||
{
|
||||
struct vhost_dev *dev = container_of(listener, struct vhost_dev,
|
||||
@@ -524,7 +543,7 @@ static void vhost_commit(MemoryListener *listener)
|
||||
if (r < 0) {
|
||||
VHOST_OPS_DEBUG("vhost_set_mem_table failed");
|
||||
}
|
||||
- goto out;
|
||||
+ goto vring_mapping;
|
||||
}
|
||||
log_size = vhost_get_log_size(dev);
|
||||
/* We allocate an extra 4K bytes to log,
|
||||
@@ -543,6 +562,11 @@ static void vhost_commit(MemoryListener *listener)
|
||||
vhost_dev_log_resize(dev, log_size);
|
||||
}
|
||||
|
||||
+vring_mapping:
|
||||
+ /* For vhost-user backend, update the vring mappings after we sent a new
|
||||
+ * guest memory map. */
|
||||
+ vhost_update_backend_ring_mappings(dev);
|
||||
+
|
||||
out:
|
||||
/* Deref the old list of sections, this must happen _after_ the
|
||||
* vhost_set_mem_table to ensure the client isn't still using the
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,32 +0,0 @@
|
||||
From 862773099be4c599cf2885cb8b0f706b01964157 Mon Sep 17 00:00:00 2001
|
||||
From: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: Modify live migration auto-converge threshold
|
||||
|
||||
Currently the live migration auto-converge can throttle a VM
|
||||
vcpus time to 99%. This value for "max cpu trottling percentage"
|
||||
causes some detaches to fail. Based on characterization results,
|
||||
we set this value to 92.
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
[ Trimmed the shortlog ]
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
softmmu/cpu-throttle.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/softmmu/cpu-throttle.c b/softmmu/cpu-throttle.c
|
||||
index 2ec4b8e0bc..211c074f8d 100644
|
||||
--- a/softmmu/cpu-throttle.c
|
||||
+++ b/softmmu/cpu-throttle.c
|
||||
@@ -35,7 +35,7 @@ static QEMUTimer *throttle_timer;
|
||||
static unsigned int throttle_percentage;
|
||||
|
||||
#define CPU_THROTTLE_PCT_MIN 1
|
||||
-#define CPU_THROTTLE_PCT_MAX 99
|
||||
+#define CPU_THROTTLE_PCT_MAX 92
|
||||
#define CPU_THROTTLE_TIMESLICE_NS 10000000
|
||||
|
||||
static void cpu_throttle_thread(CPUState *cpu, run_on_cpu_data opaque)
|
||||
--
|
||||
2.25.1
|
@ -1,41 +0,0 @@
|
||||
From 80c5f13e549cb59adc781335c4d6a8f81f578615 Mon Sep 17 00:00:00 2001
|
||||
From: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
Date: Fri, 26 Apr 2019 17:41:04 -0300
|
||||
Subject: [PATCH] STX: virtio-serial: don't touch virtqueue if vm is stopped
|
||||
Candidate for upstreaming.
|
||||
|
||||
During migration there is a window where virtio-serial
|
||||
data has been transmitted to the receiving side, but
|
||||
the region caches haven't been initialized there yet.
|
||||
This causes an assertion fail crash.
|
||||
|
||||
The fix is inspired by:
|
||||
|
||||
70e53e6 virtio-net: don't touch virtqueue if vm is stopped
|
||||
|
||||
We remove the call to virtio_queue_ready as it is covered
|
||||
by the call to virtio_queue_empty already, and replace it
|
||||
with a test to ensure that the vm is running.
|
||||
|
||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
||||
[ Trimmed the shortlog ]
|
||||
Signed-off-by: Rafael Falcao <Rafael.VieiraFalcao@windriver.com>
|
||||
---
|
||||
hw/char/virtio-serial-bus.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
|
||||
index cf08ef9728..9b4b258413 100644
|
||||
--- a/hw/char/virtio-serial-bus.c
|
||||
+++ b/hw/char/virtio-serial-bus.c
|
||||
@@ -311,7 +311,7 @@ size_t virtio_serial_guest_ready(VirtIOSerialPort *port)
|
||||
VirtQueue *vq = port->ivq;
|
||||
unsigned int bytes;
|
||||
|
||||
- if (!virtio_queue_ready(vq) ||
|
||||
+ if (!vdev->vm_running ||
|
||||
!(vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) ||
|
||||
virtio_queue_empty(vq)) {
|
||||
return 0;
|
||||
--
|
||||
2.25.1
|
@ -1,11 +0,0 @@
|
||||
0001-STX-Add-support-statement-to-help-output.patch
|
||||
0002-STX-migration-thread-affinity-and-priority-qmp.patch
|
||||
0003-STX-qemu-dpdk-changes-for-openvswitch-dpdk.patch
|
||||
0004-STX-qemu-add-enable-dpdk-runtime-flag.patch
|
||||
0005-STX-qemu-add-compile-define-for-CONFIG_DPDK.patch
|
||||
0006-STX-add-libdl.patch
|
||||
0007-STX-qemu-dpdk-custom-config.patch
|
||||
0008-STX-realtime-uses-mlock-instead-of-mlockall.patch
|
||||
0009-STX-Suspend-Resume-for-VMs-with-PCIPT-Virtio.patch
|
||||
0010-STX-Modify-live-migration-auto-converge-threshold.patch
|
||||
0011-STX-virtio-serial-don-t-touch-virtqueue-if-vm-is-sto.patch
|
@ -1 +0,0 @@
|
||||
options kvm-intel nested=1
|
@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# chkconfig: 2345 50 50
|
||||
#
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: qemu_clean
|
||||
# Short-Description: Clean up stale unix sockets for qemu
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
|
||||
start()
|
||||
{
|
||||
cd /var/lib/libvirt/qemu
|
||||
rm -f instance-*.monitor
|
||||
rm -f cgcs.heartbeat.*
|
||||
}
|
||||
|
||||
stop ()
|
||||
{
|
||||
# Nothing to do
|
||||
return
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,14 +0,0 @@
|
||||
[Unit]
|
||||
Description=Titanium Cloud libvirt QEMU cleanup
|
||||
After=syslog.target network.target logmgmt.service
|
||||
Before=libvirtd.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/etc/init.d/qemu_clean start
|
||||
ExecStop=/etc/init.d/qemu_clean stop
|
||||
ExecReload=
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
SOURCE_SPEC=~/qemu/qemu-kvm.spec
|
||||
SOURCE_PATCH_DIR=~/qemu/
|
||||
|
||||
# Base patch order on the '%patch' statements (not 'Patchx:' definition)
|
||||
for patch in `cat $SOURCE_SPEC | grep '%patch[0-9]\{1,\} ' | awk '{print $1'}`; do
|
||||
# Resolve patch name base on it's id/number
|
||||
id=`echo $patch | sed 's/%patch//'`
|
||||
p=`grep "Patch$id:" $SOURCE_SPEC | awk '{print $2}'`
|
||||
|
||||
echo "-> Processing patch: $p"
|
||||
git am -3 $SOURCE_PATCH_DIR/$p
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "--> Failed, falling back to manual patching"
|
||||
git am --abort
|
||||
# patch -p1 < $SOURCE_PATCH_DIR/$p
|
||||
git apply --index $SOURCE_PATCH_DIR/$p
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "--> Failed manual patching, abort"
|
||||
else
|
||||
git add -A
|
||||
git commit -m "Manual patch apply: $p"
|
||||
fi
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue
Block a user