[libvirt] [RFC PATCH 0/5] ivshmem support
by Maxime Leroy
The following patches are an implementation proposal
for the ivshmem device support in libvirt.
Any feedback is welcome.
Note:
SELinux is not supported (need to be done for the next
patchset version)
Maxime Leroy (5):
doc: schema: Add basic documentation for the ivshmem support
conf: Parse and format ivshmem device XML
qemu: Add cap flag QEMU_CAPS_IVSHMEM
qemu: Build command line for ivshmem device
tests: Add tests for ivshmem device handling
docs/formatdomain.html.in | 72 +++++++
docs/schemas/domaincommon.rng | 57 ++++++
src/conf/domain_conf.c | 234 ++++++++++++++++++++++-
src/conf/domain_conf.h | 40 ++++
src/libvirt_private.syms | 4 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 77 ++++++++
src/qemu/qemu_command.h | 4 +
src/qemu/qemu_hotplug.c | 1 +
tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
tests/qemuhelptest.c | 15 +-
tests/qemuxml2argvdata/qemuxml2argv-ivshmem.args | 10 +
tests/qemuxml2argvdata/qemuxml2argv-ivshmem.xml | 36 ++++
tests/qemuxml2argvtest.c | 3 +
tests/qemuxml2xmltest.c | 2 +
21 files changed, 558 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ivshmem.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ivshmem.xml
--
1.9.3
10 years, 4 months
[libvirt] [PATCH 0/2] journald logging rate limit fix
by Peter Krempa
Peter Krempa (2):
libvirtd: conf: Mention support for logging into journald
daemon: Limit default log level to journald to VIR_LOG_INFO
daemon/libvirtd.c | 10 +++++++++-
daemon/libvirtd.conf | 6 ++++++
2 files changed, 15 insertions(+), 1 deletion(-)
--
2.0.2
10 years, 4 months
[libvirt] Initializing qemu driver
by David kiarie
Hi there,
I get this errors trying to intialialize libvirtd
$libvirtd -vvv
2014-08-12 21:57:47.887+0000: 6449: info : libvirt version: 1.2.8
2014-08-12 21:57:47.887+0000: 6449: warning : virGetHostname:665 :
getaddrinfo failed for 'linux-xzc4': Name or service not known
2014-08-12 21:57:48.034+0000: 6461: info : libvirt version: 1.2.8
2014-08-12 21:57:48.034+0000: 6461: error :
virFileGetDefaultHugepageSize:2958 : internal error: Unable to parse
/proc/meminfo
2014-08-12 21:57:48.034+0000: 6461: error : virStateInitialize:749 :
Initialization of QEMU state driver failed: internal error: Unable to
parse /proc/meminfo
2014-08-12 21:57:48.034+0000: 6461: error : daemonRunStateInit:922 :
Driver state initialization failed
Is someone else experiencing the same thing?
10 years, 4 months
[libvirt] [PATCH] maint: improve syntax check for space around =
by Eric Blake
Laine Stump noted on IRC that syntax check wasn't flagging his
typo of 'i= 0'. This fixes it.
* build-aux/bracket-spacing.pl: Tighten space-around-= rule.
* src/storage/storage_backend.c
(virStorageBackendCreateExecCommand): Fix offenders.
* src/util/virnuma.c (virNumaGetDistances): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainSnapshotDeleteMetadataOnly)
(vboxNetworkGetXMLDesc): Likewise.
* src/xenapi/xenapi_driver.c (xenapiDomainLookupByName):
Likewise.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
build-aux/bracket-spacing.pl | 11 +++++------
src/storage/storage_backend.c | 2 +-
src/util/virnuma.c | 2 +-
src/vbox/vbox_tmpl.c | 6 +++---
src/xenapi/xenapi_driver.c | 2 +-
5 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/build-aux/bracket-spacing.pl b/build-aux/bracket-spacing.pl
index e4ae8f0..ac01a56 100755
--- a/build-aux/bracket-spacing.pl
+++ b/build-aux/bracket-spacing.pl
@@ -32,8 +32,8 @@ foreach my $file (@ARGV) {
while (defined (my $line = <FILE>)) {
my $data = $line;
- # Kill any quoted , ; or "
- $data =~ s/'[";,]'/'X'/g;
+ # Kill any quoted , ; = or "
+ $data =~ s/'[";,=]'/'X'/g;
# Kill any quoted strings
$data =~ s,"([^\\\"]|\\.)*","XXX",g;
@@ -147,10 +147,9 @@ foreach my $file (@ARGV) {
# Require spaces around assignment '=', compounds and '=='
# with the exception of virAssertCmpInt()
- while ($data =~ /[^!<>&|\-+*\/%\^'= ]=\+[^=]/ ||
- $data =~ /[^!<>&|\-+*\/%\^'=]=[^= \\\n]/ ||
- $data =~ /[\S]==/ ||
- ($data =~ /==[^\s,]/ && $data !~ /[\s]virAssertCmpInt\(/)) {
+ $data =~ s/(virAssertCmpInt\(.* ).?=,/$1op,/;
+ while ($data =~ /[^ ]\b[!<>&|\-+*\/%\^=]?=[^=]/ ||
+ $data =~ /=[^= \\\n]/) {
print "$file:$.: $line";
$ret = 1;
last;
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index 5cada39..42eee75 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -615,7 +615,7 @@ virStorageBackendCreateExecCommand(virStoragePoolObjPtr pool,
if (virCommandRun(cmd, NULL) == 0) {
/* command was successfully run, check if the file was created */
- if (stat(vol->target.path, &st) >=0)
+ if (stat(vol->target.path, &st) >= 0)
filecreated = true;
}
}
diff --git a/src/util/virnuma.c b/src/util/virnuma.c
index 7a11a3b..9e6e5f7 100644
--- a/src/util/virnuma.c
+++ b/src/util/virnuma.c
@@ -451,7 +451,7 @@ virNumaGetDistances(int node,
*ndistances = max_node + 1;
- for (i = 0; i<= max_node; i++) {
+ for (i = 0; i <= max_node; i++) {
if (!virNumaNodeIsAvailable(node))
continue;
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index ccba736..bccb4a7 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -8397,7 +8397,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
virDomainPtr dom = snapshot->domain;
VBOX_OBJECT_CHECK(dom->conn, int, -1);
- virDomainSnapshotDefPtr def= NULL;
+ virDomainSnapshotDefPtr def = NULL;
char *defXml = NULL;
vboxIID domiid = VBOX_IID_INITIALIZER;
nsresult rc;
@@ -10173,7 +10173,7 @@ static char *vboxNetworkGetXMLDesc(virNetworkPtr network,
&dhcpServer);
if (dhcpServer) {
ipdef->nranges = 1;
- if (VIR_ALLOC_N(ipdef->ranges, ipdef->nranges) >=0) {
+ if (VIR_ALLOC_N(ipdef->ranges, ipdef->nranges) >= 0) {
PRUnichar *ipAddressUtf16 = NULL;
PRUnichar *networkMaskUtf16 = NULL;
PRUnichar *fromIPAddressUtf16 = NULL;
@@ -10211,7 +10211,7 @@ static char *vboxNetworkGetXMLDesc(virNetworkPtr network,
}
ipdef->nhosts = 1;
- if (VIR_ALLOC_N(ipdef->hosts, ipdef->nhosts) >=0) {
+ if (VIR_ALLOC_N(ipdef->hosts, ipdef->nhosts) >= 0) {
if (VIR_STRDUP(ipdef->hosts[0].name, network->name) < 0) {
VIR_FREE(ipdef->hosts);
ipdef->nhosts = 0;
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 5bcfd29..50331c9 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -691,7 +691,7 @@ xenapiDomainLookupByName(virConnectPtr conn,
}
vm = vms->contents[0];
xen_vm_get_uuid(session, &uuid, vm);
- if (uuid!=NULL) {
+ if (uuid != NULL) {
ignore_value(virUUIDParse(uuid, raw_uuid));
domP = virGetDomain(conn, name, raw_uuid);
if (domP != NULL) {
--
1.7.1
10 years, 4 months
[libvirt] [PATCH 0/3] Fix libvirtd crash when starting two managedsave operations on a single domain
by Peter Krempa
We had an unfortunate code path where when you'd start two managedsave operations
simultaneously libvirtd would crash. Fix it by adding a VM liveness check.
Peter Krempa (3):
qemu: managedsave: Check that VM is alive after entering async job
security: selinux: Set saved state label only if it is available
qemu: migration: Check domain live state after exitting the monitor
src/qemu/qemu_driver.c | 6 ++++++
src/qemu/qemu_migration.c | 19 +++++++++++++++++--
src/security/security_selinux.c | 2 +-
3 files changed, 24 insertions(+), 3 deletions(-)
--
2.0.2
10 years, 4 months
[libvirt] [PATCH] bhyve: fix error message in bhyveStateInitialize
by Dmitry Guryanov
If we failed to create BHYVE_STATE_DIR, we should show this
path, not BHYVE_LOG_DIR.
---
src/bhyve/bhyve_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 135cb24..eb8f9af 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1191,7 +1191,7 @@ bhyveStateInitialize(bool priveleged ATTRIBUTE_UNUSED,
if (virFileMakePath(BHYVE_STATE_DIR) < 0) {
virReportSystemError(errno,
_("Failed to mkdir %s"),
- BHYVE_LOG_DIR);
+ BHYVE_STATE_DIR);
goto cleanup;
}
--
1.9.3
10 years, 4 months
[libvirt] [PATCH] qemu_conf: Undefine the correct symbol
by Michal Privoznik
At the beginning of the qemu config file parsing function there
are 3 helper macros defined: GET_VALUE_BOOL, GET_VALUE_LONG and
GET_VALUE_STR. Later, when they are no longer needed they are
undefined in order to keep the namespace clean. However, the
GET_VALUE_STRING is undefined instead of GET_VALUE_STR.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed as trivial.
src/qemu/qemu_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index b14b1bc..238d2b1 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -662,7 +662,7 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
}
#undef GET_VALUE_BOOL
#undef GET_VALUE_LONG
-#undef GET_VALUE_STRING
+#undef GET_VALUE_STR
virQEMUDriverConfigPtr virQEMUDriverGetConfig(virQEMUDriverPtr driver)
{
--
1.8.5.5
10 years, 4 months
[libvirt] [PATCH v2] storage: ZFS support
by Roman Bogorodskiy
Changes from the initial version:
- Update docs/schemas and docs/storage.html.in with ZFS backend
information
- Drop StartPool and StopPool that does nothing and therefore
not needed
- Fix memory leak in 'tokens' variable
- Fill volume key before creating a volume
- Use volume's target.path as a key
- Allow not to specify 'target' for pool because in any case
it should be /dev/zvol/$poolname
Few notes on Linux support:
I've been playing around with http://zfsonlinux.org/. I noticed it
missed '-H' switch to provide a machine-friendly output and
created a feature request:
https://github.com/zfsonlinux/zfs/issues/2522
It was quickly fixed, so I've updated from the git version and moved on.
>From that point it worked well and the only thing I had to modify is
not to pass 'volmode' parameter during volume creation (it's freebsd specific
and it could be e.g. just cdev or a FreeBSD geom provider).
So, basically, for the current (limited) feature set the two things
need to be checked on Linux:
- zpool get support for -H switch
- zfs volmode support for volume creation
I'm open for suggestions what would be a good way to check it. For the '-H'
thing, I was thinking about calling just 'zpool get -H' in StartPool. If
the error says 'invalid option 'H'' (i.e. check if it just contains 'H'), then
return an error that zfs version is too old. That's fragile, but probably
less fragile than parsing usage that looks like that:
usage:
get [-pH] <"all" | property[,...]> <pool> ...
As for the 'volmode', it's simple in terms of parsing, because e.g. 'zfs get' prints
a nice set of parameters e.g.:
volblocksize NO YES 512 to 128k, power of 2
volmode YES YES default | geom | dev | none
volsize YES NO <size>
So it should not be a problem to check it once and save in some sort of state struct
inside of the ZFS backend.
Roman Bogorodskiy (1):
storage: ZFS support
configure.ac | 43 +++++
docs/schemas/storagepool.rng | 20 +++
docs/storage.html.in | 34 ++++
include/libvirt/libvirt.h.in | 1 +
po/POTFILES.in | 1 +
src/Makefile.am | 8 +
src/conf/storage_conf.c | 15 +-
src/conf/storage_conf.h | 4 +-
src/qemu/qemu_conf.c | 1 +
src/storage/storage_backend.c | 6 +
src/storage/storage_backend_zfs.c | 329 ++++++++++++++++++++++++++++++++++++++
src/storage/storage_backend_zfs.h | 29 ++++
src/storage/storage_driver.c | 1 +
tools/virsh-pool.c | 3 +
14 files changed, 492 insertions(+), 3 deletions(-)
create mode 100644 src/storage/storage_backend_zfs.c
create mode 100644 src/storage/storage_backend_zfs.h
--
1.9.0
10 years, 4 months
[libvirt] [PATCH] qemu: process: Fix header format of qemuProcessSetVcpuAffinities
by Peter Krempa
Fix header alignment and remove the unused conn parameter.
---
Notes:
Pushed as trivial.
src/qemu/qemu_process.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 407da5e..9e6a9ae 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2221,8 +2221,7 @@ qemuProcessSetLinkStates(virDomainObjPtr vm)
/* Set CPU affinities for vcpus if vcpupin xml provided. */
static int
-qemuProcessSetVcpuAffinities(virConnectPtr conn ATTRIBUTE_UNUSED,
- virDomainObjPtr vm)
+qemuProcessSetVcpuAffinities(virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainDefPtr def = vm->def;
@@ -4243,7 +4242,7 @@ int qemuProcessStart(virConnectPtr conn,
goto cleanup;
VIR_DEBUG("Setting VCPU affinities");
- if (qemuProcessSetVcpuAffinities(conn, vm) < 0)
+ if (qemuProcessSetVcpuAffinities(vm) < 0)
goto cleanup;
VIR_DEBUG("Setting affinity of emulator threads");
--
2.0.2
10 years, 4 months
[libvirt] [PATCH 1/1] qemu: min_guarantee: Parameter 'min_guarantee' not supported
by Erik Skultety
The 'min_guarantee' is used by esx and vmx drivers, with qemu however,
libvirt should report error when starting a domain, because this
element is not used. Resolves
https://bugzilla.redhat.com/show_bug.cgi?id=1122455
---
src/qemu/qemu_process.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 407da5e..22247fd 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3994,6 +3994,13 @@ int qemuProcessStart(virConnectPtr conn,
flags & VIR_QEMU_PROCESS_START_COLD) < 0)
goto cleanup;
+ if (vm->def->mem.min_guarantee) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Parameter 'min_guarantee' "
+ "not supported"));
+ goto cleanup;
+ }
+
if (VIR_ALLOC(priv->monConfig) < 0)
goto cleanup;
--
1.9.3
10 years, 4 months