[PATCH] rpm: Fix conditional for defining %_vpath_builddir for RHEL <= 7
by Neal Gompa
The conditional was incorrectly overriding %_vpath_builddir when
%rhel is not defined, which led to surprising behavior when the
global %_vpath_builddir path is set on Fedora already.
Signed-off-by: Neal Gompa <ngompa13(a)gmail.com>
---
libvirt.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index bb74443484..4b9e04ae61 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -32,7 +32,7 @@
%endif
# On RHEL 7 and older macro _vpath_builddir is not defined.
-%if 0%{?rhel} <= 7
+%if 0%{?rhel} && 0%{?rhel} <= 7
%define _vpath_builddir %{_target_platform}
%endif
--
2.26.2
4 years, 2 months
[PATCH v2] qemu_validate: Only allow none address for watchdog ib700
by Han Han
Since QEMU 1.5.3, the ib700 watchdog device has no options for address,
and not address in device tree:
$ /usr/libexec/qemu-kvm -version
QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-175.el7), Copyright (c) 2003-2008 Fabrice Bellard
$ /usr/libexec/qemu-kvm -device ib700,\?
$ virsh qemu-monitor-command seabios --hmp info qtree|grep ib700 -A 2
dev: ib700, id "watchdog0"
dev: isa-serial, id "serial0"
index = 0
So only allow it to use none address.
Fixes: 8a54cc1d08a333283c9cfc3fd7788be2642ca71a
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1509908
Signed-off-by: Han Han <hhan(a)redhat.com>
---
src/qemu/qemu_validate.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 488f258d00..402f81a3cd 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1637,10 +1637,9 @@ qemuValidateDomainWatchdogDef(const virDomainWatchdogDef *dev,
break;
case VIR_DOMAIN_WATCHDOG_MODEL_IB700:
- if (dev->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
- dev->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA) {
+ if (dev->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("%s model of watchdog can go only on ISA bus"),
+ _("%s model of watchdog does not support configuring the address"),
virDomainWatchdogModelTypeToString(dev->model));
return -1;
}
--
2.28.0
4 years, 2 months
[PATCH v2] qemu: Do not silently allow non-available timers on non-x86 systems
by Thomas Huth
libvirt currently silently allows <timer name="kvmclock"/> and some
other timer tags in the guest XML definition for timers that do not
exist on non-x86 systems. We should not silently ignore these tags
since the users might not get what they expected otherwise.
Note: The error is only generated if the timer is marked with
present="yes" - otherwise we would suddenly refuse XML definitions
that worked without problems before.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1754887
Signed-off-by: Thomas Huth <thuth(a)redhat.com>
---
v2: Check also for timer->present == 1
src/qemu/qemu_validate.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 488f258d00..561e7b12c7 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -371,6 +371,18 @@ qemuValidateDomainDefClockTimers(const virDomainDef *def,
case VIR_DOMAIN_TIMER_NAME_TSC:
case VIR_DOMAIN_TIMER_NAME_KVMCLOCK:
case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK:
+ if (!ARCH_IS_X86(def->os.arch) && timer->present == 1) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Configuring the '%s' timer is not supported "
+ "for virtType=%s arch=%s machine=%s guests"),
+ virDomainTimerNameTypeToString(timer->name),
+ virDomainVirtTypeToString(def->virtType),
+ virArchToString(def->os.arch),
+ def->os.machine);
+ return -1;
+ }
+ break;
+
case VIR_DOMAIN_TIMER_NAME_LAST:
break;
--
2.18.1
4 years, 2 months
[PATCH] qemu_driver.c: Fix domfsinfo for non-PCI device information from guest agent
by Thomas Huth
qemuAgentFSInfoToPublic() currently only sets the devAlias for PCI devices.
However, the QEMU guest agent could also provide the device name in the
"dev" field of the response for other devices instead (well, at least after
fixing another problem in the current QEMU guest agent...). So if creating
the devAlias from the PCI information failed, let's fall back to the name
provided by the guest agent. This helps to fix the empty "Target" fields
that occur when running "virsh domfsinfo" on s390x where CCW devices are
used for the guest instead of PCI devices.
Also add a proper debug message here in case we completely failed to set the
device alias, since this problem here was very hard to debug: The only two
error messages that I've seen were "Unable to get filesystem information"
and "Unable to encode message payload" - which only indicates that something
went wrong in the RPC call. No debug message indicated the real problem, so
I had to learn the hard way why the RPC call failed (it apparently does not
like devAlias left to be NULL) and where the real problem comes from.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1755075
Signed-off-by: Thomas Huth <thuth(a)redhat.com>
---
src/qemu/qemu_driver.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d185666ed8..e45c61ee20 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -21935,14 +21935,17 @@ qemuAgentFSInfoToPublic(qemuAgentFSInfoPtr agent,
qemuAgentDiskInfoPtr agentdisk = agent->disks[i];
virDomainDiskDefPtr diskDef;
- if (!(diskDef = virDomainDiskByAddress(vmdef,
- &agentdisk->pci_controller,
- agentdisk->bus,
- agentdisk->target,
- agentdisk->unit)))
- continue;
-
- ret->devAlias[i] = g_strdup(diskDef->dst);
+ diskDef = virDomainDiskByAddress(vmdef,
+ &agentdisk->pci_controller,
+ agentdisk->bus,
+ agentdisk->target,
+ agentdisk->unit);
+ if (diskDef != NULL)
+ ret->devAlias[i] = g_strdup(diskDef->dst);
+ else if (agentdisk->devnode != NULL)
+ ret->devAlias[i] = g_strdup(agentdisk->devnode);
+ else
+ VIR_DEBUG("Missing devnode name for '%s'.", ret->mountpoint);
}
return ret;
--
2.18.1
4 years, 2 months
[RESEND][PATCH] migration: fix xml file residual during vm crash with migration
by zhengchuan
>From 935ec812b822ca978631e72bb9b9a5d00df24a42 Mon Sep 17 00:00:00 2001
From: Zheng Chuan <zhengchuan(a)huawei.com>
Date: Mon, 27 Jul 2020 14:39:05 +0800
Subject: [PATCH] migration: fix xml file residual during vm crash with
migration
when migration is cancelled (such as kill -9 vmpid in Src, etc), it could
do virDomainSaveStatus() to save xml file after qemuProcessStop(), which results
in xml residulal.
Fix it by that do not do virDomainSaveStatus() if vm is not active.
Signed-off-by: Zheng Chuan <zhengchuan(a)huawei.com>
---
src/qemu/qemu_migration.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 2c7bf34..d2804ab 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3073,6 +3073,9 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
jobPriv->migParams, priv->job.apiFlags);
+ if (!virDomainObjIsActive(vm))
+ goto done;
+
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
VIR_WARN("Failed to save status on vm %s", vm->def->name);
}
--
1.8.3.1
4 years, 2 months
[PATCH] fix vm schizencephaly when heartbeat stoped
by Yilu Lin
>From e28cb2a03a670e4c0e7641f68f9d9f3accb00ae0 Mon Sep 17 00:00:00 2001
From: Yilu Lin <linyilu(a)huawei.com>
Date: Tue, 4 Aug 2020 02:42:00 -0400
Subject: [PATCH] fix vm schizencephaly when heartbeat stoped
Signed-off-by: Yilu Lin <linyilu(a)huawei.com>
If keepalive messages lost in finish step, vm maybe schizencephaly.
Shutdown src vm for protection.
---
src/qemu/qemu_migration.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 2c7bf34..b8296ba 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -4136,6 +4136,8 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr driver,
int cookieoutlen = 0;
int ret = -1;
virErrorPtr orig_err = NULL;
+ virErrorPtr finish_err = NULL;
+ bool living = true;
bool cancelled = true;
virStreamPtr st = NULL;
unsigned long destflags;
@@ -4394,7 +4396,16 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr driver,
* The lock manager plugins should take care of
* safety in this scenario.
*/
- cancelled = ddomain == NULL;
+ if (!cancelled && !ddomain)
+ finish_err = virSaveLastError();
+
+ if (finish_err && finish_err->message &&
+ strstr(finish_err->message, "received hangup / error event on socket")) {
+ living = false;
+ VIR_ERROR(_("keepalive messages lost in finish step, shutdown src vm for protection"));
+ } else {
+ cancelled = ddomain == NULL;
+ }
/* If finish3 set an error, and we don't have an earlier
* one we need to preserve it in case confirm3 overwrites
@@ -4427,10 +4438,17 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr driver,
virObjectUnref(ddomain);
ret = 0;
} else {
- ret = -1;
+ if (!living)
+ ret = 0;
+ else
+ ret = -1;
}
virObjectUnref(st);
+ if (finish_err) {
+ virSetError(finish_err);
+ virFreeError(finish_err);
+ }
virErrorRestore(&orig_err);
VIR_FREE(uri_out);
--
2.19.1
4 years, 2 months
[PATCH 0/5] Prefer WITH_* prefix for #if conditionals
by Michal Privoznik
While I was working on the actual patch 5/5 I've found couple of
possible cleanups (patches 1-4/5).
This is all inspired by:
https://www.redhat.com/archives/libvir-list/2020-September/msg00021.html
Michal Prívozník (5):
util: Check for HAVE_NET_IF_H correctly
virfile.c: Remove some #endif comments
meson: Drop checks for some functions and header files
nss: Drop needless include of rpc/types.h
lib: Prefer WITH_* prefix for #if conditionals
build-aux/syntax-check.mk | 10 +--
docs/coding-style.rst | 2 +-
meson.build | 63 +++++++++----------
src/admin/libvirt-admin.c | 4 +-
src/conf/nwfilter_conf.c | 2 +-
src/cpu/cpu_arm.c | 8 +--
src/internal.h | 8 +--
src/libvirt.c | 4 +-
src/libxl/libxl_capabilities.c | 2 +-
src/libxl/libxl_conf.c | 4 +-
src/libxl/xen_xl.c | 2 +-
src/locking/lock_driver_sanlock.c | 2 +-
src/locking/lock_manager.c | 14 ++---
src/network/bridge_driver.c | 4 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 8 +--
src/nwfilter/nwfilter_learnipaddr.c | 10 +--
src/qemu/qemu_namespace.c | 4 +-
src/qemu/qemu_process.c | 6 +-
src/rpc/virnetsocket.c | 8 +--
src/storage/storage_backend_rbd.c | 6 +-
src/storage/storage_driver.c | 2 +-
src/storage/storage_util.c | 6 +-
src/util/iohelper.c | 2 +-
src/util/virbpf.c | 6 +-
src/util/virbpf.h | 6 +-
src/util/vircgroupv2devices.c | 10 +--
src/util/virdbus.c | 2 +-
src/util/virdbuspriv.h | 2 +-
src/util/virfile.c | 94 ++++++++++++++--------------
src/util/virgettext.c | 6 +-
src/util/virhostcpu.c | 14 ++---
src/util/virhostmem.c | 4 +-
src/util/virhostuptime.c | 12 ++--
src/util/virlog.c | 24 +++----
src/util/virmodule.c | 6 +-
src/util/virnetdev.c | 94 ++++++++++++++--------------
src/util/virnetdev.h | 4 +-
src/util/virnetdevbridge.c | 46 +++++++-------
src/util/virnetdevip.c | 16 ++---
src/util/virnetdevmacvlan.c | 2 +-
src/util/virnetdevtap.c | 6 +-
src/util/virnetlink.c | 2 +-
src/util/virnetlink.h | 2 +-
src/util/virnuma.c | 12 ++--
src/util/virperf.c | 4 +-
src/util/virprocess.c | 60 +++++++++---------
src/util/virstring.c | 8 +--
src/util/virthread.c | 4 +-
src/util/virutil.c | 24 +++----
src/util/virutil.h | 8 +--
src/util/virvsock.c | 6 +-
tests/eventtest.c | 2 +-
tests/libxlxml2domconfigtest.c | 2 +-
tests/meson.build | 2 +-
tests/securityselinuxhelper.c | 2 +-
tests/virfilemock.c | 2 +-
tests/virfiletest.c | 14 ++---
tests/virmock.h | 2 +-
tests/virmockstathelpers.c | 16 ++---
tests/virnetsockettest.c | 8 +--
tests/virnettlscontexttest.c | 2 +-
tests/virnettlshelpers.c | 2 +-
tests/virnettlshelpers.h | 2 +-
tests/virnettlssessiontest.c | 2 +-
tests/virportallocatormock.c | 2 +-
tests/virportallocatortest.c | 2 +-
tests/virstoragetest.c | 4 +-
tests/vshtabletest.c | 2 +-
tools/nss/libvirt_nss.c | 4 +-
tools/nss/libvirt_nss.h | 4 +-
tools/virt-host-validate.c | 4 +-
tools/wireshark/src/packet-libvirt.c | 3 -
72 files changed, 371 insertions(+), 377 deletions(-)
--
2.26.2
4 years, 2 months
[PATCH v2 0/9] qemu: Allow migration over UNIX sockets
by Martin Kletzander
v2:
- Allow TLS and parallel migration as well
- Use simpler unix socket URIs
KubeVirt would like to use this feature. For more information see individual
commits and changes in manpages and documentation.
Resolves: https://bugzilla.redhat.com/1638889
Martin Kletzander (9):
qemu: Use g_autofree in qemuMigrationSrcConnect
qemu: Rework qemuMigrationSrcConnect
virsh: Reuse existing variable when parsing migrate --disks-port
qemu: Rework starting NBD server for migration
tests: Add simple test for virDomainMigrateCheckNotLocal
qemu: Allow NBD migration over UNIX socket
peer2peer migration: allow connecting to local sockets
qemu: Allow migration over UNIX socket
news: qemu: Allow migration over UNIX sockets
NEWS.rst | 6 +
docs/manpages/virsh.rst | 33 ++-
docs/migration.html.in | 33 +++
include/libvirt/libvirt-domain.h | 13 ++
scripts/apibuild.py | 1 +
src/libvirt-domain.c | 11 +-
src/libvirt_internal.h | 2 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 33 ++-
src/qemu/qemu_migration.c | 354 +++++++++++++++++++++++--------
src/qemu/qemu_migration.h | 3 +
src/qemu/qemu_migration_cookie.c | 3 +-
src/qemu/qemu_migration_params.c | 9 +
src/qemu/qemu_migration_params.h | 3 +
src/qemu/qemu_monitor.c | 15 ++
src/qemu/qemu_monitor.h | 4 +
src/remote/remote_driver.c | 8 +-
src/util/viruri.c | 30 +++
src/util/viruri.h | 2 +
tests/meson.build | 1 +
tests/virmigtest.c | 91 ++++++++
tools/virsh-domain.c | 19 +-
22 files changed, 570 insertions(+), 105 deletions(-)
create mode 100644 tests/virmigtest.c
--
2.28.0
4 years, 2 months
[libvirt PATCH 0/3] AUTHORS: Convert to reStructuredText
by Andrea Bolognani
Plus some other adjustments.
Andrea Bolognani (3):
AUTHORS: Convert to reStructuredText
AUTHORS: Some small tweaks
AUTHORS: Remove Emacs file variables
AUTHORS.in | 103 -----------------------------------
AUTHORS.rst.in | 99 +++++++++++++++++++++++++++++++++
libvirt.spec.in | 2 +-
meson.build | 4 +-
scripts/meson-gen-authors.py | 2 +-
5 files changed, 103 insertions(+), 107 deletions(-)
delete mode 100644 AUTHORS.in
create mode 100644 AUTHORS.rst.in
--
2.26.2
4 years, 2 months
[PATCH] build-aux: use GNU sed for syntax-check on FreeBSD
by Roman Bogorodskiy
BSD sed(1) and GNU sed(1) syntax are not compatible, and as
syntax-check.mk uses the GNU flavor, set SED variable to
'gsed' by default.
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
build-aux/syntax-check.mk | 8 ++++++++
1 file changed, 8 insertions(+)
I'm not sure if this requires a more comprehensive solution.
I have mixed feeling about this. If we try to just use gsed like in this
patch, it'll fail because we don't require gsed to be installed.
OTOH, an alternative solution like checking for gsed in meson.build,
and probably even generation of some files with variables to be sourced
by .mk files feels like too much of a hassle, esp. in this context.
diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index 6eb59cf90e..bbfcb63152 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -28,7 +28,15 @@ ME := build-aux/syntax-check.mk
# ignoring the module description.
AWK ?= awk
GREP ?= grep
+# FreeBSD (and probably some other OSes too) ships own version of sed(1), not
+# compatible with the GNU sed. GNU sed is available as gsed(1), so use this
+# instead
+UNAME := $(shell uname)
+ifeq ($(UNAME),FreeBSD)
+SED ?= gsed
+else
SED ?= sed
+endif
# Helper variables.
_empty =
--
2.27.0
4 years, 2 months