[libvirt PATCH] qemu: fixing auto-detecting binary in domain capabilities
by Daniel P. Berrangé
The virConnectGetDomainCapabilities API accepts either a binary path
to the emulator, or desired guest arch. If guest arch is not given,
then the host arch is assumed.
In the case where the binary is not given, the code tried to find the
emulator binary in the existing list of cached emulator capabilities.
This is not valid since we switched to lazy population of the cache in:
commit 3dd91af01f30c5bda6328454ef49f3afece755d6
Author: Daniel P. Berrangé <berrange(a)redhat.com>
Date: Mon Dec 2 13:04:26 2019 +0000
qemu: stop creating capabilities at driver startup
As a result of this change, if there are no persistent guests defined
using the requested guest architecture, virConnectGetDomainCapabilities
will fail to find an emulator binary.
The solution is to stop relying on the cached capabilities to find the
binary and instead use the same logic we use to pick default a binary
per arch when populating capabilities.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 42 ++++++++++++++++--------------------
1 file changed, 19 insertions(+), 23 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 498348ad58..9017e8d920 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5280,10 +5280,12 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
const char **retMachine)
{
int virttype = VIR_DOMAIN_VIRT_NONE;
- int arch = virArchFromHost();
+ virArch hostarch = virArchFromHost();
+ virArch arch = hostarch;
virDomainVirtType capsType;
virQEMUCapsPtr qemuCaps = NULL;
virQEMUCapsPtr ret = NULL;
+ virArch arch_from_caps;
if (virttypeStr &&
(virttype = virDomainVirtTypeFromString(virttypeStr)) < 0) {
@@ -5299,31 +5301,25 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
goto cleanup;
}
- if (binary) {
- virArch arch_from_caps;
+ if (!binary)
+ binary = virQEMUCapsGetDefaultEmulator(hostarch, arch);
- if (!(qemuCaps = virQEMUCapsCacheLookup(cache, binary)))
- goto cleanup;
+ if (!(qemuCaps = virQEMUCapsCacheLookup(cache, binary)))
+ goto cleanup;
- arch_from_caps = virQEMUCapsGetArch(qemuCaps);
+ arch_from_caps = virQEMUCapsGetArch(qemuCaps);
- if (arch_from_caps != arch &&
- !((ARCH_IS_X86(arch) && ARCH_IS_X86(arch_from_caps)) ||
- (ARCH_IS_PPC(arch) && ARCH_IS_PPC(arch_from_caps)) ||
- (ARCH_IS_ARM(arch) && ARCH_IS_ARM(arch_from_caps)) ||
- (ARCH_IS_S390(arch) && ARCH_IS_S390(arch_from_caps)))) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("architecture from emulator '%s' doesn't "
- "match given architecture '%s'"),
- virArchToString(arch_from_caps),
- virArchToString(arch));
- goto cleanup;
- }
- } else {
- if (!(qemuCaps = virQEMUCapsCacheLookupByArch(cache, arch)))
- goto cleanup;
-
- binary = virQEMUCapsGetBinary(qemuCaps);
+ if (arch_from_caps != arch &&
+ !((ARCH_IS_X86(arch) && ARCH_IS_X86(arch_from_caps)) ||
+ (ARCH_IS_PPC(arch) && ARCH_IS_PPC(arch_from_caps)) ||
+ (ARCH_IS_ARM(arch) && ARCH_IS_ARM(arch_from_caps)) ||
+ (ARCH_IS_S390(arch) && ARCH_IS_S390(arch_from_caps)))) {
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("architecture from emulator '%s' doesn't "
+ "match given architecture '%s'"),
+ virArchToString(arch_from_caps),
+ virArchToString(arch));
+ goto cleanup;
}
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM))
--
2.23.0
4 years, 10 months
[libvirt PATCH] src: conditionalize / remove use of sys/ioctl.h
by Daniel P. Berrangé
Remove many imports of sys/ioctl.h which are redundant,
and conditionalize remaining usage that needs to compile
on Windows platforms.
The previous change to remove the "nonblocking" gnulib
module indirectly caused the loss of the "ioctl" gnulib
module that we did not explicitly list in bootstrap.conf
despite relying on.
Rather than re-introduce the "ioctl" module this patch
makes it redundant.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/util/virhostcpu.c | 4 +++-
src/util/virhostdev.c | 1 -
src/util/virhostmem.c | 1 -
src/util/virnetdev.c | 4 +++-
src/util/virnetdevbridge.c | 4 +++-
src/util/virnetdevip.c | 4 +++-
src/util/virnetdevtap.c | 4 +++-
src/util/virperf.c | 4 +++-
src/util/virvsock.c | 4 +++-
9 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index f9d5db59b9..0bde532a0c 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -24,7 +24,9 @@
#include <dirent.h>
#include <sys/utsname.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#include <unistd.h>
#if HAVE_LINUX_KVM_H
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 9b4ea30216..f8f7989206 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -22,7 +22,6 @@
#include <config.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c
index 9c08b9bd78..f37d1ad588 100644
--- a/src/util/virhostmem.c
+++ b/src/util/virhostmem.c
@@ -23,7 +23,6 @@
#include <sys/utsname.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
#include <unistd.h>
#if defined(__FreeBSD__) || defined(__APPLE__)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index e2aad07c24..b896a7507e 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -31,7 +31,9 @@
#include "virutil.h"
#include "virjson.h"
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#include <net/if.h>
#include <fcntl.h>
diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c
index a37bcb4004..5bb533f1f0 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -27,7 +27,9 @@
#include "virlog.h"
#include "virstring.h"
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index 5696bc367e..5897c4aa76 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -33,7 +33,9 @@
# include <ifaddrs.h>
#endif
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#include <net/if.h>
#include <fcntl.h>
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 6a16b58d60..8656e267cb 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -33,7 +33,9 @@
#include <unistd.h>
#include <sys/types.h>
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#include <net/if.h>
#include <fcntl.h>
#ifdef __linux__
diff --git a/src/util/virperf.c b/src/util/virperf.c
index 29c388a1f2..04d27309e1 100644
--- a/src/util/virperf.c
+++ b/src/util/virperf.c
@@ -17,7 +17,9 @@
*/
#include <config.h>
-#include <sys/ioctl.h>
+#ifndef WIN32
+# include <sys/ioctl.h>
+#endif
#if defined HAVE_SYS_SYSCALL_H
# include <sys/syscall.h>
#endif
diff --git a/src/util/virvsock.c b/src/util/virvsock.c
index b28287fdee..2638c5095a 100644
--- a/src/util/virvsock.c
+++ b/src/util/virvsock.c
@@ -17,7 +17,9 @@
#include <config.h>
-#include <sys/ioctl.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
#if HAVE_DECL_VHOST_VSOCK_SET_GUEST_CID
# include <linux/vhost.h>
--
2.24.1
4 years, 10 months
[libvirt PATCH] bhyve: fix typos checking CPU dies
by Daniel P. Berrangé
This fixes a build bug introduced by
commit fbf27730a36da573b1065c179f4d96b9a751f22f
Author: Daniel P. Berrangé <berrange(a)redhat.com>
Date: Mon Dec 16 11:16:51 2019 +0000
conf: add support for specifying CPU "dies" parameter
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a build fix for FreeBSD
src/bhyve/bhyve_command.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index d78221aea8..a8bfc0aa72 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -453,10 +453,10 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn,
/* CPUs */
virCommandAddArg(cmd, "-c");
if (def->cpu && def->cpu->sockets) {
- if (def->dies != 1) {
+ if (def->cpu->dies != 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Only 1 die per socket is supported"));
- goto cleanup;
+ goto error;
}
if (nvcpus != def->cpu->sockets * def->cpu->cores * def->cpu->threads) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
--
2.23.0
4 years, 10 months
[libvirt PATCH v2 00/13] even less gnulib: 25 more modules purged, leaving 25 to go
by Daniel P. Berrangé
A continued effort to purge gnulib from the libvirt build
system. The bulk of the win comes from implementing our
own Winsock portability wrappers. The use of GSocket turned
out to have many complications, making it hard for us to
achieve the same level of functionality as we currently
have. Thus we take a simpler wrapping approach that GNULIB
does for Winsock too.
Changed in v2:
- Don't import intprops.h, use replacement macros instead
- Various fixes to windows socket portability patch and
actually verify virsh works
- Simplify some ifdef checks to use WIN32 instead of a more
complex conditional
Daniel P. Berrangé (13):
src: replace use of INT_BUFSIZE_BOUND macros
src: remove use of the INT_MULTIPLY_OVERFLOW macro
tests: always declare environ
build: validate headers against local gnulib not git repo
util: add detection of openpty function
util: introduce compat wrappers for Winsock2
src: convert code to use new socket portability wrappers
util: pull gnulib physmem impl into local code
util: replace atomic ops impls with g_atomic_int*
src: replace verify(expr) with G_STATIC_ASSERT(expr)
src: conditionally exclude cfmakeraw/termios.h on WIN32
src: replace gmtime_r/localtime_r/strftime with GDateTime
bootstrap: remove 25 more gnulib modules
bootstrap.conf | 50 ---
build-aux/syntax-check.mk | 29 +-
configure.ac | 5 +-
examples/c/misc/event-test.c | 12 +-
m4/virt-manywarnings.m4 | 339 ++++++++++++++++++++
m4/virt-warnings.m4 | 115 +++++++
src/conf/capabilities.c | 1 -
src/conf/domain_conf.c | 11 +-
src/conf/snapshot_conf.h | 2 +-
src/conf/virdomaincheckpointobjlist.c | 8 +-
src/esx/esx_network_driver.c | 2 +-
src/esx/esx_storage_backend_iscsi.c | 2 +-
src/esx/esx_storage_backend_vmfs.c | 2 +-
src/hyperv/hyperv_driver.c | 3 +-
src/internal.h | 3 +-
src/libvirt-domain.c | 6 +-
src/libxl/libxl_domain.c | 12 +-
src/libxl/libxl_driver.c | 2 +-
src/libxl/xen_xm.c | 3 +-
src/lxc/lxc_process.c | 4 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 10 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 35 +-
src/nwfilter/nwfilter_learnipaddr.c | 14 +-
src/qemu/qemu_blockjob.h | 4 +-
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_command.c | 17 +-
src/qemu/qemu_driver.c | 12 +-
src/qemu/qemu_firmware.h | 2 +-
src/qemu/qemu_migration_params.c | 2 +-
src/qemu/qemu_process.c | 4 +-
src/remote/remote_daemon_dispatch.c | 15 +-
src/remote/remote_driver.c | 5 +-
src/rpc/virnetsocket.c | 34 +-
src/util/Makefile.inc.am | 3 +
src/util/virarch.c | 3 +-
src/util/viratomic.h | 351 +-------------------
src/util/vircgroup.h | 2 +-
src/util/vircrypto.c | 2 +-
src/util/virenum.h | 8 +-
src/util/virfdstream.c | 10 +-
src/util/virfile.c | 25 +-
src/util/virhostcpu.c | 4 +-
src/util/virhostmem.c | 182 +++++++++--
src/util/virinitctl.c | 4 +-
src/util/virkeycode.c | 22 +-
src/util/virlog.c | 3 +-
src/util/virmacaddr.h | 2 +-
src/util/virnetdevbridge.c | 10 +-
src/util/virobject.h | 8 +-
src/util/virperf.c | 2 +-
src/util/virpidfile.c | 7 +-
src/util/virportallocator.c | 8 +-
src/util/virprocess.c | 2 +-
src/util/virsocket.c | 369 ++++++++++++++++++++++
src/util/virsocket.h | 92 ++++++
src/util/virstoragefile.c | 4 +-
src/util/virstring.h | 2 +
src/util/virtime.c | 35 +-
src/util/virtypedparam.h | 2 +-
src/util/virutil.c | 33 +-
src/vz/vz_driver.c | 2 +-
tests/commandhelper.c | 3 +
tests/commandtest.c | 3 +
tests/qemuxml2argvmock.c | 12 +-
tests/viratomictest.c | 2 +-
tests/virstringtest.c | 7 +-
tests/virsystemdtest.c | 5 +-
tests/virtimetest.c | 39 ++-
tools/virsh-checkpoint.c | 20 +-
tools/virsh-domain-monitor.c | 17 +-
tools/virsh-domain.c | 15 +-
tools/virsh-network.c | 13 +-
tools/virsh-nodedev.c | 2 +-
tools/virsh-pool.c | 2 +-
tools/virsh-secret.c | 2 +-
tools/virsh-snapshot.c | 19 +-
tools/virsh.h | 1 -
tools/virt-admin.c | 55 +---
tools/virt-host-validate-common.c | 4 +-
tools/virt-login-shell.c | 7 +-
tools/vsh.c | 31 +-
tools/vsh.h | 4 +-
82 files changed, 1400 insertions(+), 827 deletions(-)
create mode 100644 m4/virt-manywarnings.m4
create mode 100644 m4/virt-warnings.m4
create mode 100644 src/util/virsocket.c
create mode 100644 src/util/virsocket.h
--
2.24.1
4 years, 10 months
Re: [libvirt] [PATCH] Don't check if the path exists for LVM
by ebennerit@gmail.com
From: Eric Benner <ebenner(a)vultr.com>
Sorry I attempted to use a mail client since SMTP wasn't working for me at the time. I cleaned up the commit, I believe this is how it needed to be.
Signed-off-by: Eric Benner <ebenner(a)vultr.com>
---
src/storage/storage_backend_logical.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index 42dec05ba0..2c60719b8c 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -641,11 +641,9 @@ virStorageBackendLogicalCheckPool(virStoragePoolObjPtr pool,
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
- /* If we can find the target.path as well as ensure that the
- * pool's def source
- */
- *isActive = virFileExists(def->target.path) &&
- virStorageBackendLogicalMatchPoolSource(pool);
+ /* Ensure that the pool's def source is correct */
+ *isActive = virStorageBackendLogicalMatchPoolSource(pool);
+
return 0;
}
--
2.24.1
4 years, 10 months
[libvirt] [PATCH v2 0/8] Don't hold both monitor and agent jobs at the same time
by Jonathon Jongsma
We have to assume that the guest agent may be malicious, so we don't want to
allow any agent queries to block any other libvirt API. By holding a monitor
job and an agent job while we're querying the agent, any other threads will be
blocked from using the monitor while the agent is unresponsive. Because libvirt
waits forever for an agent response, this makes us vulnerable to a denial of
service from a malicious (or simply buggy) guest agent.
Most of the patches in the first series were already reviewed and pushed, but a
couple remain: the filesystem info functions. The problem with these functions
is that the agent functions access the vm definition (owned by the domain). If
a monitor job is not held while this is done, the vm definition could change
while we are looking up the disk alias, leading to a potentional crash.
This series tries to fix this by moving the disk alias searching up a level
from qemu_agent.c to qemu_driver.c. The code in qemu_agent.c will only return
the raw data returned from the agent command response. After the agent response
is returned and the agent job is ended, we can then look up the disk alias from
the vm definition while the domain object is locked.
In addition, a few nearby cleanups are included in this series, notably
changing to glib allocation API in a couple of places.
Jonathon Jongsma (8):
qemu: rename qemuAgentGetFSInfoInternalDisk()
qemu: store complete agent filesystem information
qemu: Don't store disk alias in qemuAgentDiskInfo
qemu: don't access vmdef within qemu_agent.c
qemu: remove qemuDomainObjBegin/EndJobWithAgent()
qemu: use glib alloc in qemuAgentGetFSInfoFillDisks()
qemu: use glib allocation apis for qemuAgentFSInfo
Use glib alloc API for virDomainFSInfo
src/libvirt-domain.c | 12 +-
src/qemu/THREADS.txt | 58 +-----
src/qemu/qemu_agent.c | 268 ++++------------------------
src/qemu/qemu_agent.h | 33 +++-
src/qemu/qemu_domain.c | 56 +-----
src/qemu/qemu_domain.h | 7 -
src/qemu/qemu_driver.c | 246 +++++++++++++++++++++++--
src/remote/remote_daemon_dispatch.c | 2 +-
tests/qemuagenttest.c | 196 ++++----------------
9 files changed, 336 insertions(+), 542 deletions(-)
--
2.21.0
4 years, 10 months
[libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types
by Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch
introduced by cd5ff8333a.
Disable legacy option for new machine types and amend documentation.
Signed-off-by: Igor Mammedov <imammedo(a)redhat.com>
---
CC: peter.maydell(a)linaro.org
CC: ehabkost(a)redhat.com
CC: marcel.apfelbaum(a)gmail.com
CC: mst(a)redhat.com
CC: pbonzini(a)redhat.com
CC: rth(a)twiddle.net
CC: david(a)gibson.dropbear.id.au
CC: libvir-list(a)redhat.com
CC: qemu-arm(a)nongnu.org
CC: qemu-ppc(a)nongnu.org
---
hw/arm/virt.c | 2 +-
hw/core/numa.c | 6 ++++++
hw/i386/pc.c | 1 -
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
hw/ppc/spapr.c | 2 +-
qemu-deprecated.texi | 16 ----------------
qemu-options.hx | 8 ++++----
8 files changed, 14 insertions(+), 23 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index e2fbca3..49de0d8 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2049,7 +2049,6 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
hc->pre_plug = virt_machine_device_pre_plug_cb;
hc->plug = virt_machine_device_plug_cb;
hc->unplug_request = virt_machine_device_unplug_request_cb;
- mc->numa_mem_supported = true;
mc->auto_enable_numa_with_memhp = true;
mc->default_ram_id = "mach-virt.ram";
}
@@ -2153,6 +2152,7 @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 0)
static void virt_machine_4_2_options(MachineClass *mc)
{
compat_props_add(mc->compat_props, hw_compat_4_2, hw_compat_4_2_len);
+ mc->numa_mem_supported = true;
}
DEFINE_VIRT_MACHINE(4, 2)
diff --git a/hw/core/numa.c b/hw/core/numa.c
index 0970a30..3177066 100644
--- a/hw/core/numa.c
+++ b/hw/core/numa.c
@@ -117,6 +117,12 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
}
if (node->has_mem) {
+ if (!mc->numa_mem_supported) {
+ error_setg(errp, "Parameter -numa node,mem is not supported by this"
+ " machine type. Use -numa node,memdev instead");
+ return;
+ }
+
numa_info[nodenr].node_mem = node->mem;
if (!qtest_enabled()) {
warn_report("Parameter -numa node,mem is deprecated,"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 21b8290..fa8d024 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1947,7 +1947,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
hc->unplug = pc_machine_device_unplug_cb;
mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE;
mc->nvdimm_supported = true;
- mc->numa_mem_supported = true;
mc->default_ram_id = "pc.ram";
object_class_property_add(oc, PC_MACHINE_DEVMEM_REGION_SIZE, "int",
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index fa12203..0a9b9e0 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -435,6 +435,7 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)
pc_i440fx_5_0_machine_options(m);
m->alias = NULL;
m->is_default = 0;
+ m->numa_mem_supported = true;
compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len);
compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len);
}
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 84cf925..4d6e2be 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -363,6 +363,7 @@ static void pc_q35_4_2_machine_options(MachineClass *m)
{
pc_q35_5_0_machine_options(m);
m->alias = NULL;
+ m->numa_mem_supported = true;
compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len);
compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len);
}
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index bcbe1f1..2686b73 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4383,7 +4383,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
* in which LMBs are represented and hot-added
*/
mc->numa_mem_align_shift = 28;
- mc->numa_mem_supported = true;
mc->auto_enable_numa = true;
smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF;
@@ -4465,6 +4464,7 @@ static void spapr_machine_4_2_class_options(MachineClass *mc)
{
spapr_machine_5_0_class_options(mc);
compat_props_add(mc->compat_props, hw_compat_4_2, hw_compat_4_2_len);
+ mc->numa_mem_supported = true;
}
DEFINE_SPAPR_MACHINE(4_2, "4.2", false);
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 982af95..17a0e1d 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -89,22 +89,6 @@ error in the future.
The @code{-realtime mlock=on|off} argument has been replaced by the
@code{-overcommit mem-lock=on|off} argument.
-@subsection -numa node,mem=@var{size} (since 4.1)
-
-The parameter @option{mem} of @option{-numa node} is used to assign a part of
-guest RAM to a NUMA node. But when using it, it's impossible to manage specified
-RAM chunk on the host side (like bind it to a host node, setting bind policy, ...),
-so guest end-ups with the fake NUMA configuration with suboptiomal performance.
-However since 2014 there is an alternative way to assign RAM to a NUMA node
-using parameter @option{memdev}, which does the same as @option{mem} and adds
-means to actualy manage node RAM on the host side. Use parameter @option{memdev}
-with @var{memory-backend-ram} backend as an replacement for parameter @option{mem}
-to achieve the same fake NUMA effect or a properly configured
-@var{memory-backend-file} backend to actually benefit from NUMA configuration.
-In future new machine versions will not accept the option but it will still
-work with old machine types. User can check QAPI schema to see if the legacy
-option is supported by looking at MachineInfo::numa-mem-supported property.
-
@subsection -numa node (without memory specified) (since 4.1)
Splitting RAM by default between NUMA nodes has the same issues as @option{mem}
diff --git a/qemu-options.hx b/qemu-options.hx
index 709162c..55500bd 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -223,10 +223,10 @@ For example:
-numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
@end example
-@samp{mem} assigns a given RAM amount to a node. @samp{memdev}
-assigns RAM from a given memory backend device to a node. If
-@samp{mem} and @samp{memdev} are omitted in all nodes, RAM is
-split equally between them.
+Legacy @samp{mem} assigns a given RAM amount to a node (not supported for 5.0
+and newer machine types). @samp{memdev} assigns RAM from a given memory backend
+device to a node. If @samp{mem} and @samp{memdev} are omitted in all nodes, RAM
+is split equally between them.
@samp{mem} and @samp{memdev} are mutually exclusive. Furthermore,
if one node uses @samp{memdev}, all of them have to use it.
--
2.7.4
4 years, 10 months
[PATCH] qemu: Don't emit SUSPENDED_POSTCOPY event on destination
by Jiri Denemark
When pause-before-switchover QEMU capability is enabled, we get STOP
event before MIGRATION event with postcopy-active state. To properly
handle post-copy migration and emit correct events commit
v4.10.0-rc1-4-geca9d21e6c added a hack to
qemuProcessHandleMigrationStatus which translates the paused state
reason to VIR_DOMAIN_PAUSED_POSTCOPY and emits
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY event when migration state changes
to post-copy.
However, the code was effective on both sides of migration resulting in
a confusing VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY event on the destination
host, where entering post-copy mode is already properly advertised by
VIR_DOMAIN_EVENT_RESUMED_POSTCOPY event.
https://bugzilla.redhat.com/show_bug.cgi?id=1791458
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_process.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 4195042194..a7bbab9e56 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1653,6 +1653,7 @@ qemuProcessHandleMigrationStatus(qemuMonitorPtr mon G_GNUC_UNUSED,
virDomainObjBroadcast(vm);
if (status == QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY &&
+ priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT &&
virDomainObjGetState(vm, &reason) == VIR_DOMAIN_PAUSED &&
reason == VIR_DOMAIN_PAUSED_MIGRATION) {
VIR_DEBUG("Correcting paused state reason for domain %s to %s",
--
2.25.0
4 years, 10 months
[libvirt] [PATCH] util: storagefile: Properly set transport type when parsing NBD strings
by Peter Krempa
When parsing legacy NBD backing file strings such as
'nbd:unix:/tmp/sock:exportname=/' we'd fail to set the transport to
VIR_STORAGE_NET_HOST_TRANS_UNIX. This started to be a problem once we
actually started to generate config of the backing store on the command
line with -blockdev as the JSON code would try to format it as TCP and
fail with:
internal error: argument key 'host' must not have null value
Set the type properly and add a test.
This bug was found by the libguestfs test suite in:
https://bugzilla.redhat.com/show_bug.cgi?id=1791614
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/util/virstoragefile.c | 2 +-
tests/virstoragetest.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 1397f532fd..7a2af0ad94 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2964,7 +2964,7 @@ virStorageSourceParseNBDColonString(const char *nbdstr,
}
src->hosts->socket = g_strdup(backing[2]);
-
+ src->hosts->transport = VIR_STORAGE_NET_HOST_TRANS_UNIX;
} else {
src->hosts->name = g_strdup(backing[1]);
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index 2862758752..370e19252b 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -1258,6 +1258,10 @@ mymain(void)
"<source protocol='nbd' name=':test'>\n"
" <host name='example.org' port='6000'/>\n"
"</source>\n");
+ TEST_BACKING_PARSE("nbd:unix:/tmp/sock:exportname=/",
+ "<source protocol='nbd' name='/'>\n"
+ " <host transport='unix' socket='/tmp/sock'/>\n"
+ "</source>\n");
TEST_BACKING_PARSE("nbd://example.org:1234",
"<source protocol='nbd'>\n"
" <host name='example.org' port='1234'/>\n"
--
2.24.1
4 years, 10 months
[libvirt] [PATCH 0/4] virchrdev: Couple of cleanups
by Michal Privoznik
Patches 1/4 and 2/4 fix some memleaks, the rest cleans up the code a
bit.
Michal Prívozník (4):
virchrdev: Don't leak @dev member of virChrdevHashEntry struct
virchrdev: Don't leak mutex if virChrdevAlloc() fails
virchrdev: Use more g_autofree and VIR_AUTOCLOSE
virchrdev: Drop needless 'cleanup' label in virChrdevLockFileCreate()
src/conf/virchrdev.c | 48 ++++++++++++++++----------------------------
1 file changed, 17 insertions(+), 31 deletions(-)
--
2.24.1
4 years, 10 months