[libvirt] Bug: iohelper drops I/O error messages
by Jason J. Herne
During a recent managed save operation I received the following error
message:
error: operation failed: domain save job: unexpectedly failed.
It turns out that I had run out of disk space. After a brief investigation I
discovered that libvirt_iohelper is exec'ed and is used to handle all
I/O during
a (Qemu) managed save operation. While iohelper appears to be set up to log
error conditions when they occur, for some reason the logging is getting
lost.
I'm hoping someone can help figure out why these errors are getting lost. It
would be nice to present a useful error message to the user when a
managed save
fails because of an I/O error.
I was able to work around this problem with a patch that bypasses iohelper
entirely but I doubt that is really the best thing to do. Does anyone
know why
these error messages are getting suppressed?
10 years, 5 months
[libvirt] [libvirt-glib] [PATCH v4 0/3] Add API to fetch snapshots
by Timm Bäder
Argh, sorry about the earlier version, die last mail didn't get through
the smtp server.
This patchset replaces the old one and includes
gvir_domain_fetch_snapshots_async as well as a version of
gvir_domain_fetch_snapshots that works with it.
Timm Bäder (3):
libvirt-gobject-domain: Add _fetch_snapshots
libvirt-gobject-domain: Add _get_snapshots
GVirDomain: Add async version of _fetch_snapshots
libvirt-gobject/libvirt-gobject-domain.c | 164 +++++++++++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-domain.h | 51 ++++++++++
libvirt-gobject/libvirt-gobject.sym | 5 +
3 files changed, 220 insertions(+)
--
2.0.1
10 years, 5 months
[libvirt] [PATCH] qemu: fix domxml-to-native failing when spice_tls is not enabled
by Jincheng Miao
The default graphics channel mode is 'any', so as to defaultMode attribute.
If defaultMode and channel mode are all the default value 'any',
qemuConnectDomainXMLToNative will set TLSPort.
But in qemuBuildGraphicsSPICECommandLine, if spice_tls is not enabled, libvirtd
will report an error to tell the user that spice TLS is disabled in qemu.conf.
So qemuConnectDomainXMLToNative should check spice_tls is enabled,
then decide to allocate an tlsPort number to this graphics.
If user specified defaultMode is 'secure', qemuConnectDomainXMLToNative
could allocate tlsPort, and then let qemuBuildGraphicsSPICECommandLine reports
the spice_tls disabled error.
The related bug is:
https://bugzilla.redhat.com/show_bug.cgi?id=1113868
Signed-off-by: Jincheng Miao <jmiao(a)redhat.com>
---
src/qemu/qemu_driver.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d34da6f..d1e3b2f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6013,7 +6013,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
break;
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
- needTLSPort = true;
+ if (cfg->spiceTLS)
+ needTLSPort = true;
needPort = true;
break;
}
--
1.7.1
10 years, 5 months
[libvirt] Regression with 79f11b35
by Cole Robinson
I'm seeing a regression with:
commit 79f11b35c77b3c286c84312dc9737c2ccbf67ed5
Author: Eric Blake <eblake(a)redhat.com>
Date: Tue Apr 8 14:26:02 2014 -0600
conf: track user vs. canonical name through full chain lookup
Setup info:
$ ls -ld /mnt/data
lrwxrwxrwx. 1 root root 17 Oct 24 2011 /mnt/data -> terabytedrv/data/
$ ls -l /mnt/data/devel/images/f18*
-rw-r--r--. 1 qemu qemu 9316335616 Mar 30 18:36
/mnt/data/devel/images/f18-backing-img.qcow2
-rw-r--r--. 1 root root 6848249856 Apr 25 19:11 /mnt/data/devel/images/f18.qcow2
$ qemu-img info /mnt/data/devel/images/f18-backing-img.qcow2
image: /mnt/data/devel/images/f18-backing-img.qcow2
file format: qcow2
virtual size: 9.8G (10485760000 bytes)
disk size: 8.7G
cluster_size: 65536
Snapshot list:
ID TAG VM SIZE DATE VM CLOCK
1 snapshot1 0 2014-01-13 18:48:43 00:00:00.000
2 snapshot2 0 2014-01-13 18:49:39 00:00:00.000
Format specific information:
compat: 0.10
$ qemu-img info /mnt/data/devel/images/f18.qcow2 image:
/mnt/data/devel/images/f18.qcow2
file format: qcow2
virtual size: 9.8G (10485760000 bytes)
disk size: 6.4G
cluster_size: 65536
backing file: f18-backing-img.qcow2 (actual path:
/mnt/data/devel/images/f18-backing-img.qcow2)
Format specific information:
compat: 0.10
Before the patch:
$ sudo virsh vol-dumpxml /mnt/data/devel/images/f18.qcow2
[full xml with backing image info]
After the patch:
$ sudo virsh vol-dumpxml /mnt/data/devel/images/f18.qcow2
[xml minus xml for the backing image]
And these errors are on the console when the daemon starts:
2014-05-03 20:52:34.970+0000: 20600: error : virFindBackingFile:590 : Cannot
access backing file './f18-backing-img.qcow2': No such file or directory
2014-05-03 20:52:34.970+0000: 20600: warning :
virStorageFileGetMetadataInternal:868 : Backing file 'f18-backing-img.qcow2'
of image '/mnt/data/devel/images/ztester-serial-f18.qcow2' is missing.
On git head actually the vol-dumpxml explicitly fails, but I don't have the
error handy.
- Cole
10 years, 5 months
[libvirt] new openvz driver (bossonvz)
by Bosson VZ
Hello,
in the company I work for, we use openvz and qemu/kvm on our clusters side-by-side. To manage our domains, we used libvirt/qemu for qemu/kvm domains and vz tools for openvz domains in the past. This was very inconvinient since the management differed in many ways. So we have decided to unify our management and use libvirt exclusively. Since the openvz driver already included in libvirt lacks features that need, we have implemented a new libvirt backend driver for openvz called the bossonvz driver.
Unlike the openvz driver, bossonvz is a complete, feature-rich stateful libvirt driver. It uses the libvirt driver API exclusively and communicates with the kernel directly, much like the LXC driver. The code is hugely inspired by the LXC driver and the Qemu driver, but adds a bit of functionality to the libvirt core too. More details and the source code can be found at
http://bossonvz.bosson.eu/
The driver is completely independent of vz tools, it needs only a running vz kernel. One of the things, we are most proud of, is the possibility to access the domain's tty via VNC (hurray to uniform management web interfaces).
Since the code was developed in-house (primarily for internal purposes), it is based on an older libvirt release (1.1.2). There are also some modifications to the libvirt core (virCommand) and the domain file (mount options syntax) which might need some redesign.
At the moment I would like to get some feedback on the driver. In the future, I would like to see the driver merged upstream, and am prepared to do the work but I need to know if there is any interest in doing so.
--
Cluster Design, s.r.o.
10 years, 5 months
[libvirt] [PATCH] libxl: add discard support to libxl_device_disk
by Olaf Hering
Translate libvirt discard settings into libxl-4.5 discard settings.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
default means leave decision to libxl.
Not sure if that is what "default" in libvirt terms really means.
src/libxl/libxl_conf.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index b7fed7f..4cb062e 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -713,6 +713,33 @@ libxlMakeDomBuildInfo(virDomainObjPtr vm, libxl_domain_config *d_config)
return -1;
}
+static void
+libxlDiskSetDiscard(libxl_device_disk *x_disk, int discard)
+{
+ if (!x_disk->readwrite)
+ return;
+#if defined(LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE)
+ switch (discard) {
+ case VIR_DOMAIN_DISK_DISCARD_DEFAULT:
+ break;
+ case VIR_DOMAIN_DISK_DISCARD_UNMAP:
+ libxl_defbool_set(&x_disk->discard_enable, true);
+ break;
+ default:
+ case VIR_DOMAIN_DISK_DISCARD_IGNORE:
+ libxl_defbool_set(&x_disk->discard_enable, false);
+ break;
+ }
+#else
+ if (discard == VIR_DOMAIN_DISK_DISCARD_DEFAULT)
+ return;
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("This version of libxenlight does not support "
+ "discard= option passing"));
+#endif
+}
+
+
int
libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
{
@@ -827,6 +854,7 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk)
x_disk->removable = 1;
x_disk->readwrite = !l_disk->readonly;
x_disk->is_cdrom = l_disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM ? 1 : 0;
+ libxlDiskSetDiscard(x_disk, l_disk->discard);
/* An empty CDROM must have the empty format, otherwise libxl fails. */
if (x_disk->is_cdrom && !x_disk->pdev_path)
x_disk->format = LIBXL_DISK_FORMAT_EMPTY;
10 years, 5 months
[libvirt] [PATCHv6 0/7] Rest of the relative backing and network commit series
by Peter Krempa
Mostly cosmetical changes since the last round.
Peter Krempa (7):
qemu: caps: Add capability for change-backing-file command
qemu: monitor: Add argument for specifying backing name for block
commit
qemu: monitor: Add support for backing name specification for
block-stream
lib: Introduce flag VIR_DOMAIN_BLOCK_COMMIT_RELATIVE
lib: Introduce flag VIR_DOMAIN_BLOCK_REBASE_RELATIVE
qemu: Add support for networked disks for block commit
qemu: Add support for networked disks for block pull/block rebase
include/libvirt/libvirt.h.in | 6 +++
src/libvirt.c | 8 ++++
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_driver.c | 87 +++++++++++++++++++++++++++++++++++++++-----
src/qemu/qemu_migration.c | 6 +--
src/qemu/qemu_monitor.c | 22 ++++++-----
src/qemu/qemu_monitor.h | 4 +-
src/qemu/qemu_monitor_json.c | 17 +++++++++
src/qemu/qemu_monitor_json.h | 2 +
tests/qemumonitorjsontest.c | 2 +-
tools/virsh-domain.c | 18 ++++++++-
tools/virsh.pod | 9 ++++-
13 files changed, 156 insertions(+), 28 deletions(-)
--
1.9.3
10 years, 5 months
[libvirt] [PATCH 0/5] Reorganize storage auth (both disk and pool)
by John Ferlan
While understandably not really a 1.2.6 candidate, I figured I'd post this
now in hopes that it gets the ball rolling. The changes will help with
a related bz to support libiscsi for SCSI passthrough devices where a
<hostdev> entry for an iscsi adapter would be able to have <auth> data.
The bulk of changes are code motion/merge. The details for each are:
The first patch will create new API's which will then be used by the
parse domain disk and the parse storage pool code if the "<auth" element
is found. The logic merges the parsing found in the domain disk and
storage pool code with one slight caveat - the domain disk code expects
to find "<secret type='xxxx'", where xxxx is 'iscsi' or 'ceph'. Trying
use the Type{To/From}String API's in virstoragefile.c resulted in a
link time failure (even though secret_conf.h was included). Never quite
figured it out - I will take suggestions though. Although since the
domain disk code is all that really cares about it and the domain_conf
code can use the Type{To/From}String API's - I just left it as is. The
new copy API is used when the pool code needs to copy it's auth data into
each domain disk's auth entry.
The second patch will fix a not-run test that tests the auth. It seems
it was not added to the active list of tests because the output generated
did not include the "usage" information (eg " usage='mycluster_myname") that
is part of the <secret> element. Additionally because it did not include
it the output was "<secret type='iscsi' </auth>". So rather than ignore
the test - add to the filters to avoid looking for "<secret" - through
to the closing ">". The -auth.xml and -auth.args files needed adjustments
to follow the non "-auth" version of the files that have changed over time,
but not also changed int the "-auth" files.
The third patch will cause the domain disk algorithms to utilize the
new generic parse and format APIs as well as using the 'authdef' instead
of the inline structure fields. This patch also restores the checking for
</auth> in the recently restored auth test. Still avoiding the whole
<secret... /> line as I saw no way to filter just the usage that's in
the stored XML file.
The fourth patch is a mostly innocuous html change - it could go early,
but it just felt better in this place.
The fifth patch will cause the storage pool algorithms to utilize the
new generic parse/format API's as well as new authdef structure for
accessing the data. The removal of the duplicated cephx/chap structures
seems (in my mind at least) to simplify things. They were essentially
copies of each other with no seemingly real value in keeping separate
other than the visual in the code of ".chap." or ".cephx.".
John Ferlan (5):
virstorage: Introduce virStorageAuthDef
qemuargv2xmltest: Resurrect RBD and iSCSI auth
Utilize virDomainDiskAuth for domain disk
formatdomain: Fix issues found describing auth
Utilize virDomainDiskAuth for storage pools
docs/formatdomain.html.in | 24 +--
src/conf/domain_conf.c | 106 ++--------
src/conf/storage_conf.c | 152 ++------------
src/conf/storage_conf.h | 38 +---
src/libvirt_private.syms | 5 +-
src/qemu/qemu_command.c | 72 ++++---
src/qemu/qemu_conf.c | 46 +----
src/storage/storage_backend_iscsi.c | 41 ++--
src/storage/storage_backend_rbd.c | 65 +++---
src/util/virstoragefile.c | 219 +++++++++++++++++++--
src/util/virstoragefile.h | 37 +++-
tests/qemuargv2xmltest.c | 3 +
...qemuxml2argv-disk-drive-network-iscsi-auth.args | 4 +-
.../qemuxml2argv-disk-drive-network-iscsi-auth.xml | 12 +-
.../qemuxml2argv-disk-drive-network-rbd-auth.xml | 4 +-
15 files changed, 415 insertions(+), 413 deletions(-)
--
1.9.3
10 years, 5 months
[libvirt] [PATCH v4 0/5] Another version of active commit
by Eric Blake
Rebased to latest libvirt.git, and still waiting on Jeff's qemu
patches to go into qemu.git before I can push any of these,
https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg04060.html
but reposting because of a feature Adam had been requesting:
Patch 3/5 is new, and adds a new <activecommit/> marker to the
'virsh capabilities' output if qemu is detected as supporting
active commit. I've resolved some of Peter's review comments
in patches 1 and 2 (patch 1 underwent a bit of a rewrite to
differentiate the qemu capability probe from normal use of the
interface, and 2 dropped mention of RHEL 6.3 except in the
commit message). At this point, I haven't altered 4 or 5,
although I still need to do something about getting a persistent
domain definition updated after a pivot changes the file in
use by a running domain.
I've forced an update to my git repo:
http://repo.or.cz/w/libvirt/ericb.git/shortlog/refs/heads/gluster
or git checkout git://repo.or.cz/libvirt/ericb.git gluster
Eric Blake (5):
blockjob: allow omitted arguments to QMP block-commit
blockjob: turn on qemu capability bit for active commit
blockjob: expose active commit capability
blockcommit: track job type in xml
blockcommit: turn on active commit
docs/formatcaps.html.in | 46 +++++++++++++++-
docs/formatdomain.html.in | 20 +++----
docs/schemas/capability.rng | 5 ++
docs/schemas/domaincommon.rng | 13 +++++
src/conf/capabilities.c | 3 +-
src/conf/domain_conf.c | 33 +++++++++++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 13 +++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_driver.c | 53 ++++++++++++++----
src/qemu/qemu_monitor.c | 12 +++++
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 29 ++++++++--
src/qemu/qemu_monitor_json.h | 3 +-
src/qemu/qemu_process.c | 18 ++++---
tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 62 ++++++++++++----------
tests/qemumonitorjsontest.c | 47 ++++++++++++++++
.../qemuxml2argv-disk-active-commit.xml | 37 +++++++++++++
.../qemuxml2argvdata/qemuxml2argv-disk-mirror.xml | 4 +-
.../qemuxml2xmlout-disk-mirror-old.xml | 4 +-
tests/qemuxml2xmltest.c | 1 +
25 files changed, 481 insertions(+), 173 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-active-commit.xml
--
1.9.3
10 years, 5 months
[libvirt] RFC: 'old' event for leaseshelper.c when lease renews
by Nehal J Wani
In the current version of dnsmasq, the leases helper script/program
specified by --dhcp-script to dnsmasq is invoked on three events,
'add', 'old', 'del'. In short,
add: -> a new lease has to be added to db
del: -> a lease has to be deleted from db
old:-> if lease has changed
Now, the lease can be considered to be changed in 2 ways.
[standard-change] The change could be to the associated hostname or MAC address
[auxiliary-change] The change associated with expiry time or clientid
When only --dhcp-script is set, 'old' events are sent only for
standard-lease changes. But when --dhcp-script is set along with
--leasefile-ro, 'old' events are sent for any change in the lease.
So, right now, if a lease is renewed, the reflected change doesn't
appear in our JSON formatted lease database <interface-name>.status.
We have the following options with this:
(i) We can simply add the --leasefile-ro option. But in that case, the
leases file database which is generated by dnsmasq by the name
<network-name>.leases will cease to exist. It won't contain any lease
information. All lease database handling will be done by our
leaseshelper. Note: this option given a lot of information which is
not stored in <network-name>.leases file.
(ii) We ask the dnsmasq developer(s) to add an extra command line
option to enable auxiliary changes in lease to be propagated to
leaseshelper via 'old' events. I had a small conversation with Simon
Kelley, and he said:
"Yes. For that application (libvirt), you clearly don't want a
third-party patch. At very least I'd be willing to add a boolean
option to dnsmasq which enables "old" events when the lease expiry
time changes, independent of leasefile-ro."
If we do this, then can retain <network-name>.leases and have our helper too.
(iii) We do nothing.
IMO, we should go for (i), since <network-name>.leases becomes
obsolete, once we have our own leases helper. Also, enabling
--leasefile-ro enables a lot of other options, like vendor-class,
user-class, circuit-id and much more, which may be asked for in future
and get added to the virNetworkDHCPLeases struct. But we will have to
remove the option --dhcp-leasefile. Although it won't affect any
existing APIs, if people did rely on the dnsmasq's generated leases
file before, they will find it missing. There is one more point. The
man page of dnsmasq for the leasefile-ro option, states, "In addition
to the invocations given in --dhcp-script the lease-change script is
called once, at dnsmasq startup, with the single argument "init". When
called like this the script should write the saved state of the lease
database, in dnsmasq leasefile format, to stdout and exit with zero
exit code." This is something extra that we will have to add to
leaseshelper if we go with (i).
The easier option is to go with (ii), since Simon is already willing
to add that functionality.
--
Nehal J Wani
10 years, 5 months