[libvirt] [libvirt-python PATCH 0/2] Python bindings for virDomainMigrateGetMaxDowntime
by John Ferlan
Implement the bindings similar to previous such implementations for
Compression cache (commit id's 7465d31bb and feae4e052)
John Ferlan (2):
Introduce virDomainMigrateGetMaxDowntime API
Implement virDomainMigrateGetMaxDowntime
generator.py | 1 +
libvirt-override-api.xml | 7 +++++++
libvirt-override.c | 33 +++++++++++++++++++++++++++++++++
3 files changed, 41 insertions(+)
--
2.9.5
7 years, 1 month
[libvirt] [libvirt-perl PATCH] Add migrate_get_max_downtime
by John Ferlan
Add new API for 3.7 pushed code for virDomainMigrateGetMaxDowntime
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Changes | 1 +
Virt.xs | 15 +++++++++++++++
lib/Sys/Virt/Domain.pm | 6 ++++++
3 files changed, 22 insertions(+)
diff --git a/Changes b/Changes
index e7f6cde..a3e507f 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@ Revision history for perl module Sys::Virt
3.7.0 2017-00-00
- Add VIR_FROM_RESCTRL constant
+ - Add migrate_get_max_downtime
3.5.0 2017-07-06
diff --git a/Virt.xs b/Virt.xs
index d3019ee..11c3d8f 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -5325,6 +5325,21 @@ migrate_set_max_downtime(dom, downtime, flags=0)
_croak_error();
+SV *
+migrate_get_max_downtime(dom, flags=0)
+ virDomainPtr dom;
+ unsigned int flags;
+ PREINIT:
+ unsigned long long downtime;
+ CODE:
+ if (virDomainMigrateGetMaxDowntime(dom, &downtime, flags) < 0)
+ _croak_error();
+
+ RETVAL = virt_newSVull(downtime);
+ OUTPUT:
+ RETVAL
+
+
void
migrate_set_max_speed(dom, bandwidth, flags=0)
virDomainPtr dom;
diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm
index 20ecf9f..030e1e3 100644
--- a/lib/Sys/Virt/Domain.pm
+++ b/lib/Sys/Virt/Domain.pm
@@ -1254,6 +1254,12 @@ at the cost of longer time blackout for the guest OS at the switch
over point. The C<downtime> parameter is measured in milliseconds.
The C<$flags> parameter is currently unused and defaults to zero.
+=item $downtime = $dom->migrate_get_max_downtime($flags=0)
+Get the current value of the maximum downtime allowed during a
+migration of a guest. The returned <downtime> value is measured
+in milliseconds. The C<$flags> parameter is currently unused and
+defaults to zero.
+
=item $dom->migrate_set_max_speed($bandwidth, $flags=0)
Set the maximum allowed bandwidth during migration of the guest.
--
2.9.5
7 years, 1 month
[libvirt] [PATCH v4 0/7] Add new APIs to edit xml configuration of managed save state of a domain
by Kothapally Madhu Pavan
managedsave command offloads the user from managing the save state file.
It does not need the user to specify saved state file location, all it takes
is domain name to identify. This makes it much more comfortable to use in
emergency where immediate shutdowm is needed. But it doesn't provide a way
to edit XML description of the save state file without user going through an
extra effort to search manually where the file actually exists.
The series aims to overcome the above constraints by adding new APIs and
commands to seemlessly edit the managed save state XML description using
just the domain name. The Patches mainly make use of the save-image-edit
code flow only to simplify the above use case.
This patch set provides capability to Dump and Edit the XML configuration
associated with a saved state file of a domain which was created by the
managedsave command.
The new command carry the similar options as the save-image-<XXX> commands
to change the running state as to paused state or running on start.
This is equivalent to:
virsh managedsave-dumpxml domain-name > state-file.xml
vi state-file.xml (or make changes with your other text editor)
virsh managedsave-define domain-name state-file-xml
or you can simply use:
virsh managedsave-edit domain-name
It's always better when we get more.
Changes since v3:
- refracted version references from 3.6.0 to 3.7.0
- fixed typo in error message.
Changes since v2:
- refracted version references from 3.5.0 to 3.6.0
Changes since v1:
- qemu implementation called directly rather than going through
driver pointer in qemuDomainManagedSaveDefineXML.
- check whether the managed save state file exists and report a
error if it doesn't.
Kothapally Madhu Pavan (7):
lib: Add API to dump xml configuration of managed save state domain
lib: Add API to edit domain's managed save state xml configuration
qemu: Implement qemuDomainManagedSaveGetXMLDesc
qemu: Implement qemuDomainManagedSaveDefineXML
virsh: Implement managedsave-define command
virsh: Implement managedsave-dumpxml command
virsh: Implement managedsave-edit command
include/libvirt/libvirt-domain.h | 6 ++
src/driver-hypervisor.h | 11 +++
src/libvirt-domain.c | 107 ++++++++++++++++++++
src/libvirt_public.syms | 6 ++
src/qemu/qemu_driver.c | 87 ++++++++++++++++
src/remote/remote_driver.c | 2 +
src/remote/remote_protocol.x | 31 +++++-
src/remote_protocol-structs | 14 +++
tools/virsh-domain.c | 207 +++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 41 ++++++++
10 files changed, 511 insertions(+), 1 deletion(-)
--
1.8.3.1
7 years, 1 month
[libvirt] [PATCH] maint: correct quoting for gl_WARN_ADD
by Eric Blake
3 out of 4 uses of gl_WARN_ADD() were incorrectly adding "" around
the argument, which in turn resulted in the argument being used
unquoted (configure had gl_positive=""-fstack-protector-all"",
rather than the intended gl_positive="-fstack-protector-all").
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
m4/virt-compile-warnings.m4 | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index 7b56115ce6..e8f1351260 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -194,8 +194,8 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
# This should be < 256 really. Currently we're down to 4096,
# but using 1024 bytes sized buffers (mostly for virStrerror)
# stops us from going down further
- gl_WARN_ADD(["-Wframe-larger-than=4096"], [STRICT_FRAME_LIMIT_CFLAGS])
- gl_WARN_ADD(["-Wframe-larger-than=25600"], [RELAXED_FRAME_LIMIT_CFLAGS])
+ gl_WARN_ADD([-Wframe-larger-than=4096], [STRICT_FRAME_LIMIT_CFLAGS])
+ gl_WARN_ADD([-Wframe-larger-than=25600], [RELAXED_FRAME_LIMIT_CFLAGS])
# Extra special flags
dnl -fstack-protector stuff passes gl_WARN_ADD with gcc
@@ -250,7 +250,7 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
*-fstack-protector-strong*)
;;
*)
- gl_WARN_ADD(["-fstack-protector-all"])
+ gl_WARN_ADD([-fstack-protector-all])
;;
esac
;;
--
2.13.5
7 years, 1 month
[libvirt] [PATCH] daemon: logging: Fix --verbose option being ignored by the daemon
by Erik Skultety
Commit 94c465d0 refactored the logging setup phase but introduced an
issue, where the daemon ignores verbose mode when there are no outputs
defined and the default must be used. The problem is that the default
output was determined too early, thus ignoring the potential '--verbose'
option taking effect. This patch postpones the creation of the default
output to the very last moment when nothing else can change. Since the
default output is only created during the init phase, it's safe to leave
the pointer as NULL for a while, but it will be set eventually, thus not
affecting runtime.
Patch also adjusts both the other daemons.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1457193
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
daemon/libvirtd.c | 21 +++++++++++++--------
src/locking/lock_daemon.c | 21 +++++++++++++--------
src/logging/log_daemon.c | 21 +++++++++++++--------
src/util/virlog.c | 7 +++++++
4 files changed, 46 insertions(+), 24 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 7e5d7af69..589b32192 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -615,19 +615,15 @@ daemonSetupLogging(struct daemonConfig *config,
* Libvirtd's order of precedence is:
* cmdline > environment > config
*
- * The default output is applied only if there was no setting from either
- * the config or the environment. Because we don't have a way to determine
- * if the log level has been set, we must process variables in the opposite
+ * Given the precedence, we must process the variables in the opposite
* order, each one overriding the previous.
*/
if (config->log_level != 0)
virLogSetDefaultPriority(config->log_level);
- if (virLogSetDefaultOutput("libvirtd.log", godaemon, privileged) < 0)
- return -1;
-
- /* In case the config is empty, the filters become empty and outputs will
- * be set to default
+ /* In case the config is empty, both filters and outputs will become empty,
+ * however we can't start with empty outputs, thus we'll need to define and
+ * setup a default one.
*/
ignore_value(virLogSetFilters(config->log_filters));
ignore_value(virLogSetOutputs(config->log_outputs));
@@ -641,6 +637,15 @@ daemonSetupLogging(struct daemonConfig *config,
if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
virLogSetDefaultPriority(VIR_LOG_INFO);
+ /* Define the default output. This is only applied if there was no setting
+ * from either the config or the environment.
+ */
+ if (virLogSetDefaultOutput("libvirtd.log", godaemon, privileged) < 0)
+ return -1;
+
+ if (virLogGetNbOutputs() == 0)
+ virLogSetOutputs(virLogGetDefaultOutput());
+
return 0;
}
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index 12485e966..6fbbf4b3d 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -460,19 +460,15 @@ virLockDaemonSetupLogging(virLockDaemonConfigPtr config,
* Libvirtd's order of precedence is:
* cmdline > environment > config
*
- * The default output is applied only if there was no setting from either
- * the config or the environment. Because we don't have a way to determine
- * if the log level has been set, we must process variables in the opposite
+ * Given the precedence, we must process the variables in the opposite
* order, each one overriding the previous.
*/
if (config->log_level != 0)
virLogSetDefaultPriority(config->log_level);
- if (virLogSetDefaultOutput("virtlockd.log", godaemon, privileged) < 0)
- return -1;
-
- /* In case the config is empty, the filters become empty and outputs will
- * be set to default
+ /* In case the config is empty, both filters and outputs will become empty,
+ * however we can't start with empty outputs, thus we'll need to define and
+ * setup a default one.
*/
ignore_value(virLogSetFilters(config->log_filters));
ignore_value(virLogSetOutputs(config->log_outputs));
@@ -486,6 +482,15 @@ virLockDaemonSetupLogging(virLockDaemonConfigPtr config,
if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
virLogSetDefaultPriority(VIR_LOG_INFO);
+ /* Define the default output. This is only applied if there was no setting
+ * from either the config or the environment.
+ */
+ if (virLogSetDefaultOutput("virtlockd.log", godaemon, privileged) < 0)
+ return -1;
+
+ if (virLogGetNbOutputs() == 0)
+ virLogSetOutputs(virLogGetDefaultOutput());
+
return 0;
}
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index d878efa63..5a136c59d 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -388,19 +388,15 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config,
* Libvirtd's order of precedence is:
* cmdline > environment > config
*
- * The default output is applied only if there was no setting from either
- * the config or the environment. Because we don't have a way to determine
- * if the log level has been set, we must process variables in the opposite
+ * Given the precedence, we must process the variables in the opposite
* order, each one overriding the previous.
*/
if (config->log_level != 0)
virLogSetDefaultPriority(config->log_level);
- if (virLogSetDefaultOutput("virtlogd.log", godaemon, privileged) < 0)
- return -1;
-
- /* In case the config is empty, the filters become empty and outputs will
- * be set to default
+ /* In case the config is empty, both filters and outputs will become empty,
+ * however we can't start with empty outputs, thus we'll need to define and
+ * setup a default one.
*/
ignore_value(virLogSetFilters(config->log_filters));
ignore_value(virLogSetOutputs(config->log_outputs));
@@ -414,6 +410,15 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config,
if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
virLogSetDefaultPriority(VIR_LOG_INFO);
+ /* Define the default output. This is only applied if there was no setting
+ * from either the config or the environment.
+ */
+ if (virLogSetDefaultOutput("virtlogd.log", godaemon, privileged) < 0)
+ return -1;
+
+ if (virLogGetNbOutputs() == 0)
+ virLogSetOutputs(virLogGetDefaultOutput());
+
return 0;
}
diff --git a/src/util/virlog.c b/src/util/virlog.c
index 2228cf645..d45a451a7 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -1840,6 +1840,13 @@ virLogSetOutputs(const char *src)
if (src && *src)
outputstr = src;
+ /* This can only happen during daemon init when the default output is not
+ * determined yet. It's safe to do, since it's the only place setting the
+ * default output.
+ */
+ if (!outputstr)
+ return 0;
+
if ((noutputs = virLogParseOutputs(outputstr, &outputs)) < 0)
goto cleanup;
--
2.13.3
7 years, 1 month
[libvirt] [PATCH v2] qemu: Handle host devices not being available better
by Andrea Bolognani
We can't retrieve the isolation group of a device that's
not present in the system. However, it's very common for
VFs to be created late in the boot, so they might not be
present yet when libvirtd starts, which would cause the
guests using them to disappear.
Moreover, for other architectures and even ppc64 before
isolation groups were introduced, it's considered
perfectly fine to configure a guest to use a device
that's not yet (or no longer) available to the host,
with the obvious caveat that such a guest won't be able
to start before the device is available.
In order to be consistent, when a device's isolation
group can't be determined fall back to not isolating it
rather than erroring out or, worse, making the guest
disappear.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1484254
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Changes from [v1]:
* rewrite to always skip on error
[v1] https://www.redhat.com/archives/libvir-list/2017-August/msg00729.html
src/qemu/qemu_domain_address.c | 29 +++++++++++------------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 16bf0cdf9..f27d0ce8e 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -982,8 +982,6 @@ int
qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def,
virDomainDeviceDefPtr dev)
{
- int ret = -1;
-
/* Only host devices need their isolation group to be different from
* the default. Interfaces of type hostdev are just host devices in
* disguise, but we don't need to handle them separately because for
@@ -1012,12 +1010,11 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def,
tmp = virPCIDeviceAddressGetIOMMUGroupNum(hostAddr);
if (tmp < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Can't look up isolation group for host device "
- "%04x:%02x:%02x.%x"),
- hostAddr->domain, hostAddr->bus,
- hostAddr->slot, hostAddr->function);
- goto cleanup;
+ VIR_WARN("Can't look up isolation group for host device "
+ "%04x:%02x:%02x.%x, device won't be isolated",
+ hostAddr->domain, hostAddr->bus,
+ hostAddr->slot, hostAddr->function);
+ goto skip;
}
/* The isolation group for a host device is its IOMMU group,
@@ -1057,12 +1054,11 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def,
tmp = qemuDomainFindUnusedIsolationGroup(def);
if (tmp == 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Can't obtain usable isolation group for "
- "interface configured to use hostdev-backed "
- "network '%s'"),
- iface->data.network.name);
- goto cleanup;
+ VIR_WARN("Can't obtain usable isolation group for interface "
+ "configured to use hostdev-backed network '%s', "
+ "device won't be isolated",
+ iface->data.network.name);
+ goto skip;
}
info->isolationGroup = tmp;
@@ -1073,10 +1069,7 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def,
}
skip:
- ret = 0;
-
- cleanup:
- return ret;
+ return 0;
}
--
2.13.5
7 years, 1 month
[libvirt] [libvirt-php PATCH v2 00/11] Refactor into smaller components
by Dawid Zamirski
As per [1], this patch series splits up the large libvirt-php.c into
components that (attempts) to resemble the structure of the libvirt
project. Each patch successive patch was compile-tested while the whole
series was verified with "make check" and a simple custom written PHP
script.
Changes from v1 [2]:
* rebase on master
* include PHP headers in util.h instead of libvirt-php.h this makes
header inter-dependencies easier to manage/understand
* also test each patch on PHP 5
[1] https://www.redhat.com/archives/libvir-list/2017-June/msg00991.html
[2] https://www.redhat.com/archives/libvir-list/2017-August/msg00046.html
Dawid Zamirski (11):
Move PHP version compat macros to utils.h
Split up the bindings for libvirt connection API
Split up the bindings for libvirt node API
Split up the bindings for libvirt stream API
Split up the bindings for libvirt domain API
Split up the bindings for libvirt network API
Split up the bindings for libvirt storage API
Split up the bindings for libvirt snapshot API
Split up the bindings for libvirt nodedev API
Split up the bindings for libvirt NWFilter API
Fix is_local_connection implementation.
src/Makefile.am | 11 +-
src/libvirt-connection.c | 886 +++++
src/libvirt-connection.h | 81 +
src/libvirt-domain.c | 3344 +++++++++++++++++
src/libvirt-domain.h | 208 ++
src/libvirt-network.c | 587 +++
src/libvirt-network.h | 73 +
src/libvirt-node.c | 305 ++
src/libvirt-node.h | 23 +
src/libvirt-nodedev.c | 340 ++
src/libvirt-nodedev.h | 54 +
src/libvirt-nwfilter.c | 415 +++
src/libvirt-nwfilter.h | 66 +
src/libvirt-php.c | 9277 ++++------------------------------------------
src/libvirt-php.h | 496 +--
src/libvirt-snapshot.c | 244 ++
src/libvirt-snapshot.h | 58 +
src/libvirt-storage.c | 1130 ++++++
src/libvirt-storage.h | 137 +
src/libvirt-stream.c | 230 ++
src/libvirt-stream.h | 39 +
src/util.h | 200 +-
22 files changed, 9282 insertions(+), 8922 deletions(-)
create mode 100644 src/libvirt-connection.c
create mode 100644 src/libvirt-connection.h
create mode 100644 src/libvirt-domain.c
create mode 100644 src/libvirt-domain.h
create mode 100644 src/libvirt-network.c
create mode 100644 src/libvirt-network.h
create mode 100644 src/libvirt-node.c
create mode 100644 src/libvirt-node.h
create mode 100644 src/libvirt-nodedev.c
create mode 100644 src/libvirt-nodedev.h
create mode 100644 src/libvirt-nwfilter.c
create mode 100644 src/libvirt-nwfilter.h
create mode 100644 src/libvirt-snapshot.c
create mode 100644 src/libvirt-snapshot.h
create mode 100644 src/libvirt-storage.c
create mode 100644 src/libvirt-storage.h
create mode 100644 src/libvirt-stream.c
create mode 100644 src/libvirt-stream.h
--
2.13.3
7 years, 1 month
[libvirt] [PATCH 0/3] chardev and disk source format cleanup
by Pavel Hrdina
Pavel Hrdina (3):
util: introduce virBufferSetChildIndent macro
util: introduce virXMLFormatElement helper
conf: don't close the source element inside different function
src/conf/capabilities.c | 3 +-
src/conf/cpu_conf.c | 3 +-
src/conf/domain_conf.c | 125 ++++++++++++---------
src/libvirt_private.syms | 1 +
src/util/virbuffer.h | 9 ++
src/util/virxml.c | 47 ++++++++
src/util/virxml.h | 6 +
.../qemuxml2xmlout-seclabel-dynamic-labelskip.xml | 3 +-
8 files changed, 135 insertions(+), 62 deletions(-)
--
2.13.5
7 years, 1 month
[libvirt] [PATCH] maint: Update to latest gnulib
by Erik Skultety
This pulls in, among other new things, vc-list-files fix to make
syntax-check work with git worktrees.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
As per http://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00171.html which
fixes the build with old autoconf, pushing this patch under the gnulib
maintenance rule. Again, thanks a lot for fixing it so fast Eric :).
.gnulib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gnulib b/.gnulib
index ce4ee4cbb..8d116e3f6 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit ce4ee4cbb596a9d7de2786cf8c48cf62a4edede7
+Subproject commit 8d116e3f657cb120f79efbbb675fa3cc9d21f53e
--
2.13.3
7 years, 1 month