[libvirt] [PATCH 0/6] Alternative way of turning NWFilterObj(list) into virObject
by Michal Privoznik
This is heavily based on John's work (except 1/6). The difference to his
patches is in using virObjectRecursiveLockableNew() for recursive locks
instead of RW locks and lock promoting. Also, in 6/6 I was more
confident and removed driver lock from define/undefine APIs.
John Ferlan (1):
nwfilter: Remove need for nwfilterDriverLock in some API's
Michal Privoznik (5):
virObject: use virReportSystemError if applicable
virObject: Introduce virObjectRecursiveLockableNew
virNWFilterObj: Turn into virObjectLockable
conf: Introduce and use virNWFilterObjEndAPI
nwfilter: Convert _virNWFilterObjList to use virObjectRWLockable
cfg.mk | 1 -
src/conf/virdomainobjlist.c | 3 +-
src/conf/virnwfilterobj.c | 504 +++++++++++++++++++++------------
src/conf/virnwfilterobj.h | 12 +-
src/libvirt_private.syms | 5 +-
src/nwfilter/nwfilter_driver.c | 65 ++---
src/nwfilter/nwfilter_gentech_driver.c | 11 +-
src/util/virobject.c | 30 +-
src/util/virobject.h | 4 +
9 files changed, 382 insertions(+), 253 deletions(-)
--
2.13.6
6 years, 9 months
[libvirt] [PATCH v5 0/3] nwfilter common object adjustments
by John Ferlan
v4: https://www.redhat.com/archives/libvir-list/2017-December/msg00282.html
But more recently reviewed:
https://www.redhat.com/archives/libvir-list/2018-February/msg00022.html
https://www.redhat.com/archives/libvir-list/2018-February/msg00015.html
https://www.redhat.com/archives/libvir-list/2018-February/msg00016.html
Changes since v4:
Pushed former patch 1/4 since it was ACK'd...
- Patch 2:
* Return NULL on error in virNWFilterObjListFindInstantiateFilter
instead of the somewhat obfuscated @obj which would be NULL as a
result of the virNWFilterObjEndAPI
* Use virNWFilterObjDemoteFromWrite prior to return obj when the
path was returning a write locked object.
- Patch 3:
* Reword the comment prior to virNWFilterObjListFindByNameLocked
in order to better explain what's happening
* Ensure the write lock occurs while the nwfilters lock is held.
* Fix the virNWFilterCountData setup
* Fix the formatting for the @def in virNWFilterObjListExportCallback
(there was an extra space)
- Patch 4:
* No change, still needs the official ACK/R-b though
NB: Testing done...
* Ran/passed the nwfilter concurrency test w/ the changes
* Ran/passed the Avocado nwfilter_update_lock, nwfilter_update_vm_running,
and virsh.nwfilter_undefine.error_test.acl_test tests - these were the
ones with the most nwfilter "interaction" that would cause issues at
various points in time during installation.
John Ferlan (3):
nwfilter: Convert _virNWFilterObj to use virObjectRWLockable
nwfilter: Convert _virNWFilterObjList to use virObjectRWLockable
nwfilter: Remove need for nwfilterDriverLock in some API's
src/conf/virnwfilterobj.c | 540 +++++++++++++++++++++++----------
src/conf/virnwfilterobj.h | 11 +-
src/libvirt_private.syms | 3 +-
src/nwfilter/nwfilter_driver.c | 71 ++---
src/nwfilter/nwfilter_gentech_driver.c | 11 +-
5 files changed, 427 insertions(+), 209 deletions(-)
--
2.13.6
6 years, 9 months
[libvirt] [PATCH 0/3] Fix trouble with <backingStore> in virsh detach-disk
by Peter Krempa
We've created malformed <auth> element for RBD images in backing store
of a disk which failed parsing and broke detaching disks via virsh.
Fix it by not parsing auth data at all from the disk backing images and
remove the <backingStore> element when constructing the XML for disk
detach.
Peter Krempa (3):
virsh: detach-disk: Add --print-xml switch
util: storage: Remove detected authentication data for backing chains
virsh: Remove <backingStore> sub-element in virshFindDisk
src/util/virstoragefile.c | 8 ++++++++
tests/virstoragetest.c | 15 +++------------
tools/virsh-domain.c | 44 +++++++++++++++++++++++++++++++++-----------
tools/virsh.pod | 4 ++++
4 files changed, 48 insertions(+), 23 deletions(-)
--
2.15.0
6 years, 9 months
[libvirt] [jenkins-ci PATCH] jobs: Set $PYTHONPATH for python-distutils jobs
by Andrea Bolognani
Since we install Python modules under $VIRT_PREFIX, we need to set
$PYTHONPATH or the interpreter won't be able to locate them. This is
currently being done per-worker in the Jenkins Web interface.
However, now that we've introduced Python 3 builds, depending on the
project and the OS, we might be using any of Python 2.7, 3.4, 3.5
and 3.6, which means we can't have a single $PYTHONPATH anymore: in
particular, while it's okay to have non-esisting directories in
$PYTHONPATH, we have to make sure that a Python 3 interpreter will
never try to use a Python 2 module and vice versa.
To solve the issue, we use a fairly large hammer: we set $PYTHONPATH
at the job level, and include all reasonable minor versions for the
Python major version (pyver) the job is using, even if they don't
yet exist.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Another approach would be to use something like
T=$VIRT_PREFIX/lib/python{pyver}.4/site-packages
T=$T:$VIRT_PREFIX/lib64/python{pyver}.4/site-packages
T=$T:$VIRT_PREFIX/lib/python{pyver}.5/site-packages
T=$T:$VIRT_PREFIX/lib64/python{pyver}.5/site-packages
T=$T:$VIRT_PREFIX/lib/python{pyver}.6/site-packages
T=$T:$VIRT_PREFIX/lib64/python{pyver}.6/site-packages
T=$T:$VIRT_PREFIX/lib/python{pyver}.7/site-packages
T=$T:$VIRT_PREFIX/lib64/python{pyver}.7/site-packages
export PYTHONPATH=$T
but that's just a different kind of ugly :/
jobs/python-distutils.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/jobs/python-distutils.yaml b/jobs/python-distutils.yaml
index ff68c29..510769e 100644
--- a/jobs/python-distutils.yaml
+++ b/jobs/python-distutils.yaml
@@ -42,6 +42,7 @@
- shell: |
{global_env}
{local_env}
+ export PYTHONPATH=$VIRT_PREFIX/lib/python{pyver}.4/site-packages:$VIRT_PREFIX/lib64/python{pyver}.4/site-packages:$VIRT_PREFIX/lib/python{pyver}.5/site-packages:$VIRT_PREFIX/lib64/python{pyver}.5/site-packages:$VIRT_PREFIX/lib/python{pyver}.6/site-packages:$VIRT_PREFIX/lib64/python{pyver}.6/site-packages:$VIRT_PREFIX/lib/python{pyver}.7/site-packages:$VIRT_PREFIX/lib64/python{pyver}.7/site-packages
{command_pre_build}
python{pyver} ./setup.py build
python{pyver} ./setup.py install --prefix=$VIRT_PREFIX
@@ -83,6 +84,7 @@
- shell: |
{global_env}
{local_env}
+ export PYTHONPATH=$VIRT_PREFIX/lib/python{pyver}.4/site-packages:$VIRT_PREFIX/lib64/python{pyver}.4/site-packages:$VIRT_PREFIX/lib/python{pyver}.5/site-packages:$VIRT_PREFIX/lib64/python{pyver}.5/site-packages:$VIRT_PREFIX/lib/python{pyver}.6/site-packages:$VIRT_PREFIX/lib64/python{pyver}.6/site-packages:$VIRT_PREFIX/lib/python{pyver}.7/site-packages:$VIRT_PREFIX/lib64/python{pyver}.7/site-packages
python{pyver} ./setup.py test
publishers:
- email:
@@ -121,6 +123,7 @@
- shell: |
{global_env}
{local_env}
+ export PYTHONPATH=$VIRT_PREFIX/lib/python{pyver}.4/site-packages:$VIRT_PREFIX/lib64/python{pyver}.4/site-packages:$VIRT_PREFIX/lib/python{pyver}.5/site-packages:$VIRT_PREFIX/lib64/python{pyver}.5/site-packages:$VIRT_PREFIX/lib/python{pyver}.6/site-packages:$VIRT_PREFIX/lib64/python{pyver}.6/site-packages:$VIRT_PREFIX/lib/python{pyver}.7/site-packages:$VIRT_PREFIX/lib64/python{pyver}.7/site-packages
sed -i -e 's/BuildRequires: libvirt.*devel.*//' *.spec.in
python{pyver} ./setup.py rpm
publishers:
--
2.14.3
6 years, 9 months
[libvirt] [PATCH 0/3] virSysinfo: Introduce SMBIOS type 3 support
by Zhuangyanying
From: Zhuang Yanying <ann.zhuangyanying(a)huawei.com>
Some applications inside VM need to access SMBIOS Chassis Asset Tag,
which should be emulated.
access inside VM (for example)
Linux: /sys/class/dmi/id/chassis_asset_tag.
Windows: (Get-WmiObject Win32_SystemEnclosure).SMBIOSAssetTag
wirhin Windows PowerShell.
It has already been realized in qemu:
SMBIOS: Build aggregate smbios tables and entry point
https://git.qemu.org/?p=qemu.git;a=commit;h=c97294ec1b9e36887e119589d4565...
but not in libvirt. we realize it here.
As an example, you could use something like
<chassis>
<entry name='manufacturer'>Huawei</entry>
<entry name='version'>To be filled by O.E.M.</entry>
<entry name='serial'>To be filled by O.E.M.</entry>
<entry name='asset'>To be filled by O.E.M.</entry>
<entry name='sku'>Type3Sku1</entry>
</chassis>
BTW: I'll be on vacation for china spring festival for the next week, I'll response as soon as I get back if there's any modification needed.
Zhuang Yanying (3):
conf: add support for setting Chassis SMBIOS data fields
qemu: add support for generating SMBIOS Chassis strings command line
news: add support for setting Chassis SMBIOS data fields
docs/formatdomain.html.in | 23 +++++++
docs/news.xml | 5 ++
docs/schemas/domaincommon.rng | 22 ++++++
src/conf/domain_conf.c | 55 +++++++++++++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 51 ++++++++++++++
src/util/virsysinfo.c | 133 +++++++++++++++++++++++++++++++++++-
src/util/virsysinfo.h | 13 ++++
tests/qemuxml2argvdata/smbios.args | 2 +
tests/qemuxml2argvdata/smbios.xml | 7 ++
tests/qemuxml2xmloutdata/smbios.xml | 7 ++
11 files changed, 318 insertions(+), 1 deletion(-)
--
1.8.3.1
6 years, 9 months
[libvirt] Should we switch to a different JSON library?
by Martin Kletzander
Hi everyone,
so we are using yajl for parsing JSON. However there are some reasons
why we might consider switching to another one:
1) It is basically dead upstream
2) We're just using the lexer part of it
3) We only use it for parsing
4) The are workarounds for it in the code
So I looked at some options and found few other libraries, I only took
those that are widely available (read: I checked if some random
downstream distro has them), however most of them were not very much
usable. Except one. But here's the list of few others that didn't look
that bad either. All are MIT-licensed, try to be thread-safe and
support pkg-config:
- libfastjson [1] - from rsyslog community, optimized for working with
logs, used almost only by rsyslog, it's supposed to
have doxygen docs, they switched to libfastjson
from json-c due to some problems with it
(performance, ref counting bug, ...)
- json-c [2] - looked abandoned until I looked at the proper github
page, "documentation" in doxygen
- Jansson [3] - I really like this one. The API seems very intuitive,
it has nice documentation [4] in readthedocs (and I'm
not talking about the visual style, but how easy is to
find information), it can be used for formatting JSON
in a similar way we are doing it. It has json_auto_t
(optional) type that uses the attribute cleanup for
automatic scope dereference (just in case we want to
use it), it has iterators... did I tell you I like this
one a lot?
What do you (others) think of switching the JSON library? Do you know
about any other projects that could be used considering license,
platform support, etc.? Also feel free to fix any mistakes I might have
posted. I double-checked it, but you know, "trust, but verify".
Have a nice day,
Martin
[1] https://github.com/rsyslog/libfastjson
[2] https://github.com/json-c/json-c
[3] http://www.digip.org/jansson/
[4] https://jansson.readthedocs.io/
6 years, 9 months
[libvirt] [PATCH 0/6] spec: Misc cleanups and improvements
by Jiri Denemark
Jiri Denemark (6):
spec: Enable fuse only if LXC is enabled
spec: Build virt-login-shell iff LXC driver is enabled
spec: Drop checks for old Fedora releases
spec: Prepare for future RHEL
spec: Fix indentation in daemon's triggerpostun
spec: Drop overlapping triggers
libvirt.spec.in | 64 ++++++++++++++++++++++-----------------------------------
1 file changed, 25 insertions(+), 39 deletions(-)
--
2.16.1
6 years, 9 months
[libvirt] [PATCH v2 0/2] Fix parsing and formatting of 'UnixSocketAddress' qapi type
by Peter Krempa
v2: Don't 'fix' it for gluster disks which use old syntax not conforming
to the schema in qemu.
Peter Krempa (2):
storage: Fix formatting and parsing of qemu type 'UnixSocketAddress'
virstoragetest: Add test case for NBD over unix socket with new syntax
src/qemu/qemu_block.c | 13 +++++++++++--
src/util/virstoragefile.c | 8 +++++++-
tests/virstoragetest.c | 9 +++++++++
3 files changed, 27 insertions(+), 3 deletions(-)
--
2.15.0
6 years, 9 months
[libvirt] [jenkins-ci PATCH] jobs: Shorten name for python-distutils jobs
by Andrea Bolognani
Instead of passing the full name of the Python binary as 'python',
only pass the major version as 'pyver' and build everything else
based on that.
Doing so allows us to make a few things, most notably job names,
slightly shorter and nicer.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
I wouldn't bother changing this if the previous change to Python
jobs had already been deployed, but since it hasn't yet might as
well have nicer names instead :)
jobs/python-distutils.yaml | 22 +++++++++++-----------
projects/libvirt-python.yaml | 16 ++++++++--------
projects/virt-manager.yaml | 14 +++++++-------
3 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/jobs/python-distutils.yaml b/jobs/python-distutils.yaml
index 122c759..ff68c29 100644
--- a/jobs/python-distutils.yaml
+++ b/jobs/python-distutils.yaml
@@ -1,11 +1,11 @@
- job-template:
id: python-distutils-build-job
- name: '{name}-{branch}-{python}-build'
+ name: '{name}-{branch}-py{pyver}-build'
project-type: matrix
- description: '{title} Build ({python})'
+ description: '{title} Build (Python {pyver})'
command_pre_build: ''
- workspace: '{name}-{branch}-{python}'
+ workspace: '{name}-{branch}-py{pyver}'
child-workspace: '.'
block-downstream: true
block-upstream: true
@@ -43,8 +43,8 @@
{global_env}
{local_env}
{command_pre_build}
- {python} ./setup.py build
- {python} ./setup.py install --prefix=$VIRT_PREFIX
+ python{pyver} ./setup.py build
+ python{pyver} ./setup.py install --prefix=$VIRT_PREFIX
publishers:
- email:
recipients: '{obj:spam}'
@@ -54,9 +54,9 @@
- job-template:
id: python-distutils-check-job
- name: '{name}-{branch}-{python}-check'
+ name: '{name}-{branch}-py{pyver}-check'
project-type: matrix
- description: '{title} Check ({python})'
+ description: '{title} Check (Python {pyver})'
workspace: '{name}-{branch}'
child-workspace: '.'
block-downstream: true
@@ -83,7 +83,7 @@
- shell: |
{global_env}
{local_env}
- {python} ./setup.py test
+ python{pyver} ./setup.py test
publishers:
- email:
recipients: '{obj:spam}'
@@ -92,9 +92,9 @@
- job-template:
id: python-distutils-rpm-job
- name: '{name}-{branch}-{python}-rpm'
+ name: '{name}-{branch}-py{pyver}-rpm'
project-type: matrix
- description: '{title} RPM ({python})'
+ description: '{title} RPM (Python {pyver})'
workspace: '{name}-{branch}'
child-workspace: '.'
block-downstream: true
@@ -122,7 +122,7 @@
{global_env}
{local_env}
sed -i -e 's/BuildRequires: libvirt.*devel.*//' *.spec.in
- {python} ./setup.py rpm
+ python{pyver} ./setup.py rpm
publishers:
- email:
recipients: '{obj:spam}'
diff --git a/projects/libvirt-python.yaml b/projects/libvirt-python.yaml
index e065c5d..1c29321 100644
--- a/projects/libvirt-python.yaml
+++ b/projects/libvirt-python.yaml
@@ -14,10 +14,10 @@
title: Libvirt Python
jobs:
- python-distutils-build-job:
- python: python2
+ pyver: 2
parent_jobs: 'libvirt-master-build'
- python-distutils-build-job:
- python: python3
+ pyver: 3
parent_jobs: 'libvirt-master-build'
machines:
- libvirt-debian-8
@@ -28,11 +28,11 @@
- libvirt-freebsd-10
- libvirt-freebsd-11
- python-distutils-check-job:
- python: python2
- parent_jobs: 'libvirt-python-master-{python}-build'
+ pyver: 2
+ parent_jobs: 'libvirt-python-master-py{pyver}-build'
- python-distutils-check-job:
- python: python3
- parent_jobs: 'libvirt-python-master-{python}-build'
+ pyver: 3
+ parent_jobs: 'libvirt-python-master-py{pyver}-build'
machines:
- libvirt-debian-8
- libvirt-debian-9
@@ -42,8 +42,8 @@
- libvirt-freebsd-10
- libvirt-freebsd-11
- python-distutils-rpm-job:
- python: python2
- parent_jobs: 'libvirt-python-master-{python}-check'
+ pyver: 2
+ parent_jobs: 'libvirt-python-master-py{pyver}-check'
machines:
- libvirt-centos-6
- libvirt-centos-7
diff --git a/projects/virt-manager.yaml b/projects/virt-manager.yaml
index b5b0df5..8f3112e 100644
--- a/projects/virt-manager.yaml
+++ b/projects/virt-manager.yaml
@@ -11,18 +11,18 @@
title: Virtual Machine Manager
jobs:
- python-distutils-build-job:
- python: python3
+ pyver: 3
parent_jobs:
- - 'libvirt-python-master-{python}-build'
+ - 'libvirt-python-master-py{pyver}-build'
- 'libosinfo-master-build'
command_pre_build: |
- {python} ./setup.py configure --prefix=$VIRT_PREFIX
+ python{pyver} ./setup.py configure --prefix=$VIRT_PREFIX
- python-distutils-check-job:
- python: python3
- parent_jobs: 'virt-manager-master-{python}-build'
+ pyver: 3
+ parent_jobs: 'virt-manager-master-py{pyver}-build'
- python-distutils-rpm-job:
- python: python3
- parent_jobs: 'virt-manager-master-{python}-check'
+ pyver: 3
+ parent_jobs: 'virt-manager-master-py{pyver}-check'
machines:
- libvirt-fedora-26
- libvirt-fedora-27
--
2.14.3
6 years, 9 months
[libvirt] [PATCH 0/3] Fix parsing and formatting of 'UnixSocketAddress' qapi type
by Peter Krempa
Fix the naming mistake, add tests and remove useless comment.
Peter Krempa (3):
storage: Fix formatting and parsing of qemu type 'UnixSocketAddress'
virstoragetest: Add test case for NBD over unix socket with new syntax
qemu: block: Remove misleading part of comment in
qemuBlockStorageSourceBuildJSONSocketAddress
src/qemu/qemu_block.c | 7 +------
src/util/virstoragefile.c | 2 +-
tests/virstoragetest.c | 13 +++++++++++--
3 files changed, 13 insertions(+), 9 deletions(-)
--
2.15.0
6 years, 9 months