[libvirt] [PATCH libvirt-glib] examples: make detail strings match event details
by Guido Günther
---
examples/event-test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/event-test.c b/examples/event-test.c
index 7c9f4ec..a204485 100644
--- a/examples/event-test.c
+++ b/examples/event-test.c
@@ -78,7 +78,7 @@ static const char *eventDetailToString(int event, int detail) {
break;
case VIR_DOMAIN_EVENT_SUSPENDED:
if (detail == VIR_DOMAIN_EVENT_SUSPENDED_PAUSED)
- ret = "Unpaused";
+ ret = "Paused";
else if (detail == VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED)
ret = "Migrated";
break;
@@ -103,7 +103,7 @@ static const char *eventDetailToString(int event, int detail) {
ret = "Migrated";
break;
case VIR_DOMAIN_EVENT_STOPPED_SAVED:
- ret = "Failed";
+ ret = "Saved";
break;
case VIR_DOMAIN_EVENT_STOPPED_FAILED:
ret = "Failed";
--
2.11.0
8 years
[libvirt] [PATCH] util: fix build on non-Linux
by Roman Bogorodskiy
Fix typo in virNetDevPFGetVF() stub:
ATTRUBUTE_UNUSED -> ATTRIBUTE_UNUSED.
While here, use common indent style for arguments in
virNetDevGetVirtualFunctionIndex() stub.
---
Pushed under the build-breaker rule.
src/util/virnetdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index b9e9cbe54..93a931912 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1493,8 +1493,8 @@ virNetDevIsVirtualFunction(const char *ifname ATTRIBUTE_UNUSED)
int
virNetDevGetVirtualFunctionIndex(const char *pfname ATTRIBUTE_UNUSED,
- const char *vfname ATTRIBUTE_UNUSED,
- int *vf_index ATTRIBUTE_UNUSED)
+ const char *vfname ATTRIBUTE_UNUSED,
+ int *vf_index ATTRIBUTE_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
_("Unable to get virtual function index on this platform"));
@@ -1513,7 +1513,7 @@ virNetDevGetPhysicalFunction(const char *ifname ATTRIBUTE_UNUSED,
int
virNetDevPFGetVF(const char *pfname ATTRIBUTE_UNUSED,
int vf ATTRIBUTE_UNUSED,
- char **vfname ATTRUBUTE_UNUSED)
+ char **vfname ATTRIBUTE_UNUSED)
{
virReportSystemError(ENOSYS, "%s",
_("Unable to get virtual function name on this platform"));
--
2.11.0
8 years
[libvirt] [PATCH] Coverity fix for virNetDevIPCheckIPv6ForwardingCallback
by Cédric Bosdonnat
Add check for more than one RTA_OIF, even though this is rather
unlikely and get rid of the buggy switch / break.
---
src/util/virnetdevip.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index c9ac6baf7..f5662413a 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -556,15 +556,17 @@ virNetDevIPCheckIPv6ForwardingCallback(const struct nlmsghdr *resp,
if (resp->nlmsg_type != RTM_NEWROUTE)
return ret;
- /* Extract a few attributes */
+ /* Extract a device ID attribute */
for (rta = RTM_RTA(rtmsg); RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) {
- switch (rta->rta_type) {
- case RTA_OIF:
+ if (rta->rta_type == RTA_OIF) {
oif = *(int *)RTA_DATA(rta);
+ /* Should never happen: netlink message would be broken */
+ if (ifname)
+ goto error;
+
if (!(ifname = virNetDevGetName(oif)))
goto error;
- break;
}
}
--
2.12.0
8 years
[libvirt] [PATCH] virpci: fix build on non-Linux
by Roman Bogorodskiy
virPCIGetDeviceAddressFromSysfsLink() should return
virPCIDeviceAddressPtr, so return NULL in the stub instead of "-1".
---
Pushed under the build-breaker rule.
src/util/virpci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 546aeb550..65c108f2e 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -2945,7 +2945,7 @@ virPCIDeviceAddressPtr
virPCIGetDeviceAddressFromSysfsLink(const char *device_link ATTRIBUTE_UNUSED)
{
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
- return -1;
+ return NULL;
}
--
2.11.0
8 years
[libvirt] ARMv7 guest PCI support broken in 3.0.0 onwards
by Daniel P. Berrange
$ cat arm.xml
<domain type="qemu">
<name>f22-arm32</name>
<uuid>a6bc14fb-585b-40b0-a15b-5e19f26079ba</uuid>
<memory>1048576</memory>
<currentMemory>1048576</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch="armv7l" machine="virt">hvm</type>
<boot dev="hd"/>
</os>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-arm</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/home/berrange/VirtualMachines/demo.qcow2"/>
<target dev="sda" bus="scsi"/>
</disk>
<controller type="scsi" index="0" model="virtio-scsi"/>
<interface type="user">
<mac address="52:54:00:87:d4:c0"/>
<model type="virtio"/>
</interface>
<console type="pty"/>
</devices>
</domain>
$ virsh define arm.xml
Domain f22-arm32 defined from arm.xml
$ virsh start f22-arm32
error: Failed to start domain f22-arm32
error: internal error: qemu unexpectedly closed the monitor: 2017-02-15T09:24:03.967648Z qemu-system-arm: -device ioh3420,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1: MSI is not supported by interrupt controller
2017-02-15T09:24:03.968154Z qemu-system-arm: -device ioh3420,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1: Device initialization failed
I've not bisected it other than to find it works in 2.5.0 and is
broken in 3.0.0
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
8 years
[libvirt] [PATCH 0/3] Report block threshold in bulk stats
by Peter Krempa
This is a follow up to:
https://www.redhat.com/archives/libvir-list/2017-March/msg00650.html
so that management apps can query the current value. The series needs to be
applied on top of the block threshold series. For convenience I've pushed it
to the same remote repository as the original series. You can fetch it here:
git fetch git://pipo.sk/pipo/libvirt.git block-threshold-1
Peter Krempa (3):
util: json: Make function to free JSON values in virHash universal
qemu: block: Add code to fetch block node data by node name
qemu: stats: Display the block threshold size in bulk stats
src/libvirt-domain.c | 4 ++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_block.c | 46 +++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_block.h | 3 +++
src/qemu/qemu_driver.c | 51 +++++++++++++++++++++++++++++++++++++++++---
src/qemu/qemu_monitor_json.c | 10 +--------
src/util/virjson.c | 8 +++++++
src/util/virjson.h | 1 +
tools/virsh.pod | 3 +++
9 files changed, 115 insertions(+), 12 deletions(-)
--
2.12.0
8 years
[libvirt] [PATCH v2] qemu: snapshot: Forbid internal snapshots with pflash firmware
by Peter Krempa
If the variable store (<nvram>) file is raw qemu can't do a snapshot of
it and thus the snapshot would be incomplete. QEMU does no reject such
snapshot.
Additionally allowing to use a qcow2 variable store backing file would
solve this issue but then it would become eligible to become target of
the memory dump.
Offline internal snapshot would be incomplete too with either storage
format since libvirt does not handle the pflash file in this case.
Forbid such snapshot so that we can avoid problems.
---
Notes:
v2:
- changed error code to OPERATION_UNSUPPORTED (from CONFIG_UNSUPPORTED)
- dropped mention of QEMU from the error message
- dropped mentions of OVMF or the firmware itself altoghether, the culprit is
the pflash device regardless of the software it contains
- mentioned all the stuff in the commit message and comment
We also will need to introduce a way to snapshot the pflash for external
snapshots which is currently impossible as well, but fortunately does not
have inherent drawbacks as internal snapshots.
src/qemu/qemu_driver.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 676295208..202d190b3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13873,6 +13873,16 @@ qemuDomainSnapshotPrepare(virConnectPtr conn,
goto cleanup;
}
+ /* Internal snapshots don't work with VMs with OVMF loader since qemu does
+ * not snapshot the variable store */
+ if (found_internal &&
+ vm->def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("internal snapshots of a VM with pflash based "
+ "firmware are not supported"));
+ goto cleanup;
+ }
+
/* Alter flags to let later users know what we learned. */
if (external && !active)
*flags |= VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY;
--
2.12.1
8 years
[libvirt] [PATCH v3 0/3] qemu: Forbid internal snapshots with pflash-based firmware (OVMF)
by Peter Krempa
Patches 1 and 2 are new in the series and add an option to override the check so
that users can use the feature despite being unsafe.
See patch 3/3 for clarification of the motiovation to do this.
Peter Krempa (3):
virerror: Introduce VIR_ERR_OPERATION_UNSAFE
snapshot: Introduce flag VIR_DOMAIN_SNAPSHOT_CREATE_UNSAFE
qemu: snapshot: Forbid internal snapshots with pflash firmware
include/libvirt/libvirt-domain-snapshot.h | 3 +++
include/libvirt/virterror.h | 1 +
src/qemu/qemu_driver.c | 18 +++++++++++++++++-
src/util/virerror.c | 5 +++++
tools/virsh-snapshot.c | 6 ++++++
tools/virsh.pod | 6 +++++-
6 files changed, 37 insertions(+), 2 deletions(-)
--
2.12.1
8 years
[libvirt] [PATCH] Revert "qemu: forbid migration with an IOMMU device"
by Ján Tomko
This reverts commit b7118623ad5a8e6ea75d693881c08873eefa3e28.
Migration was implemented by QEMU commit:
commit 8cdcf3c1e58d04b6811956d7608efeb66c42d719
Author: Peter Xu <peterx(a)redhat.com>
Date: Fri Jan 6 12:06:13 2017 +0800
intel_iommu: allow migration
https://bugzilla.redhat.com/show_bug.cgi?id=1433994
---
src/qemu/qemu_migration.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 15ed830..f5711bc 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2359,12 +2359,6 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver,
_("migration with shmem device is not supported"));
return false;
}
-
- if (vm->def->iommu) {
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("migration with iommu device is not supported"));
- return false;
- }
}
return true;
--
2.10.2
8 years
[libvirt] [PATCH] network: only check for IPv6 RA routes when the network has an IPv6 address
by Laine Stump
commit 00d28a78 added a check to see if there were any IPv6 routes
added by RA (Router Advertisement) via an interface that had accept_ra
set to something other than "2". The check was being done
unconditionally, but it's only relevant if IPv6 forwarding is going to
be turned on, and that will only happen if the network has an IPv6
address.
---
src/network/bridge_driver.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 0336ece..10e8f0e 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2391,10 +2391,9 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
/* If forward.type != NONE, turn on global IP forwarding */
if (network->def->forward.type != VIR_NETWORK_FORWARD_NONE) {
- if (!virNetDevIPCheckIPv6Forwarding())
+ if (v6present && !virNetDevIPCheckIPv6Forwarding())
goto err3; /* Precise error message already provided */
-
if (networkEnableIPForwarding(v4present, v6present) < 0) {
virReportSystemError(errno, "%s",
_("failed to enable IP forwarding"));
--
2.9.3
8 years