[libvirt] valgrind report on active commit
by Eric Blake
I'm still investigating, but posting this trace now in case someone else
spots the bug. I created a chain three deep (base.img <- mid.img <-
top.img), then ran blockcopy --finish, blockcommit --active --shallow
--pivot, and another blockcommit --active --shallow --pivot. The last
attempt to pivot exposed the bad memory use:
==25612== Invalid read of size 4
==25612== at 0x50E7C90: virStorageSourceGetActualType
(virstoragefile.c:1948)
==25612== by 0x209C0B18: qemuDomainDetermineDiskChain
(qemu_domain.c:2473)
==25612== by 0x209D7F6A: qemuProcessHandleBlockJob (qemu_process.c:1087)
==25612== by 0x209F40C9: qemuMonitorEmitBlockJob (qemu_monitor.c:1357)
==25612== by 0x20A06B7F: qemuMonitorJSONHandleBlockJobImpl
(qemu_monitor_json.c:922)
==25612== by 0x20A06D18: qemuMonitorJSONHandleBlockJobCompleted
(qemu_monitor_json.c:969)
==25612== by 0x20A048CD: qemuMonitorJSONIOProcessEvent
(qemu_monitor_json.c:166)
==25612== by 0x20A04A73: qemuMonitorJSONIOProcessLine
(qemu_monitor_json.c:195)
==25612== by 0x20A04CDB: qemuMonitorJSONIOProcess
(qemu_monitor_json.c:237)
==25612== by 0x209F1047: qemuMonitorIOProcess (qemu_monitor.c:402)
==25612== by 0x209F1AB1: qemuMonitorIO (qemu_monitor.c:651)
==25612== by 0x50A73C0: virEventPollDispatchHandles (vireventpoll.c:510)
==25612== Address 0xe4b5610 is 0 bytes inside a block of size 200 free'd
==25612== at 0x4A07577: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==25612== by 0x50839E9: virFree (viralloc.c:582)
==25612== by 0x50E7E51: virStorageSourceFree (virstoragefile.c:2015)
==25612== by 0x209D7EFF: qemuProcessHandleBlockJob (qemu_process.c:1073)
==25612== by 0x209F40C9: qemuMonitorEmitBlockJob (qemu_monitor.c:1357)
==25612== by 0x20A06B7F: qemuMonitorJSONHandleBlockJobImpl
(qemu_monitor_json.c:922)
==25612== by 0x20A06D18: qemuMonitorJSONHandleBlockJobCompleted
(qemu_monitor_json.c:969)
==25612== by 0x20A048CD: qemuMonitorJSONIOProcessEvent
(qemu_monitor_json.c:166)
==25612== by 0x20A04A73: qemuMonitorJSONIOProcessLine
(qemu_monitor_json.c:195)
==25612== by 0x20A04CDB: qemuMonitorJSONIOProcess
(qemu_monitor_json.c:237)
==25612== by 0x209F1047: qemuMonitorIOProcess (qemu_monitor.c:402)
==25612== by 0x209F1AB1: qemuMonitorIO (qemu_monitor.c:651)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
10 years, 2 months
[libvirt] [PATCH v5 0/4] fix blockcopy across libvirtd restart, turn on active blockcommit
by Eric Blake
v4 was here:
https://www.redhat.com/archives/libvir-list/2014-June/msg01095.html
Since then: I _finally_ implemented persistent domain updates to
match live changes, by reimplementing how <mirror> is tracked in
XML to be more robust to libvirtd restarts. In particular, it
fixes a bug in v4 that Adam Litke pointed out where a pivot
commit would emit a ready event for 'active commit' but then a
completed event for plain 'commit'.
Patches 1 and 2 are completely local to blockcopy, and fix a
long-standing bug where it is not robust to libvirtd restarts
(similar to the bug fixed in 60e4944). They are pre-requisite
to turning on active commit.
Patches 3 and 4 are borderline on whether it is a new feature
or a bug fix. But consider that commit 47549d5 turned on qemu
feature probing with the intent of getting this in 1.2.7, and
we already missed getting active commit into 1.2.6. As it is,
patch 4 is very similar to the already-acked counterpart of v4.
Therefore, even though I missed rc1, I'm arguing that this whole
series should be included in rc2 in time for 1.2.7.
Not done yet, but that I'd also like to have in the release if I
can swing it: the new virConnectGetDomainCapabilities API needs
to expose features on whether active commit will work. Also,
I'd like to fix libvirtd restarts to inspect all existing <mirror>
tags and see if the job completed while libvirtd was offline (that
is, when we miss an event, we should still start up in the correct
state when reconnecting to qemu).
Eric Blake (4):
blockcopy: add more XML for state tracking
blockjob: properly track blockcopy xml changes on disk
blockcommit: track job type in xml
blockcommit: turn on active commit
docs/formatdomain.html.in | 23 ++-
docs/schemas/domaincommon.rng | 19 ++-
src/conf/domain_conf.c | 56 ++++++-
src/conf/domain_conf.h | 14 +-
src/qemu/qemu_driver.c | 167 ++++++++++++++-------
src/qemu/qemu_process.c | 92 ++++++++++--
.../qemuxml2argv-disk-active-commit.xml | 37 +++++
.../qemuxml2argvdata/qemuxml2argv-disk-mirror.xml | 8 +-
.../qemuxml2xmlout-disk-mirror-old.xml | 4 +-
tests/qemuxml2xmltest.c | 1 +
10 files changed, 336 insertions(+), 85 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-active-commit.xml
--
1.9.3
10 years, 2 months
[libvirt] Error
by ahmad jan
I want to configure Libvirt-1.2.7 on ubuntu and found the following Error
"Could not find linxml2 anywhere"
guide please
10 years, 2 months
[libvirt] libvirt external disk-only snapshot will pause the VM?
by Yuanzhen Gu
Hello folks,
If I give command to take external disk-only live snapshot, such as
# virsh snapshot-create-as vm1 snapshot_vm1 --disk-only
will the guest OS be paused or suspend while the snapshot being taken?
Thanks very much!
Best,
Yuanzhen
10 years, 2 months
[libvirt] [PATCH] Node Devices: Fix nodedev-list for fc_host & vports.
by Prerna Saxena
In a system with Fiber Channel Host Adapters, a query to list all Fibre Channel
HBAs OR Vports currently returns empty list:
$ virsh nodedev-list --cap fc_host
$
Libvirt correctly discovers properties for all HBAs. However, the reporting
fails because of incorrect flag comparison while filtering these types.
This is fixed by removing references to 'VIR_CONNECT_LIST_NODE_DEVICES_CAP_*'
for comparison and replacing those with 'VIR_NODE_DEV_CAP_*'
Signed-off-by: Prerna Saxena <prerna(a)linux.vnet.ibm.com>
---
src/conf/node_device_conf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 96524a6..025d08c 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -1732,12 +1732,12 @@ virNodeDeviceCapMatch(virNodeDeviceObjPtr devobj,
return true;
if (cap->type == VIR_NODE_DEV_CAP_SCSI_HOST) {
- if (type == VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST &&
+ if (type == VIR_NODE_DEV_CAP_FC_HOST &&
(cap->data.scsi_host.flags &
VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST))
return true;
- if (type == VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS &&
+ if (type == VIR_NODE_DEV_CAP_VPORTS &&
(cap->data.scsi_host.flags &
VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS))
return true;
--
1.9.3
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
10 years, 2 months
[libvirt] [PATCH] snapshot: conf: Enforce absolute paths on disk and memory images
by Peter Krempa
RNG schema as well as the qemu driver requires absolute paths for memory
and disk snapshot image files but the XML parser was not enforcing it.
Add checks to avoid problems in qemu where the configuration it creates
is invalid.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1126329
---
src/conf/snapshot_conf.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 240ca90..c53a66b 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -177,6 +177,16 @@ virDomainSnapshotDiskDefParseXML(xmlNodePtr node,
}
}
+ /* validate that the passed path is absolute */
+ if (virStorageSourceIsLocalStorage(def->src) &&
+ def->src->path &&
+ def->src->path[0] != '/') {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("disk snapshot image path '%s' must be absolute"),
+ def->src->path);
+ goto cleanup;
+ }
+
if (!def->snapshot && (def->src->path || def->src->format))
def->snapshot = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
@@ -327,6 +337,14 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
def->file = memoryFile;
memoryFile = NULL;
+ /* verify that memory path is absolute */
+ if (def->file && def->file[0] != '/') {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("memory snapshot file path (%s) must be absolute"),
+ def->file);
+ goto cleanup;
+ }
+
if ((n = virXPathNodeSet("./disks/*", ctxt, &nodes)) < 0)
goto cleanup;
if (flags & VIR_DOMAIN_SNAPSHOT_PARSE_DISKS) {
--
2.0.2
10 years, 2 months
[libvirt] [PATCH] qemu: Make virFileFindHugeTLBFS fault tolerant
by Michal Privoznik
Since commit be0782e1 we are parsing /proc/meminfo to find out the
default huge page size. However, if the host we are running at does
not support any huge pages (e.g. CONFIG_HUGETLB_PAGE is turned off),
we will not successfully parse the meminfo file and hence the whole
qemu driver init process fails. Moreover, the default huge page size
is needed if and only if there's at least one hugetlbfs mount point.
So the fix consists of moving the virFileGetDefaultHugepageSize
function call after the first hugetlbfs mount point is found.
With this fix, we fail to start with one or more hugetlbfs mounts and
malformed meminfo file, but that's expected (how can one mount
hugetlbfs without kernel supporting huge pages?). Workaround in that
case is to umount all the hugetlbfs mounts.
Reported-by: Jim Fehlig <jfehlig(a)suse.com>
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/virfile.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 9863fd0..f9efc65 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -2990,10 +2990,7 @@ virFileFindHugeTLBFS(virHugeTLBFSPtr *ret_fs,
char mntbuf[1024];
virHugeTLBFSPtr fs = NULL;
size_t nfs = 0;
- unsigned long long default_hugepagesz;
-
- if (virFileGetDefaultHugepageSize(&default_hugepagesz) < 0)
- goto cleanup;
+ unsigned long long default_hugepagesz = 0;
if (!(f = setmntent(PROC_MOUNTS, "r"))) {
virReportSystemError(errno,
@@ -3019,6 +3016,10 @@ virFileFindHugeTLBFS(virHugeTLBFSPtr *ret_fs,
if (virFileGetHugepageSize(tmp->mnt_dir, &tmp->size) < 0)
goto cleanup;
+ if (!default_hugepagesz &&
+ virFileGetDefaultHugepageSize(&default_hugepagesz) < 0)
+ goto cleanup;
+
tmp->deflt = tmp->size == default_hugepagesz;
}
--
1.8.5.5
10 years, 2 months
[libvirt] handle different version of QEMU
by Matthias Gatto
Hello,
I'm implementing the "new" QEMU option of
block_set_io_throttle(@bps_max, @bps_rd_max...), but i have a problem:
The old version of QEMU(before 1.7) does not handle it, so I'd like to
know what function should i use to know the version of QEMU, and
what's the proper way to handle this problem ?
10 years, 2 months
[libvirt] [python PATCH] Bump version to 1.2.8 for new dev cycle
by Eric Blake
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the trivial rule.
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 334d7b2..f5c6542 100755
--- a/setup.py
+++ b/setup.py
@@ -309,7 +309,7 @@ class my_clean(clean):
_c_modules, _py_modules = get_module_lists()
setup(name = 'libvirt-python',
- version = '1.2.7',
+ version = '1.2.8',
url = 'http://www.libvirt.org',
maintainer = 'Libvirt Maintainers',
maintainer_email = 'libvir-list(a)redhat.com',
--
1.9.3
10 years, 2 months
[libvirt] [PATCH v2 0/8] Add iSCSI hostdev pass-through device
by John Ferlan
Followup/rebase to partially ACK'd pile of changes - figure it's just
as easy for me to keep things together and it's better to see things
in totality...
See: http://www.redhat.com/archives/libvir-list/2014-July/msg00592.html
* Patches 1-5 were adjusted to use the first_/second_ naming scheme rather
than a/b.
* Typo for 'vedor' in patch 1 adjusted.
* Changed name of iSCSIFree to iSCSIClear.
John Ferlan (8):
hostdev: Introduce virDomainHostdevSubsysUSB
hostdev: Introduce virDomainHostdevSubsysPCI
hostdev: Introduce virDomainHostdevSubsysSCSI
hostdev: Introduce virDomainHostdevSubsysSCSIHost
Add virConnectPtr for qemuBuildSCSIHostdevDrvStr
hostdev: Introduce virDomainHostdevSubsysSCSIiSCSI
domain_conf: Common routine to handle network storage host xml def
hostdev: Add iSCSI hostdev XML
docs/formatdomain.html.in | 142 +++++--
docs/schemas/domaincommon.rng | 46 +-
src/conf/domain_audit.c | 38 +-
src/conf/domain_conf.c | 471 ++++++++++++++-------
src/conf/domain_conf.h | 80 +++-
src/libxl/libxl_conf.c | 9 +-
src/libxl/libxl_domain.c | 6 +-
src/libxl/libxl_driver.c | 34 +-
src/lxc/lxc_cgroup.c | 4 +-
src/lxc/lxc_controller.c | 10 +-
src/lxc/lxc_driver.c | 16 +-
src/qemu/qemu_cgroup.c | 69 +--
src/qemu/qemu_command.c | 158 ++++---
src/qemu/qemu_command.h | 5 +-
src/qemu/qemu_conf.c | 20 +-
src/qemu/qemu_driver.c | 6 +-
src/qemu/qemu_hotplug.c | 93 ++--
src/qemu/qemu_hotplug.h | 9 +-
src/security/security_apparmor.c | 33 +-
src/security/security_dac.c | 66 +--
src/security/security_selinux.c | 64 +--
src/security/virt-aa-helper.c | 5 +-
src/util/virhostdev.c | 295 +++++++------
.../qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args | 14 +
.../qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml | 46 ++
.../qemuxml2argv-hostdev-scsi-lsi-iscsi.args | 14 +
.../qemuxml2argv-hostdev-scsi-lsi-iscsi.xml | 40 ++
...emuxml2argv-hostdev-scsi-virtio-iscsi-auth.args | 16 +
...qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml | 46 ++
.../qemuxml2argv-hostdev-scsi-virtio-iscsi.args | 16 +
.../qemuxml2argv-hostdev-scsi-virtio-iscsi.xml | 40 ++
tests/qemuxml2argvtest.c | 16 +
tests/qemuxml2xmltest.c | 5 +
33 files changed, 1322 insertions(+), 610 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi.xml
--
1.9.3
10 years, 2 months