[libvirt] [PATCH 00/22] Python tweaks
by Radostin Stoyanov
These patches improve the code style of python code
by applying some PEP8 recommendations and simplifying
some functions.
Radostin Stoyanov (22):
apibuild: Use isinctance for type checking
apibuild: Split imports on separate lines
apibuild: Remove whitespace before ',' and ':'
python: Add whitespace around = and % operators
esx_vi_generator: Simplify generate_helper_source
esx_vi_generator: Simplify generate_helper_header
esx_vi_generator: Simplify get_occurrence_comment
esx_vi_generator: Simplify alignment function
apibuild: Simplify conditional statements
python: Remove space around = in keyword args
WmiClass: Don't share "versions" between instances
apibuild: Simplify uniq function
apibuild: Avoid double sorting of ids
python3: cpu-reformat: Use the print() function
apibuild: Drop backslash between brackets
apibuild: Fix indentation not multiple of 4
apibuild: Simplify strip_lead_star()
apibuild: Simplify parseTypeComment()
apibuild: Simplify type checking of literals
apibuild: Use list comprehension insteand of map
apibuild: Simplify merging of preproc tokens
apibuild: Simplify parsing string tokens
docs/apibuild.py | 643 +++++++++++++++++--------------------
docs/index.py | 54 ++--
src/esx/esx_vi_generator.py | 179 +++++------
src/hyperv/hyperv_wmi_generator.py | 36 ++-
tests/cputestdata/cpu-cpuid.py | 6 +-
tests/cputestdata/cpu-reformat.py | 6 +-
6 files changed, 424 insertions(+), 500 deletions(-)
--
2.14.3
6 years, 8 months
[libvirt] [PATCH v5 0/9] Add setting CPU features (CPUID) with libxenlight driver.
by Marek Marczykowski-Górecki
Add support for CPUID setting based on <cpu> element. Since libxl format
support only adjusting specific bits over host CPU, only
mode='host-passthrough' is supported - other values are rejected (including
default 'custom'). This will break some configurations working before (bare
<cpu> element with for example NUMA configuration), but libxl driver never
supported full 'custom' mode - it was silently ignored, which might lead to
some unexpected effects.
Since mode='host-passthrough' is now necessary to specify CPU options, do not
enable nested HVM feature by mere presence of this element, require also
enabling it in libxl.conf. Nested HVM is still in "preview" state, so better be
explicit here.
v2 of this patch series:
https://www.redhat.com/archives/libvir-list/2017-July/msg00050.html
v3 of this patch series:
https://www.redhat.com/archives/libvir-list/2017-December/msg00314.html
v4 of this patch series:
https://www.redhat.com/archives/libvir-list/2018-February/msg00504.html
Marek Marczykowski-Górecki (9):
libxl: fix libxlDriverConfigDispose for partially constructed object
libxl: pass driver config to libxlMakeDomBuildInfo
libxl: error out on not supported CPU mode, instead of silently ignoring
libxl: do not enable nested HVM unless global nested_hvm option enabled
xenconfig: do not override def->cpu if already set elsewhere
libxl: add support for CPUID features policy
tests: check CPU features handling in libxl driver
xenconfig: add CPUID handling to domXML <-> xl.cfg conversion
tests: add test case for CPUID in xenconfig driver
src/libxl/libvirtd_libxl.aug | 2 +-
src/libxl/libxl.conf | 8 +-
src/libxl/libxl_conf.c | 70 ++-
src/libxl/libxl_conf.h | 6 +-
src/libxl/libxl_domain.c | 7 +-
src/libxl/test_libvirtd_libxl.aug.in | 1 +-
src/xenconfig/xen_xl.c | 238 ++++++++-
src/xenconfig/xen_xl.h | 2 +-
tests/libxlxml2domconfigdata/fullvirt-cpuid.json | 64 ++-
tests/libxlxml2domconfigdata/fullvirt-cpuid.xml | 37 +-
tests/libxlxml2domconfigtest.c | 27 +-
tests/virmocklibxl.c | 25 +-
tests/xlconfigdata/test-fullvirt-cpuid.cfg | 25 +-
tests/xlconfigdata/test-fullvirt-cpuid.xml | 35 +-
tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.cfg | 1 +-
tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.xml | 2 +-
tests/xlconfigdata/test-fullvirt-vnuma-nodistances.cfg | 1 +-
tests/xlconfigdata/test-fullvirt-vnuma-nodistances.xml | 2 +-
tests/xlconfigdata/test-fullvirt-vnuma-partialdist.cfg | 1 +-
tests/xlconfigdata/test-fullvirt-vnuma-partialdist.xml | 2 +-
tests/xlconfigdata/test-fullvirt-vnuma.cfg | 1 +-
tests/xlconfigdata/test-fullvirt-vnuma.xml | 2 +-
tests/xlconfigtest.c | 1 +-
23 files changed, 509 insertions(+), 51 deletions(-)
create mode 100644 tests/libxlxml2domconfigdata/fullvirt-cpuid.json
create mode 100644 tests/libxlxml2domconfigdata/fullvirt-cpuid.xml
create mode 100644 tests/xlconfigdata/test-fullvirt-cpuid.cfg
create mode 100644 tests/xlconfigdata/test-fullvirt-cpuid.xml
base-commit: 6ce3acc129bfdbe7fd02bcb8bbe8af6d13903684
--
git-series 0.9.1
6 years, 8 months
[libvirt] [dbus PATCH 0/8] some improvements and rewrite to GDBus
by Pavel Hrdina
Pavel Hrdina (8):
configure: call AC_PROG_CC_STDC to enable C99 if necessary
configure: use LIBVIRT_ARG_WITH macro
spec: explicitly require gcc
m4: remove gnulib compile warning exceptions
maint: set the first minimal version that will be released
introduce support for GDBus implementation
switch from sd-bus to GDBus implementation
main: introduce thread pool to process D-Bus messages
README | 2 +-
configure.ac | 53 ++--
data/Makefile.am | 7 +
data/org.libvirt.Connect.xml | 56 ++++
data/org.libvirt.Domain.xml | 51 +++
libvirt-dbus.spec.in | 11 +-
m4/virt-compile-warnings.m4 | 37 ---
src/Makefile.am | 20 +-
src/connect.c | 320 ++++++++-----------
src/connect.h | 36 +--
src/domain.c | 729 +++++++++++++++++++------------------------
src/domain.h | 7 +-
src/events.c | 177 +++++------
src/gdbus.c | 448 ++++++++++++++++++++++++++
src/gdbus.h | 99 ++++++
src/main.c | 307 ++++++++----------
src/util.c | 170 +++++-----
src/util.h | 53 ++--
test/Makefile.am | 3 +-
test/travis-run | 2 +-
20 files changed, 1468 insertions(+), 1120 deletions(-)
create mode 100644 data/org.libvirt.Connect.xml
create mode 100644 data/org.libvirt.Domain.xml
create mode 100644 src/gdbus.c
create mode 100644 src/gdbus.h
--
2.14.3
6 years, 8 months
[libvirt] [PATCH] pci: Ignore 32-bit PCIe domains
by Keith Busch
Intel VMD creates secondary PCIe domain, where child devices in this
domain are aggregated behind a single end point. Linux exposes these
as special 32-bit domains, and devices in them are not individually
assignable.
This patch ignores devices in such domains as desired, and prevents
logging excessive errors, like:
internal error: dev->name buffer overflow: 10000:00:00.0
Cc: Jonathan Derrick <jonathan.derrick(a)intel.com>
Signed-off-by: Keith Busch <keith.busch(a)intel.com>
---
src/util/virpci.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 55e4c3e49..53a6f2e51 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -1762,6 +1762,13 @@ virPCIDeviceNew(unsigned int domain,
char *vendor = NULL;
char *product = NULL;
+
+ /* Devices in a 32-bit domain are special. Currently applicable to Intel
+ * VMD PCIe, where individual devices are not individually assignable.
+ */
+ if (domain > USHRT_MAX)
+ return NULL;
+
if (VIR_ALLOC(dev) < 0)
return NULL;
--
2.14.3
6 years, 8 months
[libvirt] [PATCH] virt-aa-helper: resolve file symlinks
by Christian Ehrhardt
In a recent change b932ed69: "virt-aa-helper: resolve yet to be created
paths" several cases with symlinks in paths were fixed, but it regressed
cases where the file being last element of the path was the actual link.
In the case of the last element being the symlink realpath can (and shall)
be called on the full path that was passed.
Examples would be zfs/lvm block devices like:
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/mapper/testlvm-testvol1'/>
<target dev='vdd' bus='virtio'/>
</disk>
With the target being:
/dev/mapper/testlvm-testvol1 -> ../dm-0
That currently is rendered as
"/dev/mapper/testlvm-testvol1" rwk,
but instead should be (and is with the fix):
"/dev/dm-0" rwk,
Fixes: b932ed69: "virt-aa-helper: resolve yet to be created paths"
Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1756394
Signed-off-by: Christian Ehrhardt <christian.ehrhardt(a)canonical.com>
---
src/security/virt-aa-helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 992bd44..456cfce 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -777,7 +777,7 @@ vah_add_path(virBufferPtr buf, const char *path, const char *perms, bool recursi
* 3. re-combine the realpath with the remaining suffix
* Note: A totally non existent path is used as-is
*/
- if ((pathdir = mdir_name(path)) == NULL)
+ if (VIR_STRDUP_QUIET(pathdir, path) < 0)
goto cleanup;
while (!virFileExists(pathdir)) {
if ((pathtmp = mdir_name(pathdir)) == NULL)
--
2.7.4
6 years, 8 months
[libvirt] [PATCH tck] Relabel SELinux when customizing virt-builder image
by Daniel P. Berrangé
When you tell virt-builder to install extra RPMs, this potentially
looses the SELinux labelling that Anaconda had originally setup. Thus we
must tell virt-builder to enable SELinux relabelling.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
lib/Sys/Virt/TCK.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm
index e9da8d2..b39f578 100644
--- a/lib/Sys/Virt/TCK.pm
+++ b/lib/Sys/Virt/TCK.pm
@@ -405,7 +405,7 @@ sub create_virt_builder_disk {
}
print "# running virt-builder $osname\n";
- system "virt-builder", "--install", "dsniff", "--root-password", "password:$password", "--output", $target, $osname;
+ system "virt-builder", "--install", "dsniff", "--selinux-relabel", "--root-password", "password:$password", "--output", $target, $osname;
die "cannot run virt-builder: $?" if $? != 0;
--
2.14.3
6 years, 8 months
[libvirt] [PATCH 0/2] python3: Further minor tweaks
by Andrea Bolognani
Andrea Bolognani (2):
docs: Import print_function in reformat-news.py
python: Drop explicit version where possible
docs/reformat-news.py | 4 +++-
src/esx/esx_vi_generator.py | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
--
2.14.3
6 years, 8 months
[libvirt] [PATCH v2 0/2] Fix the odd VFIO error for a non-existent mdev when IOMMU is disabled
by Erik Skultety
Unlike GPU assignment, mdev doesn't need the IOMMU to be enabled within kernel,
since the physical parent device takes care of the isolation, i.e. there's an
IOMMU group entry for each mdev created under sysfs, thus a VM can start
successfully.
Since v1:
- adjusted the error msg in patch 1 according to reviewer
- rephrased the commit message for patch 2 to make it less confusing
Erik Skultety (2):
util: mdev: Improve the error msg on non-existent mdev prior to VM
start
qemu: hostdev: Fix the error on VM start with an mdev when IOMMU is
off
src/qemu/qemu_hostdev.c | 7 ++++++-
src/util/virmdev.c | 16 +++++++++++++---
2 files changed, 19 insertions(+), 4 deletions(-)
--
2.13.6
6 years, 8 months
[libvirt] [PATCH] virNetlinkDumpCommand: Don't leak response buffer
by Michal Privoznik
==16451== 32,768 bytes in 2 blocks are definitely lost in loss record 1,007 of 1,013
==16451== at 0x4C2AF0F: malloc (vg_replace_malloc.c:299)
==16451== by 0x7CADB40: nl_recv (in /usr/lib64/libnl-3.so.200.23.0)
==16451== by 0x532DFAC: virNetlinkDumpCommand (virnetlink.c:363)
==16451== by 0x53236AE: virNetDevIPCheckIPv6Forwarding (virnetdevip.c:641)
==16451== by 0xE3E4A1A: networkStartNetworkVirtual (bridge_driver.c:2490)
==16451== by 0xE3E55F5: networkStartNetwork (bridge_driver.c:2832)
==16451== by 0xE3DFFE5: networkAutostartConfig (bridge_driver.c:531)
==16451== by 0x53F47E0: virNetworkObjListForEachHelper (virnetworkobj.c:1412)
==16451== by 0x52FE69F: virHashForEach (virhash.c:606)
==16451== by 0x53F4857: virNetworkObjListForEach (virnetworkobj.c:1439)
==16451== by 0xE3E0BF4: networkStateAutoStart (bridge_driver.c:808)
==16451== by 0x55689CE: virStateInitialize (libvirt.c:758)
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/virnetlink.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 0e281b06b8..955f1558ee 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -360,6 +360,7 @@ virNetlinkDumpCommand(struct nl_msg *nl_msg,
goto cleanup;
while (!end) {
+ VIR_FREE(resp);
len = nl_recv(nlhandle, &nladdr, (unsigned char **)&resp, NULL);
VIR_WARNINGS_NO_CAST_ALIGN
for (msg = resp; NLMSG_OK(msg, len); msg = NLMSG_NEXT(msg, len)) {
@@ -378,6 +379,7 @@ virNetlinkDumpCommand(struct nl_msg *nl_msg,
ret = 0;
cleanup:
+ VIR_FREE(resp);
virNetlinkFree(nlhandle);
return ret;
}
--
2.16.1
6 years, 8 months
[libvirt] [PATCH] gnulib: switch to use https:// instead of git:// protocol
by Daniel P. Berrangé
Some contributors are behind obnoxious firewalls that block everything
except http(s) traffic, preventing checkout of modules using the git://
protocol. Since git.savannah.gnu.org is using the modern, fast HTTP
transport, there's no real downside to using that by default.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
AFAICT, this change has no effect for anyone with an existing checkout
of gnulib. They'll continue using the git protocol, just new checkouts
will start using http. This is fine so no effort is made to "fix"
existing checkouts.
.gitmodules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitmodules b/.gitmodules
index cfee24d7b8..0fda887528 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
[submodule "gnulib"]
path = .gnulib
- url = git://git.sv.gnu.org/gnulib.git
+ url = https://git.savannah.gnu.org/git/gnulib.git/
[submodule "keycodemapdb"]
path = src/keycodemapdb
url = https://gitlab.com/keycodemap/keycodemapdb.git
--
2.14.3
6 years, 8 months