[libvirt] [PATCH 0/6] conf: qemu: Introduce relaxed config validation
by Peter Krempa
Recently I NACKed quite a few patches attempting to add checks to the post
parse callback infrastructure that would inhbit configs from being loaded
after daemon restart.
To solve this introduce a new infrastructure that will get called only on
codepaths that define and start the config leaving the code paths that load
configs untouched.
Peter Krempa (6):
conf: disk: Rename virDomainDiskDefValidate to
virDomainDiskDefParseValidate
qemu: driver: Fix function header alignment of some functions
conf: Introduce infrastructure to add config validation to define time
qemu: Move check that validates 'min_guarantee' to
qemuDomainDefValidate
conf: Move check that validates disk info to virDomainDefValidate
conf: Add validation infrastructure for device hot/cold plug
src/conf/domain_conf.c | 128 +++++++++++++++++++++++++++++++++++++++--------
src/conf/domain_conf.h | 11 ++--
src/libvirt_private.syms | 3 +-
src/qemu/qemu_conf.h | 2 +
src/qemu/qemu_domain.c | 38 ++++++++++++++
src/qemu/qemu_domain.h | 3 ++
src/qemu/qemu_driver.c | 26 ++++++++--
src/qemu/qemu_process.c | 19 ++++---
8 files changed, 190 insertions(+), 40 deletions(-)
--
2.8.2
8 years, 7 months
[libvirt] [PATCH 0/3] More usage of virGetLastErrorMessage()
by Jovanka Gulicoska
v2 of patches
Use virGetLastErrorMessage() insted of virGetLastError()
Link to task: http://wiki.libvirt.org/page/BiteSizedTasks#More_usage_of_virGetLastError...
Jovanka Gulicoska (3):
virGetLastErrorMessage() in tests
More usage of virGetLastErrorMessage()
virGetLastErrorMessage in nodeinfotest
daemon/libvirtd.c | 8 +---
examples/object-events/event-test.c | 9 ++---
src/bhyve/bhyve_driver.c | 3 +-
src/conf/virsecretobj.c | 5 +--
src/libvirt.c | 3 +-
src/libxl/libxl_domain.c | 3 +-
src/libxl/libxl_driver.c | 4 +-
src/locking/lock_daemon.c | 8 +---
src/logging/log_daemon.c | 8 +---
src/lxc/lxc_container.c | 9 ++---
src/lxc/lxc_controller.c | 9 ++---
src/lxc/lxc_domain.c | 4 +-
src/lxc/lxc_process.c | 6 +--
src/rpc/virnettlscontext.c | 3 +-
src/storage/storage_driver.c | 16 ++------
src/uml/uml_driver.c | 3 +-
src/util/iohelper.c | 10 +----
src/util/virhook.c | 3 +-
src/util/virhostdev.c | 20 ++++-----
tests/commandtest.c | 81 +++++++++++++------------------------
tests/libvirtdconftest.c | 26 ++++++------
tests/nodeinfotest.c | 8 ++--
tests/openvzutilstest.c | 7 +---
tests/qemucapsprobe.c | 6 +--
tests/securityselinuxtest.c | 6 +--
25 files changed, 91 insertions(+), 177 deletions(-)
--
2.5.5
8 years, 7 months
[libvirt] [PATCH] tests: Add forgotten backslash
by Michal Privoznik
While introducing virtestmock.la, I've forgotten to add '\' at
the end of one line leaving our Makefile.am mangled. Fortunately,
the only thing that comes after is '$(NULL)' so nothing is
terribly broken.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule.
tests/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 238f6da..c7c9a03 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -447,7 +447,7 @@ endif WITH_DBUS
if WITH_LINUX
test_libraries += virusbmock.la \
virnetdevbandwidthmock.la \
- virtestmock.la
+ virtestmock.la \
$(NULL)
endif WITH_LINUX
--
2.8.1
8 years, 7 months
[libvirt] [PATCH 0/4] Remove need for STATIC_ANALYSIS in viralloc.h
by John Ferlan
Not sure which release exactly, but the coverity analysis bug I filed that
was the reason for commit id 'c9a85af31' has been fixed, so it's time to
remove that... In doing so uncovered another issue - it seems the fix for
Coverity addressed the primary problem we've seen, but when there's functions
returning allocated strings by reference that can also VIR_FREE(*string),
whatever was added to address the main issue doesn't seem to recognize this
other usage, resulinting in a false positive resource_leak. Luckily there's
only two instances in our code for that. One is addressed by patch 3 and
the other in virPCIDeviceGetDriverPathAndName which would require quite
a few more changes to address (essentially split up the function - it'll
be on my "to do" list).
Patch 1:
Addresses an issue seen once patches 2-4 were applied - that there's a
real problem with the error path. It's a simple fix.
Patches 2 & 3:
Address a false positive resource leak even with patch 4 applied.
Patch 4:
Remove the rather ugly !STATIC_ANALYSIS within the VIR_FREE and VIR_DISPOSE*
macros. As I found with a build after the fact, VIR_DISPOSE_STRING was missing
an argument anyway (it should have been ": 0, 1, NULL" instead of ": 1, NULL").
NB: Patch 4 has been run through the private coverity server...
John Ferlan (4):
util: Fix error path for virPCIGetVirtualFunctions
util: Remove need for ret in virPCIGetPhysicalFunction
util: Adjust return for virPCIGetDeviceAddressFromSysfsLink
util: Remove need for STATIC_ANALYSIS check
src/util/viralloc.h | 34 ++++++----------------------------
src/util/virpci.c | 39 +++++++++++++++++++--------------------
2 files changed, 25 insertions(+), 48 deletions(-)
--
2.5.5
8 years, 7 months
[libvirt] [PATCH 0/3] Patches to set up the secret encryption
by John Ferlan
Based on v4 of the AES secret object series:
http://www.redhat.com/archives/libvir-list/2016-May/msg01292.html
Could have been an RFC too...
Precursor for the AES secret object patches - figured I'd make sure this
was the "right path" and hopefully to get some help with the mock environment
since the virRandomBytes would move out of qemuxml2argvtest.
Patch 3 is new and will work independent of 1 & 2, although it would be
nice to alther the vircryptotest to use a mocked virRandomBytes rather
than seeing the encalg and iv with what the mocked code would return.
John Ferlan (3):
tests: Add mock for virRandomBytes
tests: Need help... Trying to add virRandomBytes mock
util: Introduce encryption APIs
configure.ac | 1 +
src/libvirt_private.syms | 2 +
src/util/vircrypto.c | 189 ++++++++++++++++++++++++++++++++++++++++++++++-
src/util/vircrypto.h | 20 ++++-
tests/Makefile.am | 16 ++++
tests/commandhelper.c | 1 +
tests/vircryptotest.c | 86 +++++++++++++++++++++
tests/virrandommock.c | 56 ++++++++++++++
tests/virrandomtest.c | 86 +++++++++++++++++++++
9 files changed, 455 insertions(+), 2 deletions(-)
create mode 100644 tests/virrandommock.c
create mode 100644 tests/virrandomtest.c
--
2.5.5
8 years, 7 months
[libvirt] hotplug support for "filesystem" devices?
by Snyder, Emile
Hello all,
I'm a newbie to libvirt, coming to it because I'm trying to understand how to provide the ability to attach/detach network filesystem shares to openstack guest instances in something analogous to the way block devices can be now.
While playing with the existing virtfs/9p support for qemu, I found that I can't use virsh to attach a "filesystem" device while the VM is running. For example, I create a snippet of XML like
<filesystem type='mount' accessmode='mapped'>
<source dir='/tmp/share'/>
<target dir='share_tag'/>
</filesystem>
and then try:
stack@devstack-8366:~/devstack$ virsh list
Id Name State
----------------------------------------------------
3 instance-00000002 running
5 instance-00000004 running
8 instance-00000007 running
stack@devstack-8366:~/devstack$ virsh attach-device 8 share.xml
error: Failed to attach device from share.xml
error: Operation not supported: live attach of device 'filesystem' is not supported
I see that error coming from src/qemu/qemu_driver.c in the qemuDomainAttachDeviceLive function.
Can anyone tell me if this is something that is going to be hard or easy to make possible? Pointers to where I should look in the source, or in qemu? Is anyone working it already?
Any advice at all welcome,
Thanks
-Emile Snyder
8 years, 7 months
[libvirt] [PATCH 0/3] qemu: Don't get stuck in bulk-stats API on broken NFS
by Peter Krempa
Accessing VM disk files while we weren't able to get the stats from qemu
directly as it was most probably stuck on missing storage will make libvrtd's
thread handling the stats get stuck. Avoid touching files in such case.
Peter Krempa (3):
qemu: driver: Remove unnecessary flag in qemuDomainGetStatsBlock
qemu: driver: Separate bulk stats worker for block devices
qemu: bulk stats: Don't access possibly blocked storage
src/qemu/qemu_driver.c | 78 +++++++++++++++++++++++++++++++-------------------
1 file changed, 49 insertions(+), 29 deletions(-)
--
2.8.2
8 years, 7 months
[libvirt] [PATCH v2 0/2] qemu: parse: Introduce qemuParseCommandLineMem
by Nishith Shah
This series moves the parsing of qemu -m memory into a separate function
and adds suffix support for the -m option.
The first patch introduces the function qemuParseCommandLineMem, and the
second patch handles suffixes for the -m values and adds a test for the
same.
Nishith Shah (2):
qemu: parse: Use qemuParseCommandLineMem for -m memory
qemu: parse: Handle suffixes for -m memory
src/qemu/qemu_parse_command.c | 38 ++++++++++++++++++----
tests/qemuargv2xmldata/qemuargv2xml-mem-scale.args | 22 +++++++++++++
tests/qemuargv2xmldata/qemuargv2xml-mem-scale.xml | 33 +++++++++++++++++++
tests/qemuargv2xmltest.c | 1 +
4 files changed, 87 insertions(+), 7 deletions(-)
create mode 100644 tests/qemuargv2xmldata/qemuargv2xml-mem-scale.args
create mode 100644 tests/qemuargv2xmldata/qemuargv2xml-mem-scale.xml
--
2.1.4
8 years, 7 months
[libvirt] [PATCH] Introduce gnutls_priority config option
by Ján Tomko
The defaults provided by gnutls_set_default_priority are not configurable
at runtime. Introduce a new config option to libvirt.conf that will
be passed to gnutls_priority_set.
One of the possible options is "@SYSTEM", where gnutls will get the settings
from /etc/gnutls/default-priorities.
Note that the /etc/libvirt/libvirt.conf file is only used by libvirt
processes running as root, for regular users the file in
$XDG_CONFIG_HOME or ~/.config is used.
https://bugzilla.redhat.com/show_bug.cgi?id=1333404
---
src/libvirt.conf | 6 +++++
src/rpc/virnettlscontext.c | 59 +++++++++++++++++++++++++++++++++++++++-------
2 files changed, 56 insertions(+), 9 deletions(-)
diff --git a/src/libvirt.conf b/src/libvirt.conf
index da4dfbe..688c572 100644
--- a/src/libvirt.conf
+++ b/src/libvirt.conf
@@ -16,3 +16,9 @@
# (@uri_default also prevents probing of the hypervisor driver).
#
#uri_default = "qemu:///system"
+
+#
+# Override the priority of exchange methods, ciphers etc. used by gnutls.
+# See gnutls_priority_set_direct(3).
+#
+#gnutls_priority = "@SYSTEM"
diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
index 947038d..e93887c 100644
--- a/src/rpc/virnettlscontext.c
+++ b/src/rpc/virnettlscontext.c
@@ -35,6 +35,7 @@
#include "virstring.h"
#include "viralloc.h"
+#include "virconf.h"
#include "virerror.h"
#include "virfile.h"
#include "virutil.h"
@@ -86,10 +87,17 @@ static virClassPtr virNetTLSContextClass;
static virClassPtr virNetTLSSessionClass;
static void virNetTLSContextDispose(void *obj);
static void virNetTLSSessionDispose(void *obj);
+static gnutls_priority_t *virNetTLSPriorityCache;
static int virNetTLSContextOnceInit(void)
{
+ virConfPtr conf = NULL;
+ virConfValuePtr value = NULL;
+ const char *err_pos;
+ int ret = -1;
+ int rc;
+
if (!(virNetTLSContextClass = virClassNew(virClassForObjectLockable(),
"virNetTLSContext",
sizeof(virNetTLSContext),
@@ -102,7 +110,32 @@ static int virNetTLSContextOnceInit(void)
virNetTLSSessionDispose)))
return -1;
- return 0;
+ if (virConfLoadConfig(&conf, NULL) < 0)
+ return -1;
+
+ if ((value = virConfGetValue(conf, "gnutls_priority"))) {
+ if (value->type != VIR_CONF_STRING) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Expected a string for 'gnutls_priority' config parameter"));
+ goto cleanup;
+ }
+ VIR_DEBUG("Using gnutls priority '%s'", value->str);
+ if (VIR_ALLOC(virNetTLSPriorityCache) < 0)
+ goto cleanup;
+ if ((rc = gnutls_priority_init(virNetTLSPriorityCache, value->str,
+ &err_pos)) != 0) {
+ VIR_FREE(virNetTLSPriorityCache);
+ virReportError(VIR_ERR_SYSTEM_ERROR,
+ _("Failed to initialize TLS session priority \"%s\": %s"),
+ err_pos, gnutls_strerror(rc));
+ goto cleanup;
+ }
+ }
+
+ ret = 0;
+ cleanup:
+ virConfFree(conf);
+ return ret;
}
VIR_ONCE_GLOBAL_INIT(virNetTLSContext)
@@ -1224,14 +1257,22 @@ virNetTLSSessionPtr virNetTLSSessionNew(virNetTLSContextPtr ctxt,
goto error;
}
- /* avoid calling all the priority functions, since the defaults
- * are adequate.
- */
- if ((err = gnutls_set_default_priority(sess->session)) != 0) {
- virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Failed to set TLS session priority %s"),
- gnutls_strerror(err));
- goto error;
+ /* Use the defaults unless a priority string was specified in the
+ * config file */
+ if (virNetTLSPriorityCache) {
+ if ((err = gnutls_priority_set(sess->session, *virNetTLSPriorityCache)) != 0) {
+ virReportError(VIR_ERR_SYSTEM_ERROR,
+ _("Failed to set TLS session priority %s"),
+ gnutls_strerror(err));
+ goto error;
+ }
+ } else {
+ if ((err = gnutls_set_default_priority(sess->session)) != 0) {
+ virReportError(VIR_ERR_SYSTEM_ERROR,
+ _("Failed to set TLS session priority %s"),
+ gnutls_strerror(err));
+ goto error;
+ }
}
if ((err = gnutls_credentials_set(sess->session,
--
2.7.3
8 years, 7 months
[libvirt] [PATCH v7 0/5] vz: add migration support
by Nikolay Shirokovskiy
Difference from v6
==================
Minor fixes suggested by reviewer.
Nikolay Shirokovskiy (5):
vz: save session uuid on login
vz: fix const correctness case
vz: implement managed migration
vz: implement p2p migration
vz: cleanup: define vz format of uuids
src/vz/vz_driver.c | 559 +++++++++++++++++++++++++++++++++++++++++++++++++++++
src/vz/vz_sdk.c | 90 +++++++--
src/vz/vz_sdk.h | 6 +
src/vz/vz_utils.c | 2 +-
src/vz/vz_utils.h | 7 +-
5 files changed, 648 insertions(+), 16 deletions(-)
--
1.8.3.1
8 years, 7 months