[libvirt] [PATCH] qemu: Adjust ATTRIBUTE_NONNULL
by John Ferlan
Commit 7bf679ae removed the @json argument from the qemuMonitorOpen
prototype; however, it did not update the ATTRIBUTE_NONNULL value
which causes a build failure for when checking is enabled such as
when lv_cv_static_analysis is enabled.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Pushing under build breaker rule.
src/qemu/qemu_monitor.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 35e3d28c22..c41428b048 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -343,7 +343,7 @@ qemuMonitorPtr qemuMonitorOpen(virDomainObjPtr vm,
unsigned long long timeout,
qemuMonitorCallbacksPtr cb,
void *opaque)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(6);
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5);
qemuMonitorPtr qemuMonitorOpenFD(virDomainObjPtr vm,
int sockfd,
qemuMonitorCallbacksPtr cb,
--
2.20.1
5 years, 5 months
[libvirt] [PATCH] maint: Add missing 'global:' tag in libvirt_public.syms
by Eric Blake
Fixes: c08fc8d1
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing as trivial
src/libvirt_public.syms | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index 75f7fdfb0c..18500ec8b2 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -820,6 +820,7 @@ LIBVIRT_5.2.0 {
} LIBVIRT_4.10.0;
LIBVIRT_5.5.0 {
+ global:
virNetworkListAllPorts;
virNetworkPortLookupByUUID;
virNetworkPortLookupByUUIDString;
--
2.20.1
5 years, 5 months
[libvirt] [PATCH v8.5 00/13] Checkpoint APIs (incremental backup saga)
by Eric Blake
This is a subset of v8 of incremental backup, focusing more on just
the checkpoint manipulation code (as this had fewer review comments
that still needed addressing). I think there is enough here that even
if this lands in 5.5 while the backup APIs slide into 5.6 that we'd
still have a reasonably usable set of APIs.
I probably still need to double-check that creating checkpoints while
an external snapshot exists gives a sane error, and that creating an
external snapshot while checkoints exist give a sane error (in both
cases, with plans to relax that error later once we finish our
design); that can be done as a patch on top of these or if I have to
respin this part of the series once more before 5.5.
I do plan on tagging a v9 label of the full backup series, but that
will be in a separate thread built on top of this one (hence naming
this one v8.5).
Since v8:
- Completely drop the virDomainHasCurrentCheckpoint API (you get the
same effect by calling virDomainCheckpointCurrent)
- Defer the virDomainCheckpointHasMetadata API for a later day (if
we ever want it); for now, all checkpoints require libvirt metadta
- Expand the code to implement Checkpoint APIs for the test driver
- rebase to master
- Defer the Backup API work to a later series
- Split out the handling of VIR_DOMAIN_CHECKPOINT_XML_SIZE into its
own patch (that one is probably the most likely to need a respin, or
even deferring it post-5.5 as adding flag support is different than
adding new API)
001/13:[----] [--] 'backup: Document new XML for checkpoints'
002/13:[0121] [FC] 'backup: Introduce virDomainCheckpoint APIs'
003/13:[0004] [FC] 'backup: Document nuances between different state capture APIs'
004/13:[0127] [FC] 'backup: Parse and output checkpoint XML'
005/13:[0111] [FC] 'backup: Allow for lists of checkpoint objects'
006/13:[----] [--] 'backup: Add new domain:checkpoint access control'
007/13:[down] 'backup: Implement checkpoint APIs for remote driver'
008/13:[0065] [FC] 'backup: Implement virsh support for checkpoints'
009/13:[down] 'snapshot: Refactor test to utilize virDomainMoment more'
010/13:[down] 'backup: test: Implement metadata tracking for checkpoint APIs'
011/13:[0184] [FC] 'backup: qemu: Implement metadata tracking for checkpoint APIs'
012/13:[0016] [FC] 'backup: Wire up qemu checkpoint commands over QMP'
013/13:[down] 'backup: qemu: Implement VIR_DOMAIN_CHECKPOINT_XML_SIZE flag'
Eric Blake (13):
backup: Document new XML for checkpoints
backup: Introduce virDomainCheckpoint APIs
backup: Document nuances between different state capture APIs
backup: Parse and output checkpoint XML
backup: Allow for lists of checkpoint objects
backup: Add new domain:checkpoint access control
backup: Implement checkpoint APIs for remote driver
backup: Implement virsh support for checkpoints
snapshot: Refactor test to utilize virDomainMoment more
backup: test: Implement metadata tracking for checkpoint APIs
backup: qemu: Implement metadata tracking for checkpoint APIs
backup: Wire up qemu checkpoint commands over QMP
backup: qemu: Implement VIR_DOMAIN_CHECKPOINT_XML_SIZE flag
include/libvirt/libvirt-domain-checkpoint.h | 149 ++
include/libvirt/libvirt-domain.h | 6 +
include/libvirt/libvirt.h | 5 +-
src/access/viraccessperm.h | 6 +
src/conf/checkpoint_conf.h | 101 ++
src/conf/domain_conf.h | 2 +
src/conf/virconftypes.h | 9 +
src/conf/virdomaincheckpointobjlist.h | 66 +
src/conf/virdomainmomentobjlist.h | 5 +-
src/conf/virdomainobjlist.h | 7 +-
src/driver-hypervisor.h | 48 +
src/qemu/qemu_block.h | 3 +
src/qemu/qemu_conf.h | 2 +
src/qemu/qemu_domain.h | 15 +
src/qemu/qemu_monitor.h | 4 +
src/qemu/qemu_monitor_json.h | 3 +
tools/virsh-checkpoint.h | 26 +
tools/virsh-completer.h | 4 +
tools/virsh-util.h | 3 +
tools/virsh.h | 1 +
docs/Makefile.am | 3 +
docs/apibuild.py | 2 +
docs/docs.html.in | 9 +-
docs/domainstatecapture.html.in | 315 ++++
docs/format.html.in | 1 +
docs/formatcheckpoint.html.in | 204 +++
docs/formatsnapshot.html.in | 2 +
docs/index.html.in | 3 +-
docs/schemas/domaincheckpoint.rng | 87 ++
libvirt.spec.in | 2 +
mingw-libvirt.spec.in | 4 +
po/POTFILES | 3 +
src/Makefile.am | 2 +
src/access/viraccessperm.c | 3 +-
src/conf/Makefile.inc.am | 4 +
src/conf/checkpoint_conf.c | 662 ++++++++
src/conf/domain_conf.c | 6 +
src/conf/virdomaincheckpointobjlist.c | 219 +++
src/conf/virdomainmomentobjlist.c | 2 +-
src/conf/virdomainobjlist.c | 11 +
src/libvirt-domain-checkpoint.c | 670 ++++++++
src/libvirt-domain.c | 18 +-
src/libvirt_private.syms | 26 +
src/libvirt_public.syms | 25 +-
src/qemu/qemu_block.c | 12 +
src/qemu/qemu_conf.c | 5 +
src/qemu/qemu_domain.c | 183 +++
src/qemu/qemu_driver.c | 868 +++++++++++
src/qemu/qemu_monitor.c | 11 +
src/qemu/qemu_monitor_json.c | 76 +
src/remote/remote_daemon_dispatch.c | 20 +
src/remote/remote_driver.c | 26 +-
src/remote/remote_protocol.x | 155 +-
src/remote_protocol-structs | 85 ++
src/rpc/gendispatch.pl | 32 +-
src/test/test_driver.c | 461 +++++-
tests/Makefile.am | 11 +-
tests/domaincheckpointxml2xmlin/empty.xml | 1 +
tests/domaincheckpointxml2xmlin/sample.xml | 7 +
tests/domaincheckpointxml2xmlin/size.xml | 4 +
tests/domaincheckpointxml2xmlout/empty.xml | 7 +
.../internal-active-invalid.xml | 53 +
.../internal-inactive-invalid.xml | 53 +
tests/domaincheckpointxml2xmlout/redefine.xml | 63 +
tests/domaincheckpointxml2xmlout/sample.xml | 12 +
tests/domaincheckpointxml2xmlout/size.xml | 11 +
tests/domaincheckpointxml2xmltest.c | 223 +++
tests/virschematest.c | 2 +
tools/Makefile.am | 1 +
tools/virsh-checkpoint.c | 1342 +++++++++++++++++
tools/virsh-completer.c | 51 +
tools/virsh-domain-monitor.c | 23 +
tools/virsh-domain.c | 9 +
tools/virsh-util.c | 11 +
tools/virsh.c | 2 +
tools/virsh.pod | 238 ++-
76 files changed, 6745 insertions(+), 61 deletions(-)
create mode 100644 include/libvirt/libvirt-domain-checkpoint.h
create mode 100644 src/conf/checkpoint_conf.h
create mode 100644 src/conf/virdomaincheckpointobjlist.h
create mode 100644 tools/virsh-checkpoint.h
create mode 100644 docs/domainstatecapture.html.in
create mode 100644 docs/formatcheckpoint.html.in
create mode 100644 docs/schemas/domaincheckpoint.rng
create mode 100644 src/conf/checkpoint_conf.c
create mode 100644 src/conf/virdomaincheckpointobjlist.c
create mode 100644 src/libvirt-domain-checkpoint.c
create mode 100644 tests/domaincheckpointxml2xmlin/empty.xml
create mode 100644 tests/domaincheckpointxml2xmlin/sample.xml
create mode 100644 tests/domaincheckpointxml2xmlin/size.xml
create mode 100644 tests/domaincheckpointxml2xmlout/empty.xml
create mode 100644 tests/domaincheckpointxml2xmlout/internal-active-invalid.xml
create mode 100644 tests/domaincheckpointxml2xmlout/internal-inactive-invalid.xml
create mode 100644 tests/domaincheckpointxml2xmlout/redefine.xml
create mode 100644 tests/domaincheckpointxml2xmlout/sample.xml
create mode 100644 tests/domaincheckpointxml2xmlout/size.xml
create mode 100644 tests/domaincheckpointxml2xmltest.c
create mode 100644 tools/virsh-checkpoint.c
--
2.20.1
5 years, 5 months
[libvirt] [PATCH] Don't parse/format vram attribute for cirrus video
by Jonathon Jongsma
Since the cirrus vga memory size isn't configurable, we can ignore any
'vram' attribute when parsing a domain definition. However, when no
value is specified, it ends up getting set to a default value of 16MB.
This 16MB value is not used anywhere (for example, it is not passed as
an argument to qemu), but is displayed in the XML definition. So by
changing this default value to 0, it will also be omitted from the XML
definition of the domain.
Fixes: rhbz#1447831
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
This is an attempt to apply the fix suggested by Gerd at
https://bugzilla.redhat.com/show_bug.cgi?id=1447831#c2. I'm not
totally confident that this is the right approach, since I'm
relatively new to the code. Another approach might be to simply close
the bug as NOTABUG since it doesn't seem that having this unused
attribute in the domain definition has any significant drawbacks.
src/conf/domain_conf.c | 2 +-
src/qemu/qemu_domain.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c69d382d70..d06e094b11 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15154,7 +15154,6 @@ virDomainVideoDefaultRAM(const virDomainDef *def,
{
switch (type) {
case VIR_DOMAIN_VIDEO_TYPE_VGA:
- case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
if (def->virtType == VIR_DOMAIN_VIRT_VBOX)
return 8 * 1024;
@@ -15172,6 +15171,7 @@ virDomainVideoDefaultRAM(const virDomainDef *def,
/* QEMU use 64M as the minimal video memory for qxl device */
return 64 * 1024;
+ case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e5c6ef3fda..7f0baf57ac 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6835,6 +6835,9 @@ qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video,
if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
!video->vgamem) {
video->vgamem = QEMU_QXL_VGAMEM_DEFAULT;
+ } else if (video->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS) {
+ /* cirrus vram is not configurable. Ignore it */
+ video->vram = 0;
}
return 0;
--
2.20.1
5 years, 5 months
[libvirt] [PATCH] virStorageSourceChainHasManagedPR: Check propely
by Michal Privoznik
In the virStorageSourceChainHasManagedPR() function we iterate
over whole backing chain trying to determine if one of the layers
has managed PR configured. But due to a typo we in fact check the
top layer only.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule.
src/util/virstoragefile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 2b1c0a5b8e..f7495ab6da 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2083,7 +2083,7 @@ virStorageSourceChainHasManagedPR(virStorageSourcePtr src)
virStorageSourcePtr n;
for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
- if (virStoragePRDefIsManaged(src->pr))
+ if (virStoragePRDefIsManaged(n->pr))
return true;
}
--
2.21.0
5 years, 5 months
[libvirt] [PATCH v2 0/7] Finish support for IA32_ARCH_CAPABILITIES MSR features
by Jiri Denemark
As promised in v1 this series contains a few additional patches which
limit usage of MSR features to QEMU that supports "unavailable-features"
CPU property.
This series intentionally enables MSR features for all QEMU versions
before restricting the usage to make this restriction more visible in
the test results.
Version 2:
- all but 2 patches from version 1 were pushed
- 5 new patches
Jiri Denemark (7):
conf: Introduce virCPUDefCheckFeatures
cpu_x86: Turn virCPUx86DataIteratorInit into a function
cpu_x86: Introduce virCPUx86FeatureIsMSR
cpu_x86: Read CPU features from IA32_ARCH_CAPABILITIES MSR
cpu_map: Introduce IA32_ARCH_CAPABILITIES MSR features
qemu: Forbid MSR features with old QEMU
qemu: Drop MSR features from host-model with old QEMU
src/conf/cpu_conf.c | 33 +++++++
src/conf/cpu_conf.h | 6 ++
src/cpu/cpu_x86.c | 96 +++++++++++++++++--
src/cpu/cpu_x86.h | 3 +
src/cpu_map/x86_features.xml | 20 ++++
src/libvirt_private.syms | 2 +
src/qemu/qemu_capabilities.c | 16 ++++
src/qemu/qemu_process.c | 29 +++++-
.../x86_64-cpuid-Core-i7-7600U-enabled.xml | 1 +
.../x86_64-cpuid-Core-i7-7600U-json.xml | 1 +
...86_64-cpuid-Xeon-Platinum-8268-enabled.xml | 1 +
.../x86_64-cpuid-Xeon-Platinum-8268-guest.xml | 4 +
.../x86_64-cpuid-Xeon-Platinum-8268-host.xml | 4 +
.../x86_64-cpuid-Xeon-Platinum-8268-json.xml | 3 +
.../qemu_4.1.0.x86_64.xml | 1 +
15 files changed, 207 insertions(+), 13 deletions(-)
--
2.22.0
5 years, 5 months
[libvirt] [PATCH] rpc: add $(SASL_CFLAGS) to libvirt_net_rpc_server_la_CFLAGS
by Daniel P. Berrangé
The files for libvirt-net-rpc-server.la refernce the sasl/sasl.h
system header but never used the $(SASL_CFLAGS) variable. This
was never noticed previously because the $(AVAHI_CLFAGS) were
set and these typically pulled in the same include directory.
When mDNS/Avahi support was removed this exposed the bug which
caused FreeBSD builds to break as /usr/local/include was no
longer searched for headers.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a build fix
src/rpc/Makefile.inc.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/rpc/Makefile.inc.am b/src/rpc/Makefile.inc.am
index e5b830605a..b8ca53c69a 100644
--- a/src/rpc/Makefile.inc.am
+++ b/src/rpc/Makefile.inc.am
@@ -111,6 +111,7 @@ libvirt_net_rpc_server_la_SOURCES = \
libvirt_net_rpc_server_la_CFLAGS = \
$(DBUS_CFLAGS) \
$(XDR_CFLAGS) \
+ $(SASL_CFLAGS) \
$(AM_CFLAGS) \
$(NULL)
libvirt_net_rpc_server_la_LDFLAGS = \
--
2.21.0
5 years, 5 months
[libvirt] [PATCH 0/5] cgroups v2 fixes and improvements
by Pavel Hrdina
Pavel Hrdina (5):
util: vircgroup: pass parent cgroup into virCgroupDetectControllersCB
util: vircgroup: improve controller detection
util: vircgroupv2: use any controller to create thread directory
util: vircgroupv2: enable CPU controller only if it's available
util: vircgroupv2: don't error out if enabling controller fails
src/util/vircgroup.c | 32 ++++++++++++++++----------------
src/util/vircgroupbackend.h | 3 ++-
src/util/vircgroupv1.c | 3 ++-
src/util/vircgroupv2.c | 36 ++++++++++++++++++++++++------------
4 files changed, 44 insertions(+), 30 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [PATCH v2] test_driver: properly handle DHCP ranges and IPv6 networks in testDomainInterfaceAddresses
by Ilias Stamatis
testDomainInterfaceAddresses always returns the same hard-coded
addresses. Change the behavior such as if there is a DHCP range defined,
addresses are returned from that pool.
The specific address returned depends on both the domain id and the
specific guest interface in an attempt to return unique addresses *most
of the time*.
Additionally, properly handle IPv6 networks which were previously
ignored completely.
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
src/test/test_driver.c | 44 +++++++++++++++++++++++++++++++++++++-----
1 file changed, 39 insertions(+), 5 deletions(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 2a0ffbc6c5..21bd95941e 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -3414,6 +3414,10 @@ static int testDomainBlockStats(virDomainPtr domain,
return ret;
}
+
+static virNetworkObjPtr testNetworkObjFindByName(testDriverPtr privconn, const char *name);
+
+
static int
testDomainInterfaceAddresses(virDomainPtr dom,
virDomainInterfacePtr **ifaces,
@@ -3422,11 +3426,15 @@ testDomainInterfaceAddresses(virDomainPtr dom,
{
size_t i;
size_t ifaces_count = 0;
+ size_t addr_offset;
int ret = -1;
char macaddr[VIR_MAC_STRING_BUFLEN];
virDomainObjPtr vm = NULL;
virDomainInterfacePtr iface = NULL;
virDomainInterfacePtr *ifaces_ret = NULL;
+ virSocketAddr addr;
+ virNetworkObjPtr net = NULL;
+ virNetworkDefPtr net_def = NULL;
virCheckFlags(0, -1);
@@ -3447,6 +3455,12 @@ testDomainInterfaceAddresses(virDomainPtr dom,
goto cleanup;
for (i = 0; i < vm->def->nnets; i++) {
+ if (!(net = testNetworkObjFindByName(dom->conn->privateData,
+ vm->def->nets[i]->data.network.name)))
+ goto cleanup;
+
+ net_def = virNetworkObjGetDef(net);
+
if (VIR_ALLOC(iface) < 0)
goto cleanup;
@@ -3460,14 +3474,33 @@ testDomainInterfaceAddresses(virDomainPtr dom,
if (VIR_ALLOC(iface->addrs) < 0)
goto cleanup;
- iface->addrs[0].type = VIR_IP_ADDR_TYPE_IPV4;
- iface->addrs[0].prefix = 24;
- if (virAsprintf(&iface->addrs[0].addr, "192.168.0.%zu", 1 + i) < 0)
- goto cleanup;
-
iface->naddrs = 1;
+ iface->addrs[0].prefix = virSocketAddrGetIPPrefix(&net_def->ips->address,
+ &net_def->ips->netmask,
+ net_def->ips->prefix);
+
+ if (net_def->ips->nranges > 0)
+ addr = net_def->ips->ranges[0].start;
+ else
+ addr = net_def->ips->address;
+
+ /* try using different addresses per different inf and domain */
+ addr_offset = 20 * (vm->def->id - 1) + i + 1;
+
+ if (net_def->ips->family && STREQ(net_def->ips->family, "ipv6")) {
+ iface->addrs[0].type = VIR_IP_ADDR_TYPE_IPV6;
+ addr.data.inet6.sin6_addr.s6_addr[15] += addr_offset;
+ } else {
+ iface->addrs[0].type = VIR_IP_ADDR_TYPE_IPV4;
+ addr.data.inet4.sin_addr.s_addr = \
+ htonl(ntohl(addr.data.inet4.sin_addr.s_addr) + addr_offset);
+ }
+
+ if (!(iface->addrs[0].addr = virSocketAddrFormat(&addr)))
+ goto cleanup;
VIR_APPEND_ELEMENT_INPLACE(ifaces_ret, ifaces_count, iface);
+ virNetworkObjEndAPI(&net);
}
VIR_STEAL_PTR(*ifaces, ifaces_ret);
@@ -3475,6 +3508,7 @@ testDomainInterfaceAddresses(virDomainPtr dom,
cleanup:
virDomainObjEndAPI(&vm);
+ virNetworkObjEndAPI(&net);
if (ifaces_ret) {
for (i = 0; i < ifaces_count; i++)
--
2.22.0
5 years, 5 months
[libvirt] [PATCH 0/4] cgroups: add support for BFQ scheduler
by Pavel Hrdina
Pavel Hrdina (4):
util: vircgroup: introduce virCgroup(Get|Set)ValueRaw
util: vircgroup: move virCgroupGetValueStr out of
virCgroupGetValueForBlkDev
util: vircgroupv1: add support for BFQ blkio files
util: vircgroupv2: add support for BFQ files
src/util/vircgroup.c | 70 +++++++++-------
src/util/vircgrouppriv.h | 12 ++-
src/util/vircgroupv1.c | 174 +++++++++++++++++++++++++++++----------
src/util/vircgroupv2.c | 156 +++++++++++++++++++++++++----------
4 files changed, 292 insertions(+), 120 deletions(-)
--
2.21.0
5 years, 5 months