[libvirt] [PATCH 0/2] Fix some errors around VIR_ACCESS_DENIED
by John Ferlan
Patch 1 fixes my own error made in this release fortunately, but
only seen because I was invesigating Patch 2
Patch 2 is perhaps a longer term issue, but perhaps coming more to
light now that the nwfilter bindings have been separated and use
a virConnectOpen for nwfilter:///system during reconnection processing;
whereas, previously the filter bindings would have been "hidden" within
various nwfilter, domain, and network driver callbacks and throughs.
John Ferlan (2):
util: Fix VIR_ERR_ACCESS_DENIED formatting
qemu: Set identity for the reconnect all thread
src/qemu/qemu_process.c | 5 +++++
src/util/virerror.c | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
--
2.17.2
6 years
[libvirt] [PATCH v4 00/37] BaselineHypervisorCPU using QEMU QMP exchanges
by Chris Venteicher
Some architectures (S390) depend on QEMU to compute baseline CPU model and
expand a models feature set.
Interacting with QEMU requires starting the QEMU process and completing one or
more query-cpu-model-baseline QMP exchanges with QEMU in addition to a
query-cpu-model-expansion QMP exchange to expand all features in the model.
See "s390x CPU models: exposing features" patch set on Qemu-devel for discussion
of QEMU aspects.
This is part of resolution of: https://bugzilla.redhat.com/show_bug.cgi?id=1511999
Version 4 attempts to address all issues from V1,2,3 including making the
QEMU process activation for QMP Queries generic (not specific to capabilities)
and moving that code from qemu_capabilities to qemu_process.
Version 4 greatly expands the number of patches to make the set easier
to review.
The patches to do hypervisor baseline using QEMU are primarily in
qemu_driver.c
The patches to make the process code generic (not capabilities specific)
are mostly in qemu_process.c
Many of the patches are cut / paste of existing code. The patches that
change functionality are as modular and minimal as possible to make
reviewing easier.
I attempted to make the new qemu_process functions
consistent with the existing domain activation qemu_process functions.
A thread safe library function creates a unique directory under libDir for each QEMU
process (for QMP messaging) to decouple processes in terms of sockets and
file system footprint.
The last patch is based on past discussion of QEMU cpu
expansion only returning migratable features except for one x86 case where
non-migratable features are explicitly requested. The patch records that features
are migratable based on QEMU only returning migratable features. The main result
is the CPU xml for S390 CPU's contains the same migratability info the X86 currently
does. The testcases were updated to reflect the change.
Every patch should compile independently if applied in sequence.
Thanks,
Chris
Chris Venteicher (37):
qemu_monitor: Introduce qemuMonitorCPUModelInfoNew
qemu_monitor: Introduce qemuMonitorCPUModelInfo / JSON conversion
qemu_capabilities: Introduce virQEMuCapsMigratablePropsDiff
qemu_monitor: qemuMonitorGetCPUModelExpansion inputs and outputs
CPUModelInfo
qemu_process: Move process code from qemu_capabilities to qemu_process
qemu_process: Use qemuProcess prefix
qemu_process: Limit qemuProcessNew to const input strings
qemu_process: Refer to proc not cmd in process code
qemu_process: Use consistent name for stop process function
qemu_capabilities: Stop QEMU process before freeing
qemu_process: Use qemuProcess struct for a single process
qemu_process: Persist stderr in qemuProcess struct
qemu_capabilities: Detect caps probe failure by checking monitor ptr
qemu_process: Introduce qemuProcessStartQmp
qemu_process: Add debug message in qemuProcessLaunchQmp
qemu_process: Collect monitor code in single function
qemu_process: Store libDir in qemuProcess struct
qemu_process: Setup paths within qemuProcessInitQmp
qemu_process: Stop retaining Qemu Monitor config in qemuProcess
qemu_process: Don't open monitor if process failed
qemu_process: Cleanup qemuProcess alloc function
qemu_process: Cleanup qemuProcessStopQmp function
qemu_process: Catch process free before process stop
qemu_monitor: Make monitor callbacks optional
qemu_process: Enter QMP command mode when starting QEMU Process
qemu_process: Use unique directories for QMP processes
qemu_process: Stop locking QMP process monitor immediately
qemu_capabilities: Introduce CPUModelInfo to virCPUDef function
qemu_capabilities: Introduce virCPUDef to CPUModelInfo function
qemu_monitor: Support query-cpu-model-baseline QMP command
qemu_driver: Consolidate code to baseline using libvirt
qemu_driver: Decouple code for baseline using libvirt
qemu_driver: Identify using libvirt as a distinct way to compute
baseline
qemu_driver: Support baseline calculation using QEMU
qemu_driver: Support feature expansion via QEMU when baselining cpu
qemu_driver: Remove unsupported props in expanded hypervisor baseline
output
qemu_monitor: Default props to migratable when expanding cpu model
src/qemu/qemu_capabilities.c | 567 ++++++++----------
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_driver.c | 219 ++++++-
src/qemu/qemu_monitor.c | 184 +++++-
src/qemu/qemu_monitor.h | 29 +-
src/qemu/qemu_monitor_json.c | 226 +++++--
src/qemu/qemu_monitor_json.h | 12 +-
src/qemu/qemu_process.c | 359 +++++++++++
src/qemu/qemu_process.h | 37 ++
tests/cputest.c | 11 +-
.../caps_2.10.0.s390x.xml | 60 +-
.../caps_2.11.0.s390x.xml | 58 +-
.../caps_2.12.0.s390x.xml | 56 +-
.../qemucapabilitiesdata/caps_2.8.0.s390x.xml | 32 +-
.../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 34 +-
.../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 64 +-
tests/qemucapabilitiestest.c | 7 +
17 files changed, 1388 insertions(+), 571 deletions(-)
--
2.17.1
6 years
[libvirt] [PATCH] Add armv6l Support as guest
by infos@nafets.de
From: Stefan Schallenberg <nafets227(a)users.noreply.github.com>
Support for armv6l qemu guests has been added.
Tested with arm1176 CPU on x86.
Signed-off-by Stefan Schallenberg <infos at nafets.de>
---
docs/news.xml | 9 +++++
docs/schemas/basictypes.rng | 1 +
src/qemu/qemu_capabilities.c | 5 ++-
src/qemu/qemu_command.c | 4 +-
src/qemu/qemu_domain.c | 11 ++++--
src/qemu/qemu_domain_address.c | 6 ++-
tests/capabilityschemadata/caps-qemu-kvm.xml | 10 +++++
tests/testutilsqemu.c | 40 +++++++++++++++++++-
8 files changed, 75 insertions(+), 11 deletions(-)
diff --git a/docs/news.xml b/docs/news.xml
index 88774c55ae..b01bcbf949 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -25,6 +25,15 @@
<section title="New features">
</section>
<section title="Improvements">
+ <change>
+ <summary>
+ Add armv6l Support as guest
+ </summary>
+ <description>
+ Support for armv6l qemu guests has been added.
+ Tested with arm1176 CPU on x86.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
</section>
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 14a3670e5c..8a01b854c0 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -380,6 +380,7 @@
<value>aarch64</value>
<value>alpha</value>
<value>armv7l</value>
+ <value>armv6l</value>
<value>cris</value>
<value>i686</value>
<value>ia64</value>
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 2ca5af3297..4871e89324 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -618,7 +618,7 @@ static const char *virQEMUCapsArchToString(virArch arch)
{
if (arch == VIR_ARCH_I686)
return "i386";
- else if (arch == VIR_ARCH_ARMV7L)
+ else if (arch == VIR_ARCH_ARMV6L || arch == VIR_ARCH_ARMV7L)
return "arm";
else if (arch == VIR_ARCH_OR32)
return "or32";
@@ -2179,7 +2179,7 @@ static const char *preferredMachines[] =
{
NULL, /* VIR_ARCH_NONE (not a real arch :) */
"clipper", /* VIR_ARCH_ALPHA */
- NULL, /* VIR_ARCH_ARMV6L (no QEMU impl) */
+ "versatilepb", /* VIR_ARCH_ARMV6L */
"integratorcp", /* VIR_ARCH_ARMV7L */
"integratorcp", /* VIR_ARCH_ARMV7B */
@@ -4157,6 +4157,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
/* GIC capabilities, eg. available GIC versions */
if ((qemuCaps->arch == VIR_ARCH_AARCH64 ||
+ qemuCaps->arch == VIR_ARCH_ARMV6L ||
qemuCaps->arch == VIR_ARCH_ARMV7L) &&
virQEMUCapsProbeQMPGICCapabilities(qemuCaps, mon) < 0)
goto cleanup;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f59cbf559e..2aa5dab049 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9072,7 +9072,9 @@ static bool
qemuChrIsPlatformDevice(const virDomainDef *def,
virDomainChrDefPtr chr)
{
- if (def->os.arch == VIR_ARCH_ARMV7L || def->os.arch == VIR_ARCH_AARCH64) {
+ if (def->os.arch == VIR_ARCH_ARMV6L ||
+ def->os.arch == VIR_ARCH_ARMV7L ||
+ def->os.arch == VIR_ARCH_AARCH64) {
/* pl011 (used on mach-virt) is a platform device */
if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e25afdad6b..2a757683c8 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3253,6 +3253,7 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
addPCIRoot = true;
break;
+ case VIR_ARCH_ARMV6L:
case VIR_ARCH_ARMV7L:
case VIR_ARCH_AARCH64:
addDefaultUSB = false;
@@ -3297,7 +3298,6 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
addPCIRoot = true;
break;
- case VIR_ARCH_ARMV6L:
case VIR_ARCH_ARMV7B:
case VIR_ARCH_CRIS:
case VIR_ARCH_ITANIUM:
@@ -5908,7 +5908,8 @@ qemuDomainDefaultNetModel(const virDomainDef *def,
if (ARCH_IS_S390(def->os.arch))
return "virtio";
- if (def->os.arch == VIR_ARCH_ARMV7L ||
+ if (def->os.arch == VIR_ARCH_ARMV6L ||
+ def->os.arch == VIR_ARCH_ARMV7L ||
def->os.arch == VIR_ARCH_AARCH64) {
if (STREQ(def->os.machine, "versatilepb"))
return "smc91c111";
@@ -9691,7 +9692,8 @@ bool
qemuDomainMachineIsARMVirt(const char *machine,
const virArch arch)
{
- if (arch != VIR_ARCH_ARMV7L &&
+ if (arch != VIR_ARCH_ARMV6L &&
+ arch != VIR_ARCH_ARMV7L &&
arch != VIR_ARCH_AARCH64)
return false;
@@ -10497,7 +10499,8 @@ qemuDomainSupportsNicdev(virDomainDefPtr def,
virDomainNetDefPtr net)
{
/* non-virtio ARM nics require legacy -net nic */
- if (((def->os.arch == VIR_ARCH_ARMV7L) ||
+ if (((def->os.arch == VIR_ARCH_ARMV6L) ||
+ (def->os.arch == VIR_ARCH_ARMV7L) ||
(def->os.arch == VIR_ARCH_AARCH64)) &&
net->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO &&
net->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 27c9bfb946..64a6595717 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -468,7 +468,8 @@ static void
qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps)
{
- if (def->os.arch != VIR_ARCH_ARMV7L &&
+ if (def->os.arch != VIR_ARCH_ARMV6L &&
+ def->os.arch != VIR_ARCH_ARMV7L &&
def->os.arch != VIR_ARCH_AARCH64)
return;
@@ -2185,7 +2186,8 @@ static bool
qemuDomainSupportsPCI(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps)
{
- if ((def->os.arch != VIR_ARCH_ARMV7L) &&
+ if ((def->os.arch != VIR_ARCH_ARMV6L) &&
+ (def->os.arch != VIR_ARCH_ARMV7L) &&
(def->os.arch != VIR_ARCH_AARCH64) &&
!ARCH_IS_RISCV(def->os.arch))
return true;
diff --git a/tests/capabilityschemadata/caps-qemu-kvm.xml b/tests/capabilityschemadata/caps-qemu-kvm.xml
index 1aa98d140f..01cebcab16 100644
--- a/tests/capabilityschemadata/caps-qemu-kvm.xml
+++ b/tests/capabilityschemadata/caps-qemu-kvm.xml
@@ -81,6 +81,16 @@
</features>
</guest>
+<guest>
+ <os_type>hvm</os_type>
+ <arch name='armv7l'>
+ <wordsize>32</wordsize>
+ <emulator>/usr/bin/qemu-system-arm</emulator>
+ <machine>versatilepb</machine>
+ <domain type='qemu'/>
+ </arch>
+ </guest>
+
<guest>
<os_type>hvm</os_type>
<arch name='armv7l'>
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 332885eb77..1c60aaee03 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -392,7 +392,39 @@ static int testQemuAddS390Guest(virCapsPtr caps)
return -1;
}
-static int testQemuAddArmGuest(virCapsPtr caps)
+static int testQemuAddArm6Guest(virCapsPtr caps)
+{
+ static const char *machines[] = { "versatilepb" };
+ virCapsGuestMachinePtr *capsmachines = NULL;
+ virCapsGuestPtr guest;
+
+ capsmachines = virCapabilitiesAllocMachines(machines,
+ ARRAY_CARDINALITY(machines));
+ if (!capsmachines)
+ goto error;
+
+ guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_ARMV6L,
+ QEMUBinList[TEST_UTILS_QEMU_BIN_ARM],
+ NULL,
+ ARRAY_CARDINALITY(machines),
+ capsmachines);
+ if (!guest)
+ goto error;
+
+ if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL))
+ goto error;
+ if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_KVM,
+ NULL, NULL, 0, NULL))
+ goto error;
+
+ return 0;
+
+ error:
+ virCapabilitiesFreeMachines(capsmachines, ARRAY_CARDINALITY(machines));
+ return -1;
+}
+
+static int testQemuAddArm7Guest(virCapsPtr caps)
{
static const char *machines[] = { "vexpress-a9",
"vexpress-a15",
@@ -426,6 +458,7 @@ static int testQemuAddArmGuest(virCapsPtr caps)
return -1;
}
+
static int testQemuAddAARCH64Guest(virCapsPtr caps)
{
static const char *machines[] = { "virt"};
@@ -514,7 +547,10 @@ virCapsPtr testQemuCapsInit(void)
if (testQemuAddS390Guest(caps))
goto cleanup;
- if (testQemuAddArmGuest(caps))
+ if (testQemuAddArm6Guest(caps))
+ goto cleanup;
+
+ if (testQemuAddArm7Guest(caps))
goto cleanup;
if (testQemuAddAARCH64Guest(caps))
--
2.19.1
6 years
[libvirt] [PATCH 0/2] qemu: Drop priv->gotShutdown
by Jiri Denemark
Jiri Denemark (2):
qemu: Drop unreachable code from qemuProcessHandleStop
qemu: Drop priv->gotShutdown
src/qemu/qemu_domain.h | 1 -
src/qemu/qemu_driver.c | 3 ++-
src/qemu/qemu_process.c | 13 +------------
3 files changed, 3 insertions(+), 14 deletions(-)
--
2.19.1
6 years
[libvirt] [PATCH] qemu:address:Fix segfault in qemuDomainPrimeVirtioDeviceAddresses
by Wang Yechao
On aarch64, lauch vm with the follow configuration:
<interface type="hostdev" managed="yes">
<mac address="fa:16:3e:14:41:00"/>
<source>
<address type="pci" domain="0x0000" bus="0x01" slot="0x0b" function="0x2"/>
</source>
</interface>
libvirtd will crash when access the net->model.
Signed-off-by: Wang Yechao <wang.yechao255(a)zte.com.cn>
---
src/qemu/qemu_domain_address.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 24dd7c1..27c9bfb 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -324,7 +324,8 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def,
for (i = 0; i < def->nnets; i++) {
virDomainNetDefPtr net = def->nets[i];
- if (STREQ(net->model, "virtio") &&
+ if (net->model &&
+ STREQ(net->model, "virtio") &&
net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
net->info.type = type;
}
--
1.8.3.1
6 years
[libvirt] [PATCH] news: Add entry for soft reset support in Xen
by Jim Fehlig
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
I'm torn on whether this is a new feature, improvement, or even
simply a bug fix...
docs/news.xml | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 9d98c34df2..e1d10cf7f1 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -35,6 +35,17 @@
<libvirt>
<release version="v4.10.0" date="unreleased">
<section title="New features">
+ <change>
+ <summary>
+ Xen: Add support for soft reset shutdown event
+ </summary>
+ <description>
+ The pvops Linux kernel uses soft reset to handle the crash
+ machine operation. The libxl driver now supports the soft
+ reset shutdown event, allowing proper crash handling of
+ pvops-based HVM domains.
+ </description>
+ </change>
</section>
<section title="Improvements">
</section>
--
2.18.0
6 years
[libvirt] [PATCH v2 0/3] Add "memfd" memory backing type
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Hi,
This is an alternative series from "[PATCH 0/5] Use memfd if
possible". Instead of automatically using memfd for anonymous memory
when available (as suggested by Daniel), it introduces the "memfd"
memory backing type.
Although using memfd transparently when possible is a good idea, it is
a source of various complications for migration & save/restore. This
could eventually be challenged in a different series.
The first two patches have been modified and reviewed by John
Ferlan. Hopefully they can be merged early, regardless of the last
patch outcome, to avoid the painful rebase conflicts due to
capabilities checks introduction.
Thanks
Marc-André Lureau (3):
qemu: add memory-backend-memfd capability check
qemu: check memory-backend-memfd.hugetlb capability
qemu: add memfd source type
docs/formatdomain.html.in | 9 +-
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 10 ++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 69 +++++++----
src/qemu/qemu_domain.c | 12 +-
.../caps_2.12.0.aarch64.replies | 94 ++++++++++++---
.../caps_2.12.0.aarch64.xml | 4 +-
.../caps_2.12.0.ppc64.replies | 90 +++++++++++---
.../caps_2.12.0.ppc64.xml | 4 +-
.../caps_2.12.0.s390x.replies | 98 ++++++++++++----
.../caps_2.12.0.s390x.xml | 4 +-
.../caps_2.12.0.x86_64.replies | 110 +++++++++++++-----
.../caps_2.12.0.x86_64.xml | 4 +-
.../caps_3.0.0.ppc64.replies | 90 +++++++++++---
.../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 4 +-
.../caps_3.0.0.riscv32.replies | 86 +++++++++++---
.../caps_3.0.0.riscv32.xml | 2 +
.../caps_3.0.0.riscv64.replies | 86 +++++++++++---
.../caps_3.0.0.riscv64.xml | 2 +
.../caps_3.0.0.x86_64.replies | 110 +++++++++++++-----
.../caps_3.0.0.x86_64.xml | 4 +-
.../memfd-memory-numa.x86_64-latest.args | 34 ++++++
tests/qemuxml2argvdata/memfd-memory-numa.xml | 36 ++++++
tests/qemuxml2argvtest.c | 2 +
27 files changed, 788 insertions(+), 183 deletions(-)
create mode 100644 tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/memfd-memory-numa.xml
--
2.19.0
6 years
[libvirt] [PATCH] spec: Drop support for Fedora 27
by Andrea Bolognani
In accordance with our platform support policy, now that
Fedora 29 is out we no longer support building on Fedora 27.
This allows us to remove a few version checks.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
libvirt.spec.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 90daefe6f1..71cd45c603 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -4,7 +4,7 @@
# that's still supported by the vendor. It may work on other distros
# or versions, but no effort will be made to ensure that going forward.
%define min_rhel 7
-%define min_fedora 27
+%define min_fedora 28
%if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel})
%define supported_platform 1
@@ -72,7 +72,7 @@
%endif
# We need a recent enough libiscsi (>= 1.18.0)
-%if 0%{?fedora} >= 28 || 0%{?rhel} > 7
+%if 0%{?fedora} || 0%{?rhel} > 7
%define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1}
%else
%define with_storage_iscsi_direct 0
@@ -258,7 +258,7 @@ BuildRequires: /usr/bin/pod2man
%endif
BuildRequires: gcc
BuildRequires: git
-%if 0%{?fedora} >= 27 || 0%{?rhel} > 7
+%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: perl-interpreter
%else
BuildRequires: perl
@@ -386,7 +386,7 @@ BuildRequires: wireshark-devel >= 2.1.0
BuildRequires: libssh-devel >= 0.7.0
%endif
-%if 0%{?fedora} > 27 || 0%{?rhel} > 7
+%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: rpcgen
BuildRequires: libtirpc-devel
%endif
--
2.19.1
6 years
[libvirt] [PATCH v2] lxc: Clang is complaining about possible NULL pointer.
by Julio Faracco
The array "mount" inside lxc_container is not being checked before for
loop. Clang syntax scan is complaining about this segmentation fault.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
src/lxc/lxc_container.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 918194dacd..d834bf01d7 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -867,9 +867,13 @@ static int lxcContainerSetReadOnly(void)
}
}
- if (mounts)
- qsort(mounts, nmounts, sizeof(mounts[0]),
- virStringSortRevCompare);
+ if (!mounts) {
+ ret = 0;
+ goto cleanup;
+ }
+
+ qsort(mounts, nmounts, sizeof(mounts[0]),
+ virStringSortRevCompare);
for (i = 0; i < nmounts; i++) {
VIR_DEBUG("Bind readonly %s", mounts[i]);
@@ -883,9 +887,7 @@ static int lxcContainerSetReadOnly(void)
ret = 0;
cleanup:
- for (i = 0; i < nmounts; i++)
- VIR_FREE(mounts[i]);
- VIR_FREE(mounts);
+ virStringListFreeCount(mounts, nmounts);
endmntent(procmnt);
return ret;
--
2.17.1
6 years
[libvirt] [PATCH 0/3] add disk driver metadata_cache_size option
by Nikolay Shirokovskiy
Hi, all.
This is a patch series after offlist agreement on introducing
metadata-cache-size option for disks. The options itself is described in 2nd
patch of the series.
There is a plenty of attempts to add option to set qcow2 metadata cache sizes in
past, see [1] [2] to name recent that has comments I tried to address or has
work I reused to some extent.
I would like to address Peter's comment in [1] that this option is image's
option rather then disk's here. While this makes sense if we set specific cache
value that covers disk only partially, here when we have maximum policy that
covers whole disk it makes sense to set same value for all images. The setted
value is only upper limit on cache size and thus cache for every image will
grow proportionally to image data size "visible from top" eventually I guess.
And these sizes are changing during guest lifetime - thus we need set whole
disk limit for every image for 'maxium' effect.
On the other hand if we add policies different from 'maximum' it may require
per image option. Well I can't imagine name for element for backing chain that
will have cache size attribute better then 'driver'). And driver is already
used for top image so I leave it this way.
KNOWN ISSUES
1. when using -driver to configure disks in command line cache size does not
get propagated thru backing chain
2. when making external disk snapshot cache size sneak into backing file
filename and thus cache size for backing image became remembered there
3. blockcommit after such snapshot will not work because libvirt is not ready
for backing file name is reported as json sometimes
Looks like 1 can be addressed in qemu. The reason for behaviour in 2
I do not understand honestly. And 3 will be naturally addessed after
blockjobs starts working with blockdev configuration I guess.
LINKS
[1] [PATCH] qemu: Added support L2 table cache for qcow2 disk
https://www.redhat.com/archives/libvir-list/2018-July/msg00166.html
[2] [PATCH v6 0/2] Add support for qcow2 cache
https://www.redhat.com/archives/libvir-list/2017-September/msg00553.html
Nikolay Shirokovskiy (3):
qemu: caps: add drive.qcow2.l2-cache-size
xml: add disk driver metadata_cache_size option
qemu: support metadata-cache-size for blockdev
docs/formatdomain.html.in | 7 ++++
docs/schemas/domaincommon.rng | 10 +++++
src/conf/domain_conf.c | 17 ++++++++
src/conf/domain_conf.h | 9 ++++
src/qemu/qemu_block.c | 5 ++-
src/qemu/qemu_capabilities.c | 3 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 26 ++++++++++++
src/qemu/qemu_domain.c | 2 +
src/util/virstoragefile.c | 1 +
src/util/virstoragefile.h | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml | 1 +
tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml | 1 +
tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 1 +
.../qemuxml2argvdata/disk-metadata_cache_size.args | 34 +++++++++++++++
.../qemuxml2argvdata/disk-metadata_cache_size.xml | 42 +++++++++++++++++++
tests/qemuxml2argvtest.c | 2 +
.../disk-metadata_cache_size.xml | 48 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 2 +
42 files changed, 235 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/disk-metadata_cache_size.args
create mode 100644 tests/qemuxml2argvdata/disk-metadata_cache_size.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-metadata_cache_size.xml
--
1.8.3.1
6 years