[PATCH 00/36] convert virObjects to GObject
by Rafael Fonseca
This patch series convert various simple instances of virObject to a
GObject equivalent.
virDomain is still WIP because it causes some linking problem I am still
investigating.
virObjects that work as parent class to other objects will be covered in
a next patchset.
Rafael Fonseca (36):
util: virresctrl: convert classes to GObject
conf: capabilities: convert virCaps to GOBject
qemu: convert virQEMUCaps to GObject
rpc: convert virNetClientProgram to GObject
rpc: convert virNetServerProgram to GObject
conf: convert virDomainXMLOption to GObject
bhyve: convert bhyveMonitor to GObject
bhyve: convert virBhyveDriverConfig to GObject
rpc: convert virNetServerService to GObject
conf: convert virDomainCapsCPUModels to GObject
util: convert dnsmasqCaps to GObject
conf: convert virDomainChrSourceDef to GObject
admin: convert virAdmServer to GObject
admin: convert virAdmClient to GObject
datatypes: convert virDomainCheckpoint to GObject
datatypes: convert virDomainSnapshot to GObject
datatypes: convert virNWFilter to GObject
datatypes: convert virNWFilterBinding to GObject
datatypes: convert virNetwork to GObject
datatypes: convert virNetworkPort to GObject
datatypes: convert virInterface to GObject
datatypes: convert virStoragePool to GObject
datatypes: convert virStorageVol to GObject
datatypes: convert virNodeDevice to GObject
datatypes: convert virSecret to GObject
datatypes: convert virStream to GObject
conf: convert virNetworkXMLOption to GObject
lxc: convert virLXCDriverConfig to GObject
libxl: convert libxlDriverConfig to GObject
hypervisor: convert virHostdevManager to GObject
libxl: convert libxlMigrationDstArgs to GObject
qemu: convert qemuBlockJobData to GObject
qemu: convert virQEMUDriverConfig to GObject
conf: convert virDomain*Private to GObject
conf: convert virSaveCookie to GObject
util: convert virStorageSource to GObject
src/admin/admin_remote.c | 10 +-
src/admin/libvirt-admin.c | 4 +-
src/admin/libvirt_admin_private.syms | 2 -
src/bhyve/bhyve_capabilities.c | 19 +-
src/bhyve/bhyve_conf.c | 34 +-
src/bhyve/bhyve_driver.c | 36 +-
src/bhyve/bhyve_monitor.c | 35 +-
src/bhyve/bhyve_monitor.h | 3 +-
src/bhyve/bhyve_utils.h | 11 +-
src/conf/capabilities.c | 42 +-
src/conf/capabilities.h | 6 +-
src/conf/domain_capabilities.c | 48 +-
src/conf/domain_capabilities.h | 10 +-
src/conf/domain_conf.c | 126 ++---
src/conf/domain_conf.h | 36 +-
src/conf/network_conf.c | 31 +-
src/conf/network_conf.h | 12 +-
src/conf/network_event.c | 2 +-
src/conf/node_device_event.c | 9 +-
src/conf/node_device_util.c | 4 +-
src/conf/secret_event.c | 9 +-
src/conf/snapshot_conf.c | 3 +-
src/conf/snapshot_conf.h | 2 +-
src/conf/storage_capabilities.c | 5 +-
src/conf/storage_event.c | 15 +-
src/conf/virchrdev.c | 5 +-
src/conf/virconftypes.h | 3 +-
src/conf/virdomaincheckpointobjlist.c | 6 +-
src/conf/virdomainsnapshotobjlist.c | 6 +-
src/conf/virinterfaceobj.c | 7 +-
src/conf/virnetworkobj.c | 14 +-
src/conf/virnodedeviceobj.c | 10 +-
src/conf/virnwfilterbindingobjlist.c | 6 +-
src/conf/virnwfilterobj.c | 6 +-
src/conf/virsavecookie.c | 10 +-
src/conf/virsavecookie.h | 14 +-
src/conf/virsecretobj.c | 8 +-
src/conf/virstorageobj.c | 16 +-
src/datatypes.c | 601 +++++++++++++++---------
src/datatypes.h | 199 ++++----
src/esx/esx_driver.c | 28 +-
src/hypervisor/virhostdev.c | 31 +-
src/hypervisor/virhostdev.h | 13 +-
src/interface/interface_backend_netcf.c | 2 +-
src/interface/interface_backend_udev.c | 2 +-
src/libvirt-domain-checkpoint.c | 7 +-
src/libvirt-domain-snapshot.c | 7 +-
src/libvirt-interface.c | 6 +-
src/libvirt-network.c | 14 +-
src/libvirt-nodedev.c | 6 +-
src/libvirt-nwfilter.c | 14 +-
src/libvirt-secret.c | 7 +-
src/libvirt-storage.c | 12 +-
src/libvirt-stream.c | 7 +-
src/libvirt_private.syms | 11 -
src/libxl/libxl_capabilities.c | 19 +-
src/libxl/libxl_conf.c | 57 ++-
src/libxl/libxl_conf.h | 12 +-
src/libxl/libxl_driver.c | 178 +++----
src/libxl/libxl_migration.c | 80 ++--
src/libxl/xen_common.c | 2 +-
src/locking/lock_daemon.c | 28 +-
src/locking/lock_driver_lockd.c | 23 +-
src/logging/log_daemon.c | 28 +-
src/logging/log_manager.c | 17 +-
src/lxc/lxc_conf.c | 47 +-
src/lxc/lxc_conf.h | 10 +-
src/lxc/lxc_controller.c | 25 +-
src/lxc/lxc_driver.c | 102 ++--
src/lxc/lxc_monitor.c | 3 +-
src/lxc/lxc_process.c | 36 +-
src/network/bridge_driver.c | 23 +-
src/nwfilter/nwfilter_driver.c | 3 +-
src/openvz/openvz_conf.c | 10 +-
src/qemu/qemu_blockjob.c | 126 +++--
src/qemu/qemu_blockjob.h | 15 +-
src/qemu/qemu_capabilities.c | 133 +++---
src/qemu/qemu_capabilities.h | 9 +-
src/qemu/qemu_conf.c | 44 +-
src/qemu/qemu_conf.h | 19 +-
src/qemu/qemu_domain.c | 435 ++++++++---------
src/qemu/qemu_domain.h | 157 +++++--
src/qemu/qemu_driver.c | 32 +-
src/qemu/qemu_migration.c | 12 +-
src/qemu/qemu_process.c | 21 +-
src/qemu/qemu_virtiofs.c | 12 +-
src/remote/remote_daemon.c | 52 +-
src/remote/remote_daemon_dispatch.c | 35 +-
src/remote/remote_daemon_stream.c | 8 +-
src/remote/remote_driver.c | 71 +--
src/rpc/gendispatch.pl | 4 +-
src/rpc/virnetclient.c | 4 +-
src/rpc/virnetclientprogram.c | 29 +-
src/rpc/virnetclientprogram.h | 10 +-
src/rpc/virnetclientstream.c | 5 +-
src/rpc/virnetserver.c | 18 +-
src/rpc/virnetserverprogram.c | 30 +-
src/rpc/virnetserverprogram.h | 17 +-
src/rpc/virnetserverservice.c | 87 ++--
src/security/virt-aa-helper.c | 11 +-
src/storage/storage_backend.c | 3 +-
src/storage/storage_driver.c | 7 +-
src/storage/storage_util.c | 4 +-
src/test/test_driver.c | 33 +-
src/util/virdnsmasq.c | 56 +--
src/util/virdnsmasq.h | 6 +-
src/util/virfdstream.c | 5 +-
src/util/virfilecache.c | 13 +-
src/util/virresctrl.c | 137 +++---
src/util/virresctrl.h | 15 +-
src/util/virsecret.c | 3 +-
src/util/virstoragefile.c | 41 +-
src/util/virstoragefile.h | 9 +-
src/vbox/vbox_common.c | 10 +-
src/vmware/vmware_conf.c | 15 +-
src/vz/vz_driver.c | 30 +-
src/vz/vz_sdk.c | 22 +-
tests/bhyveargv2xmltest.c | 4 +-
tests/bhyvexml2argvtest.c | 4 +-
tests/bhyvexml2xmltest.c | 4 +-
tests/cputest.c | 49 +-
tests/domaincapstest.c | 6 +-
tests/domainconftest.c | 6 +-
tests/genericxml2xmltest.c | 6 +-
tests/networkxml2conftest.c | 10 +-
tests/networkxml2xmltest.c | 3 +-
tests/openvzutilstest.c | 4 +-
tests/qemublocktest.c | 3 +-
tests/qemucapabilitiestest.c | 9 +-
tests/qemucaps2xmltest.c | 29 +-
tests/qemucapsprobe.c | 4 +-
tests/qemuhotplugtest.c | 6 +-
tests/qemumemlocktest.c | 3 +-
tests/testutils.c | 4 +-
tests/testutilslxc.c | 24 +-
tests/testutilsqemu.c | 35 +-
tests/testutilsxen.c | 9 +-
tests/vircaps2xmltest.c | 6 +-
tests/vircapstest.c | 14 +-
tests/virfilecachetest.c | 53 +--
tests/virnetdaemontest.c | 4 +-
tests/virresctrltest.c | 6 +-
tests/vmx2xmltest.c | 11 +-
tests/xml2vmxtest.c | 15 +-
144 files changed, 2243 insertions(+), 2188 deletions(-)
--
2.25.1
4 years, 7 months
[libvirt-ci PATCH v2] Fix comment about not building libvirt-tck on CentOS
by Andrea Bolognani
The comment is singling out perl-generators, but actually there's
a bunch of more critical Perl packages missing. Update the comment
to reflect that.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/playbooks/build/projects/libvirt-tck.yml | 4 ++--
jenkins/projects/libvirt-tck.yaml | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/guests/playbooks/build/projects/libvirt-tck.yml b/guests/playbooks/build/projects/libvirt-tck.yml
index b8d848c..3a3b277 100644
--- a/guests/playbooks/build/projects/libvirt-tck.yml
+++ b/guests/playbooks/build/projects/libvirt-tck.yml
@@ -1,7 +1,7 @@
---
- set_fact:
- # CentOS 7 doesn't include perl-generators, which is necessary to
- # build libvirt-tck
+ # CentOS 7 and CentOS 8 are missing a number of Perl modules, so we
+ # can't build libvirt-tck there
name: libvirt-tck
machines:
- libvirt-debian-9
diff --git a/jenkins/projects/libvirt-tck.yaml b/jenkins/projects/libvirt-tck.yaml
index fcdea98..f5fc490 100644
--- a/jenkins/projects/libvirt-tck.yaml
+++ b/jenkins/projects/libvirt-tck.yaml
@@ -1,8 +1,8 @@
---
- project:
name: libvirt-tck
- # CentOS 7 doesn't include perl-generators, which is necessary to
- # build libvirt-tck
+ # CentOS 7 and CentOS 8 are missing a number of Perl modules, so we
+ # can't build libvirt-tck there
machines:
- libvirt-debian-9
- libvirt-debian-10
--
2.25.3
4 years, 7 months
[PATCH V2 0/5] Introduce getHost support for ARM CPU driver
by Zhenyu Zheng
Introduce getHost support for ARM CPU driver. First add
some data about commonly used ARM CPU models, and their
vendors into cpu_map, then added some helper methods as
callbacks to load them. Read and parse vendor_id, part_id
and CPU flags of local CPU from corresponding registers.
Signed-off-by: Zhenyu Zheng <zhengzhenyulixi(a)gmail.com>
Zhenyu Zheng (5):
cpu_map: Introduce ARM cpu models
cpu: Introduce virCPUarmData to virCPUData
cpu: Introduce ARM related structs
cpu: Add helper funtions to parse vendor and model
cpu: Introduce getHost support for ARM CPU driver
src/cpu/Makefile.inc.am | 1 +
src/cpu/cpu.h | 2 +
src/cpu/cpu_arm.c | 445 +++++++++++++++++++++++++++++-
src/cpu/cpu_arm_data.h | 31 +++
src/cpu_map/Makefile.inc.am | 7 +
src/cpu_map/arm_Falkor.xml | 16 ++
src/cpu_map/arm_Kunpeng-920.xml | 24 ++
src/cpu_map/arm_ThunderX299xx.xml | 16 ++
src/cpu_map/arm_cortex-a53.xml | 16 ++
src/cpu_map/arm_cortex-a57.xml | 15 +
src/cpu_map/arm_cortex-a72.xml | 15 +
src/cpu_map/arm_vendors.xml | 14 +
src/cpu_map/index.xml | 15 +
13 files changed, 614 insertions(+), 3 deletions(-)
create mode 100644 src/cpu/cpu_arm_data.h
create mode 100644 src/cpu_map/arm_Falkor.xml
create mode 100644 src/cpu_map/arm_Kunpeng-920.xml
create mode 100644 src/cpu_map/arm_ThunderX299xx.xml
create mode 100644 src/cpu_map/arm_cortex-a53.xml
create mode 100644 src/cpu_map/arm_cortex-a57.xml
create mode 100644 src/cpu_map/arm_cortex-a72.xml
create mode 100644 src/cpu_map/arm_vendors.xml
--
2.26.0.windows.1
4 years, 7 months
[PATCH 1/2] node_device_udev: handle move events
by Mark Asselstine
It is possible and common to rename some devices, this is especially
true for ethernet devices such as veth pairs.
In the udevEventHandleThread() we will be notified of this change but
currently we only process "add", "change" and "remove"
events. Renaming a device such as above results in a "move" event, not
a "remove" followed by and "add" or vise versa. This change will add
the new/destination device to our records but unfortunately there is
no usable mechanism to identify the old/source device to remove it
from the records. So this is admittedly only a partial fix.
Signed-off-by: Mark Asselstine <mark.asselstine(a)windriver.com>
---
src/node_device/node_device_udev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 8451903e8a..3149de8321 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1499,6 +1499,11 @@ udevHandleOneDevice(struct udev_device *device)
if (STREQ(action, "remove"))
return udevRemoveOneDevice(device);
+ if (STREQ(action, "move")) {
+ /* TODO: implement a way of finding and removing the old device */
+ return udevAddOneDevice(device);
+ }
+
return 0;
}
--
2.20.1
4 years, 7 months
[libvirt-ci PATCH 0/2] Improve CentOS coverage
by Andrea Bolognani
Build more projects and install more optional dependencies.
Andrea Bolognani (2):
mappings: Add libssh2 and wireshark on CentOS
Build libvirt-tck on CentOS 8
guests/playbooks/build/projects/libvirt-tck.yml | 2 ++
guests/vars/mappings.yml | 2 --
jenkins/projects/libvirt-tck.yaml | 2 ++
3 files changed, 4 insertions(+), 2 deletions(-)
--
2.25.3
4 years, 7 months
[libvirt PATCH] CONTRIBUTING: Include in release archives
by Andrea Bolognani
The file, added with commit
commit 874952f80c6d68c1a7a75e71c11a576f96f75dc2
Author: Andrea Bolognani <abologna(a)redhat.com>
Date: Mon Apr 6 11:56:58 2020 +0200
CONTRIBUTING: Add entry point for new contributors
should be included in release archives.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.am b/Makefile.am
index 5590c88e4d..01a9a5aa83 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -45,6 +45,7 @@ EXTRA_DIST = \
run.in \
README.md \
AUTHORS.in \
+ CONTRIBUTING.rst \
scripts/apibuild.py \
scripts/augeas-gentest.py \
build-aux/check-spacing.pl \
--
2.25.2
4 years, 7 months
[libvirt-python PATCH] setup: require python >= 3.5 to build
by Daniel P. Berrangé
Pytjon 3.5 is the oldest Python version available across our supported
build platforms.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
setup.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index 56b6eea..b3e418e 100755
--- a/setup.py
+++ b/setup.py
@@ -17,8 +17,8 @@ import re
import shutil
import time
-if sys.version_info[0] != 3:
- print("libvirt-python requires Python 3.x to build")
+if sys.version_info[0] != 3 or sys.version_info[1] < 5:
+ print("libvirt-python requires Python 3 >= 3.5 to build")
sys.exit(1)
MIN_LIBVIRT = "0.9.11"
--
2.25.2
4 years, 7 months
[PATCH] doc/python: Update to Python 3
by Philipp Hahn
Convert the simple example to Python 3 syntax:
- print() is a function
- do not use bare except
- libvirt.open*() does not return None but raises an exception
The referenced source for the example was removed with
5bb2a245abbde4c0a407f631660e2f2c81bc4c02
---
docs/python.html.in | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/docs/python.html.in b/docs/python.html.in
index e6e8cfade9..0f804da8c3 100644
--- a/docs/python.html.in
+++ b/docs/python.html.in
@@ -38,24 +38,24 @@ specificities in their argument conversions:</p>
is replaced by <code>virDomain::info()</code> which returns a list of
<ol><li>state: one of the state values (virDomainState)</li><li>maxMemory: the maximum memory used by the domain</li><li>memory: the current amount of memory used by the domain</li><li>nbVirtCPU: the number of virtual CPU</li><li>cpuTime: the time used by the domain in nanoseconds</li></ol></li>
</ul>
- <p>So let's look at a simple example inspired from the <code>basic.py</code>
-test found in <code>python/tests/</code> in the source tree:</p>
+ <p>So let's look at a simple example:</p>
<pre>import <span style="color: #0071FF; background-color: #FFFFFF">libvirt</span>
import sys
-conn = <span style="color: #0071FF; background-color: #FFFFFF">libvirt</span>.openReadOnly(None)
-if conn == None:
- print 'Failed to open connection to the hypervisor'
+try:
+ conn = <span style="color: #0071FF; background-color: #FFFFFF">libvirt</span>.openReadOnly(None)
+except <span style="color: #0071FF; background-color: #FFFFFF">libvirt</span>.libvirtError:
+ print('Failed to open connection to the hypervisor')
sys.exit(1)
try:
dom0 = conn.<span style="color: #007F00; background-color: #FFFFFF">lookupByName</span>("Domain-0")
-except:
- print 'Failed to find the main domain'
+except <span style="color: #0071FF; background-color: #FFFFFF">libvirt</span>.libvirtError:
+ print('Failed to find the main domain')
sys.exit(1)
-print "Domain 0: id %d running %s" % (dom0.<span style="color: #FF0080; background-color: #FFFFFF">ID</span>(), dom0.<span style="color: #FF0080; background-color: #FFFFFF">OSType</span>())
-print dom0.<span style="color: #FF0080; background-color: #FFFFFF">info</span>()</pre>
+print("Domain 0: id %d running %s" % (dom0.<span style="color: #FF0080; background-color: #FFFFFF">ID</span>(), dom0.<span style="color: #FF0080; background-color: #FFFFFF">OSType</span>()))
+print(dom0.<span style="color: #FF0080; background-color: #FFFFFF">info</span>())</pre>
<p>There is not much to comment about it, it really is a straight mapping
from the C API, the only points to notice are:</p>
<ul>
--
2.20.1
4 years, 7 months
[libvirt] [python] WIP-FYI: mypy annotations for libvirt-python
by Philipp Hahn
Hello,
Maybe you already have heads about mypy <http://mypy-lang.org/>, which
"is an experimental optional static type checker for Python that aims to
combine the benefits of dynamic (or "duck") typing and static typing".
I started to write a manual annotation file for the Python binding of
libvirt. I've attached my current version, so others can benefit from
it, too. It is far from complete, but it already helped my to find some
errors in my code.
(My latest version is also available at
<https://github.com/univention/typeshed/blob/libvirt/third_party/2and3/lib...>)
Long-term it probably would be better to teach the Python binding
"generator.py" to add the type information (PEP 484
<https://www.python.org/dev/peps/pep-0484/>) directly into the generated
"libvirt.py" file, but that's for another day.
If someone else is interested in helping with that, please feel free to
get in contact.
Philipp
--
Philipp Hahn
Open Source Software Engineer
Univention GmbH
be open.
Mary-Somerville-Str. 1
D-28359 Bremen
Tel.: +49 421 22232-0
Fax : +49 421 22232-99
hahn(a)univention.de
http://www.univention.de/
Geschäftsführer: Peter H. Ganten
HRB 20755 Amtsgericht Bremen
Steuer-Nr.: 71-597-02876
4 years, 7 months