[libvirt] [PATCH v2 1/1] qemu_command: tidy up qemuBuildHostdevCommandLine loop

2019-10-08 Thread Daniel Henrique Barboza
The current 'for' loop with 5 consecutive 'ifs' inside
qemuBuildHostdevCommandLine can be a bit smarter:

- all 5 'ifs' fails if hostdev->mode is not equal to
VIR_DOMAIN_HOSTDEV_MODE_SUBSYS. This check can be moved to the
start of the loop, failing to the next element immediately
in case it fails;

- all 5 'ifs' checks for a specific subsys->type to build the proper
command line argument (virHostdevIsSCSIDevice and virHostdevIsMdevDevice
do that but within a helper). Problem is that the code will keep
checking for matches even if one was already found, and there is
no way a hostdev will fit more than one 'if' (i.e. a hostdev can't
have 2+ different types). This means that a SUBSYS_TYPE_USB will
create its command line argument in the first 'if', then all other
conditionals will surely fail but will end up being checked anyway.

All of this can be avoided by moving the hostdev->mode comparing
to the start of the loop and using a switch statement with
subsys->type to execute the proper code for a given hostdev
type.

Suggested-by: Ján Tomko 
Signed-off-by: Daniel Henrique Barboza 
---
 src/qemu/qemu_command.c | 48 +++--
 1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index cbf25d5f07..9c3471256c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5463,23 +5463,31 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
 for (i = 0; i < def->nhostdevs; i++) {
 virDomainHostdevDefPtr hostdev = def->hostdevs[i];
 virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys;
+virDomainHostdevSubsysSCSIPtr scsisrc;
+virDomainHostdevSubsysMediatedDevPtr mdevsrc;
 VIR_AUTOFREE(char *) devstr = NULL;
+VIR_AUTOFREE(char *) drvstr = NULL;
+VIR_AUTOFREE(char *) vhostfdName = NULL;
+unsigned int bootIndex;
+int backend, vhostfd = -1;
 
-/* USB */
-if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
-subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
+if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
+continue;
 
+switch (subsys->type) {
+/* USB */
+case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
 virCommandAddArg(cmd, "-device");
 if (!(devstr =
   qemuBuildUSBHostdevDevStr(def, hostdev, qemuCaps)))
 return -1;
 virCommandAddArg(cmd, devstr);
-}
+
+break;
 
 /* PCI */
-if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
-subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
-int backend = subsys->u.pci.backend;
+case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
+backend = subsys->u.pci.backend;
 
 if (backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
@@ -5490,7 +5498,7 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
 }
 }
 
-unsigned int bootIndex = hostdev->info->bootIndex;
+bootIndex = hostdev->info->bootIndex;
 
 /* bootNet will be non-0 if boot order was set and no other
  * net devices were encountered
@@ -5508,13 +5516,12 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
 if (!devstr)
 return -1;
 virCommandAddArg(cmd, devstr);
-}
+
+break;
 
 /* SCSI */
-if (virHostdevIsSCSIDevice(hostdev)) {
-virDomainHostdevSubsysSCSIPtr scsisrc =
-&hostdev->source.subsys.u.scsi;
-VIR_AUTOFREE(char *) drvstr = NULL;
+case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
+scsisrc = &hostdev->source.subsys.u.scsi;
 
 if (scsisrc->protocol == 
VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) {
 virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc =
@@ -5537,15 +5544,13 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
 if (!(devstr = qemuBuildSCSIHostdevDevStr(def, hostdev)))
 return -1;
 virCommandAddArg(cmd, devstr);
-}
+
+break;
 
 /* SCSI_host */
-if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
-subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST) {
+case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
 if (hostdev->source.subsys.u.scsi_host.protocol ==
 VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_VHOST) {
-VIR_AUTOFREE(char *) vhostfdName = NULL;
-int vhostfd = -1;
 
 if (virSCSIVHostOpenVhostSCSI(&vhostfd) < 0)
 return -1;
@@ -5567,11 +5572,12 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
 
 virCommandAddArg(cmd, devstr);
 }
-}
+
+break;
 
 /* MDEV */
-if (virH

[libvirt] [PATCH v2 0/1] qemu_command: tidy up qemuBuildHostdevCommandLine loop

2019-10-08 Thread Daniel Henrique Barboza
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

changes from v2:
- use a switch statement instead of keeping the chained ifs,
as suggested by Jano


v1: https://www.redhat.com/archives/libvir-list/2019-October/msg00062.html

Daniel Henrique Barboza (1):
  qemu_command: tidy up qemuBuildHostdevCommandLine loop

 src/qemu/qemu_command.c | 48 +++--
 1 file changed, 27 insertions(+), 21 deletions(-)

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH v2 0/1] src/driver.c: remove duplicated code in

2019-10-08 Thread Daniel Henrique Barboza
changes from v1:
- use virThreadLocalPtr instead of virThreadLocal in
  virGetConnectGeneric
- added a missing ':'


v1: https://www.redhat.com/archives/libvir-list/2019-September/msg01323.html

Daniel Henrique Barboza (1):
  src/driver.c: remove duplicated code in virGetConnect* functions

 src/driver.c | 99 +---
 1 file changed, 24 insertions(+), 75 deletions(-)

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH v2 1/1] src/driver.c: remove duplicated code in virGetConnect* functions

2019-10-08 Thread Daniel Henrique Barboza
All the 6 virGetConnect* functions in driver.c shares the
same code base. This patch creates a new static function
virGetConnectGeneric() that contains the common code to
be used with all other virGetConnect*.

Signed-off-by: Daniel Henrique Barboza 
---
 src/driver.c | 99 +---
 1 file changed, 24 insertions(+), 75 deletions(-)

diff --git a/src/driver.c b/src/driver.c
index 305c4c624b..4b526a73ae 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -135,112 +135,61 @@ virConnectCacheOnceInit(void)
 
 VIR_ONCE_GLOBAL_INIT(virConnectCache);
 
-virConnectPtr virGetConnectInterface(void)
+static virConnectPtr
+virGetConnectGeneric(virThreadLocalPtr threadPtr, const char *name)
 {
 virConnectPtr conn;
 
 if (virConnectCacheInitialize() < 0)
 return NULL;
 
-conn = virThreadLocalGet(&connectInterface);
+conn = virThreadLocalGet(threadPtr);
+
 if (conn) {
-VIR_DEBUG("Return cached interface connection %p", conn);
+VIR_DEBUG("Return cached %s connection %p", name, conn);
 virObjectRef(conn);
 } else {
-conn = virConnectOpen(geteuid() == 0 ? "interface:///system" : 
"interface:///session");
-VIR_DEBUG("Opened new interface connection %p", conn);
+VIR_AUTOFREE(char *) uri = NULL;
+const char *uriPath = geteuid() == 0 ? "/system" : "/session";
+
+if (virAsprintf(&uri, "%s://%s", name, uriPath) < 0)
+return NULL;
+
+conn = virConnectOpen(uri);
+VIR_DEBUG("Opened new %s connection %p", name, conn);
 }
 return conn;
 }
 
-virConnectPtr virGetConnectNetwork(void)
-{
-virConnectPtr conn;
 
-if (virConnectCacheInitialize() < 0)
-return NULL;
+virConnectPtr virGetConnectInterface(void)
+{
+return virGetConnectGeneric(&connectInterface, "interface");
+}
 
-conn = virThreadLocalGet(&connectNetwork);
-if (conn) {
-VIR_DEBUG("Return cached network connection %p", conn);
-virObjectRef(conn);
-} else {
-conn = virConnectOpen(geteuid() == 0 ? "network:///system" : 
"network:///session");
-VIR_DEBUG("Opened new network connection %p", conn);
-}
-return conn;
+virConnectPtr virGetConnectNetwork(void)
+{
+return virGetConnectGeneric(&connectNetwork, "network");
 }
 
 virConnectPtr virGetConnectNWFilter(void)
 {
-virConnectPtr conn;
-
-if (virConnectCacheInitialize() < 0)
-return NULL;
-
-conn = virThreadLocalGet(&connectNWFilter);
-if (conn) {
-VIR_DEBUG("Return cached nwfilter connection %p", conn);
-virObjectRef(conn);
-} else {
-conn = virConnectOpen(geteuid() == 0 ? "nwfilter:///system" : 
"nwfilter:///session");
-VIR_DEBUG("Opened new nwfilter connection %p", conn);
-}
-return conn;
+return virGetConnectGeneric(&connectNWFilter, "nwfilter");
 }
 
 virConnectPtr virGetConnectNodeDev(void)
 {
-virConnectPtr conn;
-
-if (virConnectCacheInitialize() < 0)
-return NULL;
-
-conn = virThreadLocalGet(&connectNodeDev);
-if (conn) {
-VIR_DEBUG("Return cached nodedev connection %p", conn);
-virObjectRef(conn);
-} else {
-conn = virConnectOpen(geteuid() == 0 ? "nodedev:///system" : 
"nodedev:///session");
-VIR_DEBUG("Opened new nodedev connection %p", conn);
-}
-return conn;
+return virGetConnectGeneric(&connectNodeDev, "nodedev");
 }
 
 virConnectPtr virGetConnectSecret(void)
 {
-virConnectPtr conn;
-
-if (virConnectCacheInitialize() < 0)
-return NULL;
-
-conn = virThreadLocalGet(&connectSecret);
-if (conn) {
-VIR_DEBUG("Return cached secret connection %p", conn);
-virObjectRef(conn);
-} else {
-conn = virConnectOpen(geteuid() == 0 ? "secret:///system" : 
"secret:///session");
-VIR_DEBUG("Opened new secret connection %p", conn);
-}
-return conn;
+return virGetConnectGeneric(&connectSecret, "secret");
 }
 
 virConnectPtr virGetConnectStorage(void)
 {
-virConnectPtr conn;
-
-if (virConnectCacheInitialize() < 0)
-return NULL;
-
-conn = virThreadLocalGet(&connectStorage);
-if (conn) {
-VIR_DEBUG("Return cached storage connection %p", conn);
-virObjectRef(conn);
-} else {
-conn = virConnectOpen(geteuid() == 0 ? "storage:///system" : 
"storage:///session");
-VIR_DEBUG("Opened new storage connection %p", conn);
-}
-return conn;
+return virGetConnectGeneric(&connectStorage, "storage");
 }
 
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [jenkins-ci PATCH v3 12/12] Switch libvirt-dbus to Meson

2019-10-08 Thread Fabiano Fidêncio
As libvirt-dbus has switched to using Meson instead of autotools, let's
switch its jobs here.

During the switch, `make check` and `make syntax-check` got merged into
`ninja test`, which is reflected here by merging those two jobs.

Signed-off-by: Fabiano Fidêncio 
Reviewed-by: Andrea Bolognani 
---
 .../playbooks/build/projects/libvirt-dbus.yml | 24 ++-
 jenkins/projects/libvirt-dbus.yaml| 22 +++--
 2 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/guests/playbooks/build/projects/libvirt-dbus.yml 
b/guests/playbooks/build/projects/libvirt-dbus.yml
index 148be8f..910fa65 100644
--- a/guests/playbooks/build/projects/libvirt-dbus.yml
+++ b/guests/playbooks/build/projects/libvirt-dbus.yml
@@ -6,36 +6,26 @@
 git_url: '{{ git_urls["libvirt-dbus"][git_remote] }}'
 
 - include: '{{ playbook_base }}/jobs/prepare.yml'
-- include: '{{ playbook_base }}/jobs/autotools-build-job.yml'
-- include: '{{ playbook_base }}/jobs/autotools-syntax-check-job.yml'
+- include: '{{ playbook_base }}/jobs/meson-build-job.yml'
+- include: '{{ playbook_base }}/jobs/meson-check-job.yml'
   vars:
 # flake8 and pyflakes versions currently available on FreeBSD
 # (3.5.0 and 2.0.0 respectively) are not compatible.
+# Python3 version in Ubuntu 16.04 and python3-pytest version
+# in CentOS 7 are too old.
 machines:
-  - libvirt-centos-7
   - libvirt-debian-9
   - libvirt-debian-10
   - libvirt-debian-sid
   - libvirt-fedora-29
   - libvirt-fedora-30
   - libvirt-fedora-rawhide
-  - libvirt-ubuntu-16
   - libvirt-ubuntu-18
-- include: '{{ playbook_base }}/jobs/autotools-check-job.yml'
+- include: '{{ playbook_base }}/jobs/meson-rpm-job.yml'
   vars:
-# Python3 version in Ubuntu 16.04 and python3-pytest version
-# in CentOS 7 are too old.
+# RPM build is still not possible on CentOS7 as it does not
+# have the needed RPM macros for meson.
 machines:
-  - libvirt-debian-9
-  - libvirt-debian-10
-  - libvirt-debian-sid
   - libvirt-fedora-29
   - libvirt-fedora-30
   - libvirt-fedora-rawhide
-  - libvirt-freebsd-11
-  - libvirt-freebsd-12
-  - libvirt-freebsd-current
-  - libvirt-ubuntu-18
-- include: '{{ playbook_base }}/jobs/autotools-rpm-job.yml'
-  vars:
-machines: '{{ rpm_machines }}'
diff --git a/jenkins/projects/libvirt-dbus.yaml 
b/jenkins/projects/libvirt-dbus.yaml
index b4f5e1e..7a1e8f3 100644
--- a/jenkins/projects/libvirt-dbus.yaml
+++ b/jenkins/projects/libvirt-dbus.yaml
@@ -6,31 +6,25 @@
 archive_format: xz
 git_url: '{git_urls[libvirt-dbus][default]}'
 jobs:
-  - autotools-build-job:
+  - meson-build-job:
   parent_jobs: 'libvirt-glib-build'
-  - autotools-syntax-check-job:
+  - meson-check-job:
   parent_jobs: 'libvirt-dbus-build'
   # flake8 and pyflakes versions currently available on FreeBSD
   # (3.5.0 and 2.0.0 respectively) are not compatible.
+  # Python3 version in Ubuntu 16.04 and python3-pytest version
+  # in CentOS 7 are too old.
   machines:
-- libvirt-centos-7
 - libvirt-debian-9
 - libvirt-debian-10
 - libvirt-fedora-29
 - libvirt-fedora-30
 - libvirt-fedora-rawhide
-  - autotools-check-job:
-  parent_jobs: 'libvirt-dbus-syntax-check'
-  # Python 3 version in Ubuntu 16.04 and python3-pytest version
-  # in CentOS 7 are too old.
+  - meson-rpm-job:
+  parent_jobs: 'libvirt-dbus-check'
+  # RPM build is still not possible on CentOS7 as it does not
+  # have the needed RPM macros for meson.
   machines:
-- libvirt-debian-9
-- libvirt-debian-10
 - libvirt-fedora-29
 - libvirt-fedora-30
 - libvirt-fedora-rawhide
-- libvirt-freebsd-11
-- libvirt-freebsd-12
-  - autotools-rpm-job:
-  parent_jobs: 'libvirt-dbus-check'
-  machines: '{rpm_machines}'
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 06/12] guests: Install meson via pip

2019-10-08 Thread Fabiano Fidêncio
Let's install meson via pip whenever meson is not available at all or
does not match the minimum required version.

Signed-off-by: Fabiano Fidêncio 
---
 guests/lcitool | 25 
 guests/playbooks/update/tasks/packages.yml | 44 ++
 guests/vars/mappings.yml   | 17 +
 3 files changed, 86 insertions(+)

diff --git a/guests/lcitool b/guests/lcitool
index 5b5b622..2c08455 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -303,6 +303,7 @@ class Projects:
 with open(mappings_path, "r") as infile:
 mappings = yaml.safe_load(infile)
 self._mappings = mappings["mappings"]
+self._pip_mappings = mappings["pip_mappings"]
 except Exception as ex:
 raise Exception("Can't load mappings: {}".format(ex))
 
@@ -340,6 +341,9 @@ class Projects:
 def get_mappings(self):
 return self._mappings
 
+def get_pip_mappings(self):
+return self._pip_mappings
+
 def get_packages(self, project):
 return self._packages[project]
 
@@ -583,6 +587,7 @@ class Application:
 
 def _action_dockerfile(self, args):
 mappings = self._projects.get_mappings()
+pip_mappings = self._projects.get_pip_mappings()
 
 hosts = self._inventory.expand_pattern(args.hosts)
 if len(hosts) > 1:
@@ -617,6 +622,7 @@ class Application:
 
 pkgs = {}
 cross_pkgs = {}
+pip_pkgs = {}
 base_keys = ["default", package_format, os_name, os_full]
 cross_keys = []
 if args.cross_arch:
@@ -641,21 +647,28 @@ class Application:
 for key in keys:
 if key in mappings[package]:
 pkgs[package] = mappings[package][key]
+if package in pip_mappings and key in 
pip_mappings[package]:
+pip_pkgs[package] = pip_mappings[package][key]
 
 if package not in pkgs:
 continue
+if package in pip_pkgs and pkgs[package] is not None:
+del pip_pkgs[package]
 if cross_policy == "foreign" and pkgs[package] is not None:
 cross_pkgs[package] = pkgs[package]
 if pkgs[package] is None or cross_policy in ["skip", 
"foreign"]:
 del pkgs[package]
 
 pkg_align = " \\\n" + (" " * len("RUN " + package_manager + " "))
+pip_pkg_align = " \\\n" + (" " * len("RUN pip3 "))
 
 print("FROM {}".format(facts["docker_base"]))
 
 varmap = {}
 varmap["package_manager"] = package_manager
 varmap["pkgs"] = pkg_align[1:] + 
pkg_align.join(sorted(set(pkgs.values(
+varmap["pip_pkgs"] = pip_pkg_align[1:] + 
pip_pkg_align.join(sorted(set(pip_pkgs.values(
+
 if package_format == "deb":
 if args.cross_arch:
 deb_arch = Util.native_arch_to_deb_arch(args.cross_arch)
@@ -691,7 +704,14 @@ class Application:
 {package_manager} install --no-install-recommends -y 
{cross_pkgs} && \\
 {package_manager} autoremove -y && \\
 {package_manager} autoclean -y
+""").format(**varmap))
+
+if pip_pkgs:
+sys.stdout.write(textwrap.dedent("""
+RUN pip3 install {pip_pkgs}
+""").format(**varmap))
 
+sys.stdout.write(textwrap.dedent("""
 ENV ABI "{cross_abi}"
 ENV CONFIGURE_OPTS "--host={cross_abi} \\
 --target={cross_abi}"
@@ -714,6 +734,11 @@ class Application:
 {package_manager} clean all -y
 """).format(**varmap))
 
+if pip_pkgs:
+sys.stdout.write(textwrap.dedent("""
+RUN pip3 install {pip_pkgs}
+""").format(**varmap))
+
 def run(self):
 args = self._parser.parse_args()
 if args.debug:
diff --git a/guests/playbooks/update/tasks/packages.yml 
b/guests/playbooks/update/tasks/packages.yml
index ec8a4c4..c041eab 100644
--- a/guests/playbooks/update/tasks/packages.yml
+++ b/guests/playbooks/update/tasks/packages.yml
@@ -100,3 +100,47 @@
   package:
 name: '{{ flattened|sort }}'
 state: '{{ state }}'
+
+- set_fact:
+pip_temp: {}
+
+- name: '{{ project }}: Verify pip mappings'
+  fail:
+msg: 'No mappings defined for {{ item }}'
+  with_items:
+'{{ packages }}'
+  when:
+- pip_mappings[item] is undefined
+
+- name: '{{ project }}: Look up pip mappings (default)'
+  set_fact:
+pip_temp: '{{ pip_temp|combine({ item: pip_mappings[item]["default"] }) }}'
+  with_items:
+'{{ packages }}'
+  when:
+- pip_mappings[item]["default"] is defined
+
+- set_fact:
+pip_flattened: []
+
+- name: '{{ project }}: Flatten pip package list'
+  s

[libvirt] [jenkins-ci PATCH v3 04/12] mappings: Add python3-pip

2019-10-08 Thread Fabiano Fidêncio
pip will be used to install meson on OSes which do not have support to
the minimum required version of the project.

Signed-off-by: Fabiano Fidêncio 
Reviewed-by: Andrea Bolognani 
---
 guests/vars/mappings.yml | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index f69937a..524cff2 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -856,6 +856,12 @@ mappings:
 FreeBSD: py36-nose
 CentOS7: python36-nose
 
+  python3-pip:
+CentOS7: python3-pip
+Debian9: python3-pip
+Ubuntu16: python3-pip
+Ubuntu18: python3-pip
+
   python3-pytest:
 default: python3-pytest
 FreeBSD: py36-pytest
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 08/12] osinfo-db: Build again on all machines

2019-10-08 Thread Fabiano Fidêncio
As now we've the needed packages for building and testing osinfo-db
on all systems supported by libvirt-jenkins-ci, let's build osinfo-db
everywhere.

Signed-off-by: Fabiano Fidêncio 
Reviewed-by: Andrea Bolognani 
---
 guests/host_vars/libvirt-centos-7/main.yml|  1 +
 guests/host_vars/libvirt-debian-9/main.yml|  1 +
 guests/host_vars/libvirt-ubuntu-16/main.yml   |  1 +
 guests/host_vars/libvirt-ubuntu-18/main.yml   |  1 +
 guests/playbooks/build/projects/osinfo-db.yml | 15 ++-
 jenkins/projects/osinfo-db.yaml   | 13 ++---
 6 files changed, 8 insertions(+), 24 deletions(-)

diff --git a/guests/host_vars/libvirt-centos-7/main.yml 
b/guests/host_vars/libvirt-centos-7/main.yml
index 908aeef..17f3123 100644
--- a/guests/host_vars/libvirt-centos-7/main.yml
+++ b/guests/host_vars/libvirt-centos-7/main.yml
@@ -7,6 +7,7 @@ projects:
   - libvirt-ocaml
   - libvirt-perl
   - libvirt-python
+  - osinfo-db
   - osinfo-db-tools
   - virt-viewer
 
diff --git a/guests/host_vars/libvirt-debian-9/main.yml 
b/guests/host_vars/libvirt-debian-9/main.yml
index 054f4e0..c6d774c 100644
--- a/guests/host_vars/libvirt-debian-9/main.yml
+++ b/guests/host_vars/libvirt-debian-9/main.yml
@@ -10,6 +10,7 @@ projects:
   - libvirt-python
   - libvirt-sandbox
   - libvirt-tck
+  - osinfo-db
   - osinfo-db-tools
   - virt-viewer
 
diff --git a/guests/host_vars/libvirt-ubuntu-16/main.yml 
b/guests/host_vars/libvirt-ubuntu-16/main.yml
index 89d4c96..7fc7411 100644
--- a/guests/host_vars/libvirt-ubuntu-16/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-16/main.yml
@@ -10,6 +10,7 @@ projects:
   - libvirt-python
   - libvirt-sandbox
   - libvirt-tck
+  - osinfo-db
   - osinfo-db-tools
   - virt-viewer
 
diff --git a/guests/host_vars/libvirt-ubuntu-18/main.yml 
b/guests/host_vars/libvirt-ubuntu-18/main.yml
index 7ce6711..7197037 100644
--- a/guests/host_vars/libvirt-ubuntu-18/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-18/main.yml
@@ -10,6 +10,7 @@ projects:
   - libvirt-python
   - libvirt-sandbox
   - libvirt-tck
+  - osinfo-db
   - osinfo-db-tools
   - virt-viewer
 
diff --git a/guests/playbooks/build/projects/osinfo-db.yml 
b/guests/playbooks/build/projects/osinfo-db.yml
index 1952827..cc88fe8 100644
--- a/guests/playbooks/build/projects/osinfo-db.yml
+++ b/guests/playbooks/build/projects/osinfo-db.yml
@@ -1,15 +1,7 @@
 ---
 - set_fact:
 name: osinfo-db
-machines:
-  - libvirt-debian-10
-  - libvirt-debian-sid
-  - libvirt-fedora-29
-  - libvirt-fedora-30
-  - libvirt-fedora-rawhide
-  - libvirt-freebsd-11
-  - libvirt-freebsd-12
-  - libvirt-freebsd-current
+machines: '{{ all_machines }}'
 archive_format: xz
 git_url: '{{ git_urls["osinfo-db"][git_remote] }}'
 
@@ -25,10 +17,7 @@
   $MAKE check
 - include: '{{ playbook_base }}/jobs/generic-rpm-job.yml'
   vars:
-machines:
-  - libvirt-fedora-29
-  - libvirt-fedora-30
-  - libvirt-fedora-rawhide
+machines: '{{ rpm_machines }}'
 command: |
   {{ strip_buildrequires }}
   rpmbuild --clean --define "_topdir `pwd`/rpmbuild" --define "_sourcedir 
`pwd`" -ba osinfo-db.spec
diff --git a/jenkins/projects/osinfo-db.yaml b/jenkins/projects/osinfo-db.yaml
index 7074fd1..87b6748 100644
--- a/jenkins/projects/osinfo-db.yaml
+++ b/jenkins/projects/osinfo-db.yaml
@@ -1,13 +1,7 @@
 ---
 - project:
 name: osinfo-db
-machines:
-  - libvirt-debian-10
-  - libvirt-fedora-29
-  - libvirt-fedora-30
-  - libvirt-fedora-rawhide
-  - libvirt-freebsd-11
-  - libvirt-freebsd-12
+machines: '{all_machines}'
 title: osinfo database
 archive_format: xz
 git_url: '{git_urls[osinfo-db][default]}'
@@ -23,10 +17,7 @@
 $MAKE check
   - generic-rpm-job:
   parent_jobs: 'osinfo-db-check'
-  machines:
-- libvirt-fedora-29
-- libvirt-fedora-30
-- libvirt-fedora-rawhide
+  machines: '{rpm_machines}'
   command: |
 {strip_buildrequires}
 rpmbuild --clean --define "_topdir `pwd`/rpmbuild" --define 
"_sourcedir `pwd`" -ba osinfo-db.spec
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 07/12] osinfo-db-tools: Build again on all machines

2019-10-08 Thread Fabiano Fidêncio
As now we've the needed packages for building and testing
osinfo-db-tools on all systems supported by libvirt-jenkins-ci, let's
build osinfo-db-tools everywhere.

RPM build is still not possible in CentOS7 as it doesn't have the
needed RPM macros for Meson.

Signed-off-by: Fabiano Fidêncio 
Reviewed-by: Andrea Bolognani 
---
 guests/host_vars/libvirt-centos-7/main.yml |  1 +
 guests/host_vars/libvirt-debian-9/main.yml |  1 +
 guests/host_vars/libvirt-ubuntu-16/main.yml|  1 +
 guests/host_vars/libvirt-ubuntu-18/main.yml|  1 +
 .../playbooks/build/projects/osinfo-db-tools.yml   | 14 +++---
 jenkins/projects/osinfo-db-tools.yaml  | 12 +++-
 6 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/guests/host_vars/libvirt-centos-7/main.yml 
b/guests/host_vars/libvirt-centos-7/main.yml
index 4e3ce85..908aeef 100644
--- a/guests/host_vars/libvirt-centos-7/main.yml
+++ b/guests/host_vars/libvirt-centos-7/main.yml
@@ -7,6 +7,7 @@ projects:
   - libvirt-ocaml
   - libvirt-perl
   - libvirt-python
+  - osinfo-db-tools
   - virt-viewer
 
 package_format: 'rpm'
diff --git a/guests/host_vars/libvirt-debian-9/main.yml 
b/guests/host_vars/libvirt-debian-9/main.yml
index c388ee8..054f4e0 100644
--- a/guests/host_vars/libvirt-debian-9/main.yml
+++ b/guests/host_vars/libvirt-debian-9/main.yml
@@ -10,6 +10,7 @@ projects:
   - libvirt-python
   - libvirt-sandbox
   - libvirt-tck
+  - osinfo-db-tools
   - virt-viewer
 
 package_format: 'deb'
diff --git a/guests/host_vars/libvirt-ubuntu-16/main.yml 
b/guests/host_vars/libvirt-ubuntu-16/main.yml
index bed11d4..89d4c96 100644
--- a/guests/host_vars/libvirt-ubuntu-16/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-16/main.yml
@@ -10,6 +10,7 @@ projects:
   - libvirt-python
   - libvirt-sandbox
   - libvirt-tck
+  - osinfo-db-tools
   - virt-viewer
 
 package_format: 'deb'
diff --git a/guests/host_vars/libvirt-ubuntu-18/main.yml 
b/guests/host_vars/libvirt-ubuntu-18/main.yml
index 199b2bb..7ce6711 100644
--- a/guests/host_vars/libvirt-ubuntu-18/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-18/main.yml
@@ -10,6 +10,7 @@ projects:
   - libvirt-python
   - libvirt-sandbox
   - libvirt-tck
+  - osinfo-db-tools
   - virt-viewer
 
 package_format: 'deb'
diff --git a/guests/playbooks/build/projects/osinfo-db-tools.yml 
b/guests/playbooks/build/projects/osinfo-db-tools.yml
index 67e5f00..68eb620 100644
--- a/guests/playbooks/build/projects/osinfo-db-tools.yml
+++ b/guests/playbooks/build/projects/osinfo-db-tools.yml
@@ -1,17 +1,7 @@
 ---
 - set_fact:
 name: osinfo-db-tools
-# osinfo-db-tools depends on meson 0.49.0, which is not available on
-# CentOS 7, Debian 9, Ubuntu 18;
-machines:
-  - libvirt-debian-10
-  - libvirt-debian-sid
-  - libvirt-fedora-29
-  - libvirt-fedora-30
-  - libvirt-fedora-rawhide
-  - libvirt-freebsd-11
-  - libvirt-freebsd-12
-  - libvirt-freebsd-current
+machines: '{{ all_machines }}'
 archive_format: xz
 git_url: '{{ git_urls["osinfo-db-tools"][git_remote] }}'
 
@@ -20,6 +10,8 @@
 - include: '{{ playbook_base }}/jobs/meson-check-job.yml'
 - include: '{{ playbook_base }}/jobs/meson-rpm-job.yml'
   vars:
+# RPM build is still not possible on CentOS7 as it does not
+# have the needed RPM macros for meson.
 machines:
   - libvirt-fedora-29
   - libvirt-fedora-30
diff --git a/jenkins/projects/osinfo-db-tools.yaml 
b/jenkins/projects/osinfo-db-tools.yaml
index 8609b46..121da37 100644
--- a/jenkins/projects/osinfo-db-tools.yaml
+++ b/jenkins/projects/osinfo-db-tools.yaml
@@ -1,15 +1,7 @@
 ---
 - project:
 name: osinfo-db-tools
-# osinfo-db-tools requires meson 0.49.0, which is not available on
-# CentOS 7 and Debian 9;
-machines:
-  - libvirt-debian-10
-  - libvirt-fedora-29
-  - libvirt-fedora-30
-  - libvirt-fedora-rawhide
-  - libvirt-freebsd-11
-  - libvirt-freebsd-12
+machines: '{all_machines}'
 title: osinfo database tools
 archive_format: xz
 git_url: '{git_urls[osinfo-db-tools][default]}'
@@ -20,6 +12,8 @@
   parent_jobs: 'osinfo-db-tools-build'
   - meson-rpm-job:
   parent_jobs: 'osinfo-db-tools-check'
+  # RPM build is still not possible on CentOS7 as it does not
+  # have the needed RPM macros for meson.
   machines:
 - libvirt-fedora-29
 - libvirt-fedora-30
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 02/12] mappings: Add python2-setuptools

2019-10-08 Thread Fabiano Fidêncio
python-setuptools, which will only be used on CentOS7, is needed in order
to properly use the pip module for installing meson.

Without this package, we would see failures as `ImportError: No module
named pkg_resources` when trying to use the pip module, even when using
its python3 version.

Signed-off-by: Fabiano Fidêncio 
Reviewed-by: Andrea Bolognani 
---
 guests/vars/mappings.yml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index 5c32c94..f69937a 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -816,6 +816,9 @@ mappings:
 Fedora: python2-nose
 FreeBSD: py27-nose
 
+  python2-setuptools:
+CentOS7: python2-setuptools
+
   python3:
 default: python3
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 10/12] virt-manager: Build again on Debian9 and Ubuntu18

2019-10-08 Thread Fabiano Fidêncio
As osinfo-db-tools, osindo-db, and libosinfo can now be built again on
Debian9 and Ubuntu18, let's enable virt-manager builds on those OSes as
well.

This commit partilly reverts 570143fc41fa270.

Signed-off-by: Fabiano Fidêncio 
---
 guests/host_vars/libvirt-debian-9/main.yml   | 1 +
 guests/host_vars/libvirt-ubuntu-18/main.yml  | 1 +
 guests/playbooks/build/projects/virt-manager.yml | 4 
 jenkins/projects/virt-manager.yaml   | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/guests/host_vars/libvirt-debian-9/main.yml 
b/guests/host_vars/libvirt-debian-9/main.yml
index 6ac3808..6b685a4 100644
--- a/guests/host_vars/libvirt-debian-9/main.yml
+++ b/guests/host_vars/libvirt-debian-9/main.yml
@@ -13,6 +13,7 @@ projects:
   - libvirt-tck
   - osinfo-db
   - osinfo-db-tools
+  - virt-manager
   - virt-viewer
 
 package_format: 'deb'
diff --git a/guests/host_vars/libvirt-ubuntu-18/main.yml 
b/guests/host_vars/libvirt-ubuntu-18/main.yml
index e9a5a7b..5b5bf0c 100644
--- a/guests/host_vars/libvirt-ubuntu-18/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-18/main.yml
@@ -13,6 +13,7 @@ projects:
   - libvirt-tck
   - osinfo-db
   - osinfo-db-tools
+  - virt-manager
   - virt-viewer
 
 package_format: 'deb'
diff --git a/guests/playbooks/build/projects/virt-manager.yml 
b/guests/playbooks/build/projects/virt-manager.yml
index 0078fbe..f955f4c 100644
--- a/guests/playbooks/build/projects/virt-manager.yml
+++ b/guests/playbooks/build/projects/virt-manager.yml
@@ -5,6 +5,7 @@
 # Ubuntu 16.04 has Python 3 but not the libxml2 bindings, so it can't
 # build the project either
 machines:
+  - libvirt-debian-9
   - libvirt-debian-10
   - libvirt-debian-sid
   - libvirt-fedora-29
@@ -13,6 +14,7 @@
   - libvirt-freebsd-11
   - libvirt-freebsd-12
   - libvirt-freebsd-current
+  - libvirt-ubuntu-18
 archive_format: gz
 git_url: '{{ git_urls["virt-manager"][git_remote] }}'
 
@@ -27,11 +29,13 @@
 # so skip the test suite there for the time being. See
 # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224902
 machines:
+  - libvirt-debian-9
   - libvirt-debian-10
   - libvirt-debian-sid
   - libvirt-fedora-29
   - libvirt-fedora-30
   - libvirt-fedora-rawhide
+  - libvirt-ubuntu-18
 - include: '{{ playbook_base }}/jobs/python-distutils-rpm-job.yml'
   vars:
 machines:
diff --git a/jenkins/projects/virt-manager.yaml 
b/jenkins/projects/virt-manager.yaml
index fe6b903..2577ea9 100644
--- a/jenkins/projects/virt-manager.yaml
+++ b/jenkins/projects/virt-manager.yaml
@@ -5,6 +5,7 @@
 # Ubuntu 16.04 has Python 3 but not the libxml2 bindings, so it can't
 # build the project either
 machines:
+  - libvirt-debian-9
   - libvirt-debian-10
   - libvirt-fedora-29
   - libvirt-fedora-30
@@ -27,6 +28,7 @@
   # so skip the test suite there for the time being. See
   # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224902
   machines:
+- libvirt-debian-9
 - libvirt-debian-10
 - libvirt-fedora-29
 - libvirt-fedora-30
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 11/12] libvirt-dbus: Take advantage of Python 3 on CentOS 7

2019-10-08 Thread Fabiano Fidêncio
As latest CentOS 7 has added python3, CentOS 7 has support to python3,
let's run syntax-check job the project.

Also, let's update the comment explaining that we don't run `make check`
on CentOS 7 because python3-pytest version is too old.

Signed-off-by: Fabiano Fidêncio 
Reviewed-by: Andrea Bolognani 
---
 guests/playbooks/build/projects/libvirt-dbus.yml | 10 +-
 jenkins/projects/libvirt-dbus.yaml   | 10 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/guests/playbooks/build/projects/libvirt-dbus.yml 
b/guests/playbooks/build/projects/libvirt-dbus.yml
index 218bcc1..148be8f 100644
--- a/guests/playbooks/build/projects/libvirt-dbus.yml
+++ b/guests/playbooks/build/projects/libvirt-dbus.yml
@@ -9,10 +9,10 @@
 - include: '{{ playbook_base }}/jobs/autotools-build-job.yml'
 - include: '{{ playbook_base }}/jobs/autotools-syntax-check-job.yml'
   vars:
-# CentOS 7 doesn't include Python 3, while the versions of flake8
-# and pyflakes currently available on FreeBSD (3.5.0 and 2.0.0
-# respectively) are not compatible
+# flake8 and pyflakes versions currently available on FreeBSD
+# (3.5.0 and 2.0.0 respectively) are not compatible.
 machines:
+  - libvirt-centos-7
   - libvirt-debian-9
   - libvirt-debian-10
   - libvirt-debian-sid
@@ -23,8 +23,8 @@
   - libvirt-ubuntu-18
 - include: '{{ playbook_base }}/jobs/autotools-check-job.yml'
   vars:
-# CentOS 7 doesn't include Python 3 and the version in Ubuntu
-# 16.04 is too old
+# Python3 version in Ubuntu 16.04 and python3-pytest version
+# in CentOS 7 are too old.
 machines:
   - libvirt-debian-9
   - libvirt-debian-10
diff --git a/jenkins/projects/libvirt-dbus.yaml 
b/jenkins/projects/libvirt-dbus.yaml
index f7a52ef..b4f5e1e 100644
--- a/jenkins/projects/libvirt-dbus.yaml
+++ b/jenkins/projects/libvirt-dbus.yaml
@@ -10,10 +10,10 @@
   parent_jobs: 'libvirt-glib-build'
   - autotools-syntax-check-job:
   parent_jobs: 'libvirt-dbus-build'
-  # CentOS 7 doesn't include Python 3, while the versions of flake8
-  # and pyflakes currently available on FreeBSD (3.5.0 and 2.0.0
-  # respectively) are not compatible
+  # flake8 and pyflakes versions currently available on FreeBSD
+  # (3.5.0 and 2.0.0 respectively) are not compatible.
   machines:
+- libvirt-centos-7
 - libvirt-debian-9
 - libvirt-debian-10
 - libvirt-fedora-29
@@ -21,8 +21,8 @@
 - libvirt-fedora-rawhide
   - autotools-check-job:
   parent_jobs: 'libvirt-dbus-syntax-check'
-  # CentOS 7 doesn't include Python 3 and the version in Ubuntu
-  # 16.04 is too old
+  # Python 3 version in Ubuntu 16.04 and python3-pytest version
+  # in CentOS 7 are too old.
   machines:
 - libvirt-debian-9
 - libvirt-debian-10
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 05/12] guests: Add python3-pip to the base project

2019-10-08 Thread Fabiano Fidêncio
Signed-off-by: Fabiano Fidêncio 
Reviewed-by: Andrea Bolognani 
---
 guests/vars/projects/base.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guests/vars/projects/base.yml b/guests/vars/projects/base.yml
index a8c83ac..ec04fdf 100644
--- a/guests/vars/projects/base.yml
+++ b/guests/vars/projects/base.yml
@@ -26,6 +26,7 @@ packages:
   - perl
   - pkg-config
   - python2-setuptools
+  - python3-pip
   - rpmbuild
   - screen
   - strace
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 01/12] guests: add flake8 to libvirt project

2019-10-08 Thread Fabiano Fidêncio
From: Daniel P. Berrangé 

Reviewed-by: Fabiano Fidêncio 
Signed-off-by: Daniel P. Berrangé 
---
 guests/vars/projects/libvirt.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml
index 04c3ecd..8fcb286 100644
--- a/guests/vars/projects/libvirt.yml
+++ b/guests/vars/projects/libvirt.yml
@@ -9,6 +9,7 @@ packages:
   - dtrace
   - dwarves
   - ebtables
+  - flake8
   - fuse
   - glib2
   - glusterfs
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 03/12] guests: Add python2-setuptools to the base project

2019-10-08 Thread Fabiano Fidêncio
Signed-off-by: Fabiano Fidêncio 
Reviewed-by: Andrea Bolognani 
---
 guests/vars/projects/base.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guests/vars/projects/base.yml b/guests/vars/projects/base.yml
index f008de3..a8c83ac 100644
--- a/guests/vars/projects/base.yml
+++ b/guests/vars/projects/base.yml
@@ -25,6 +25,7 @@ packages:
   - patch
   - perl
   - pkg-config
+  - python2-setuptools
   - rpmbuild
   - screen
   - strace
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 09/12] libosinfo: Build again on all machines

2019-10-08 Thread Fabiano Fidêncio
As now we've the needed packages for building and testing libosinfo
on all systems supported by libvirt-jenkins-ci, let's build libosinfo
everywhere.

RPM build is still not possible in CentOS7 as it doesn't have the
needed RPM macros for Meson.

Signed-off-by: Fabiano Fidêncio 
Reviewed-by: Andrea Bolognani 
---
 guests/host_vars/libvirt-centos-7/main.yml|  1 +
 guests/host_vars/libvirt-debian-9/main.yml|  1 +
 guests/host_vars/libvirt-ubuntu-16/main.yml   |  1 +
 guests/host_vars/libvirt-ubuntu-18/main.yml   |  1 +
 guests/playbooks/build/projects/libosinfo.yml | 14 +++---
 jenkins/projects/libosinfo.yaml   | 10 +++---
 6 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/guests/host_vars/libvirt-centos-7/main.yml 
b/guests/host_vars/libvirt-centos-7/main.yml
index 17f3123..94e29af 100644
--- a/guests/host_vars/libvirt-centos-7/main.yml
+++ b/guests/host_vars/libvirt-centos-7/main.yml
@@ -1,5 +1,6 @@
 ---
 projects:
+  - libosinfo
   - libvirt
   - libvirt-cim
   - libvirt-dbus
diff --git a/guests/host_vars/libvirt-debian-9/main.yml 
b/guests/host_vars/libvirt-debian-9/main.yml
index c6d774c..6ac3808 100644
--- a/guests/host_vars/libvirt-debian-9/main.yml
+++ b/guests/host_vars/libvirt-debian-9/main.yml
@@ -1,5 +1,6 @@
 ---
 projects:
+  - libosinfo
   - libvirt
   - libvirt-dbus
   - libvirt-glib
diff --git a/guests/host_vars/libvirt-ubuntu-16/main.yml 
b/guests/host_vars/libvirt-ubuntu-16/main.yml
index 7fc7411..179dd03 100644
--- a/guests/host_vars/libvirt-ubuntu-16/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-16/main.yml
@@ -1,5 +1,6 @@
 ---
 projects:
+  - libosinfo
   - libvirt
   - libvirt-dbus
   - libvirt-glib
diff --git a/guests/host_vars/libvirt-ubuntu-18/main.yml 
b/guests/host_vars/libvirt-ubuntu-18/main.yml
index 7197037..e9a5a7b 100644
--- a/guests/host_vars/libvirt-ubuntu-18/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-18/main.yml
@@ -1,5 +1,6 @@
 ---
 projects:
+  - libosinfo
   - libvirt
   - libvirt-dbus
   - libvirt-glib
diff --git a/guests/playbooks/build/projects/libosinfo.yml 
b/guests/playbooks/build/projects/libosinfo.yml
index f06dbb3..bb583c7 100644
--- a/guests/playbooks/build/projects/libosinfo.yml
+++ b/guests/playbooks/build/projects/libosinfo.yml
@@ -1,17 +1,7 @@
 ---
 - set_fact:
 name: libosinfo
-# libosinfo depends on meson 0.49.0, which is not available on
-# CentOS 7, Debian 9, Ubuntu 18;
-machines:
-  - libvirt-debian-10
-  - libvirt-debian-sid
-  - libvirt-fedora-29
-  - libvirt-fedora-30
-  - libvirt-fedora-rawhide
-  - libvirt-freebsd-11
-  - libvirt-freebsd-12
-  - libvirt-freebsd-current
+machines: '{{ all_machines }}'
 archive_format: xz
 git_url: '{{ git_urls["libosinfo"][git_remote] }}'
 
@@ -20,6 +10,8 @@
 - include: '{{ playbook_base }}/jobs/meson-check-job.yml'
 - include: '{{ playbook_base }}/jobs/meson-rpm-job.yml'
   vars:
+# RPM build is still not possible on CentOS7 as it does not
+# have the needed RPM macros for meson.
 machines:
   - libvirt-fedora-29
   - libvirt-fedora-30
diff --git a/jenkins/projects/libosinfo.yaml b/jenkins/projects/libosinfo.yaml
index b38524e..90fc465 100644
--- a/jenkins/projects/libosinfo.yaml
+++ b/jenkins/projects/libosinfo.yaml
@@ -3,13 +3,7 @@
 name: libosinfo
 # libosinfo depends on meson 0.49.0, which is not available on
 # CentOS 7, Debian 9, Ubuntu 18;
-machines:
-  - libvirt-debian-10
-  - libvirt-fedora-29
-  - libvirt-fedora-30
-  - libvirt-fedora-rawhide
-  - libvirt-freebsd-11
-  - libvirt-freebsd-12
+machines: '{all_machines}'
 title: libosinfo
 archive_format: xz
 git_url: '{git_urls[libosinfo][default]}'
@@ -20,6 +14,8 @@
   parent_jobs: 'libosinfo-build'
   - meson-rpm-job:
   parent_jobs: 'libosinfo-check'
+  # RPM build is still not possible on CentOS7 as it does not
+  # have the needed RPM macros for meson.
   machines:
 - libvirt-fedora-29
 - libvirt-fedora-30
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH v3 00/12] Meson, more meson!

2019-10-08 Thread Fabiano Fidêncio
The first 5 patches in the series are adding the machinery for
installing meson via pip, which will be needed for systems which do not
have the minimum required version, as CentOS 7, Debian 9, Ubuntu 16, and
Ubuntu 18.

Next 3 patches build and test osinfo-db-tools, osinfo-db, and libosinfo
on all supported machines as those now have the minimum requirements
needed.

Following these patches, there's a patch re-enabling virt-manager builds
on the systems which are, again, building libosinfo.

Next 2 are basically re-enabling syntax-check job for libvirt-dbus on
CentOS 7 and removing some misleading comment.

Finally, last patch in the series does the libvirt-dbus builds switch to
using meson instead of autotools.

This version addresses the comments raised by Andrea during v2.

Daniel P. Berrangé (1):
  guests: add flake8 to libvirt project

Fabiano Fidêncio (11):
  mappings: Add python2-setuptools
  guests: Add python2-setuptools to the base project
  mappings: Add python3-pip
  guests: Add python3-pip to the base project
  guests: Install meson via pip
  osinfo-db-tools: Build again on all machines
  osinfo-db: Build again on all machines
  libosinfo: Build again on all machines
  virt-manager: Build again on Debian9 and Ubuntu18
  libvirt-dbus: Take advantage of Python 3 on CentOS 7
  Switch libvirt-dbus to Meson

 guests/host_vars/libvirt-centos-7/main.yml|  3 ++
 guests/host_vars/libvirt-debian-9/main.yml|  4 ++
 guests/host_vars/libvirt-ubuntu-16/main.yml   |  3 ++
 guests/host_vars/libvirt-ubuntu-18/main.yml   |  4 ++
 guests/lcitool| 25 +++
 guests/playbooks/build/projects/libosinfo.yml | 14 ++
 .../playbooks/build/projects/libvirt-dbus.yml | 28 
 .../build/projects/osinfo-db-tools.yml| 14 ++
 guests/playbooks/build/projects/osinfo-db.yml | 15 +--
 .../playbooks/build/projects/virt-manager.yml |  4 ++
 guests/playbooks/update/tasks/packages.yml| 44 +++
 guests/vars/mappings.yml  | 26 +++
 guests/vars/projects/base.yml |  2 +
 guests/vars/projects/libvirt.yml  |  1 +
 jenkins/projects/libosinfo.yaml   | 10 ++---
 jenkins/projects/libvirt-dbus.yaml| 26 +--
 jenkins/projects/osinfo-db-tools.yaml | 12 ++---
 jenkins/projects/osinfo-db.yaml   | 13 +-
 jenkins/projects/virt-manager.yaml|  2 +
 19 files changed, 153 insertions(+), 97 deletions(-)

-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 2/2] Revert "qemu: Obtain reference on monConfig"

2019-10-08 Thread Daniel Henrique Barboza




On 10/8/19 6:15 AM, Michal Privoznik wrote:

This reverts commit a5a777a8bae61cb9e41c4dcd12d2962ad1a65a0d.

After previous commit the domain won't disappear while connecting
to monitor. There's no need to ref monitor config then.

Signed-off-by: Michal Privoznik 
---


Reviewed-by: Daniel Henrique Barboza 



  src/qemu/qemu_process.c | 5 +
  1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b303e5ba05..4d26b5a305 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1941,7 +1941,6 @@ qemuConnectMonitor(virQEMUDriverPtr driver, 
virDomainObjPtr vm, int asyncJob,
  qemuDomainObjPrivatePtr priv = vm->privateData;
  qemuMonitorPtr mon = NULL;
  unsigned long long timeout = 0;
-virDomainChrSourceDefPtr monConfig;
  
  if (qemuSecuritySetDaemonSocketLabel(driver->securityManager, vm->def) < 0) {

  VIR_ERROR(_("Failed to set security context for monitor for %s"),
@@ -1956,10 +1955,9 @@ qemuConnectMonitor(virQEMUDriverPtr driver, 
virDomainObjPtr vm, int asyncJob,
  timeout = vm->def->mem.total_memory / (1024 * 1024);
  
  ignore_value(virTimeMillisNow(&priv->monStart));

-monConfig = virObjectRef(priv->monConfig);
  
  mon = qemuMonitorOpen(vm,

-  monConfig,
+  priv->monConfig,
retry,
timeout,
&monitorCallbacks,
@@ -1973,7 +1971,6 @@ qemuConnectMonitor(virQEMUDriverPtr driver, 
virDomainObjPtr vm, int asyncJob,
  qemuProcessMonitorLogFree);
  }
  
-virObjectUnref(monConfig);

  priv->monStart = 0;
  priv->mon = mon;
  


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 1/2] qemu: Fix @vm locking issue when connecting to the monitor

2019-10-08 Thread Daniel Henrique Barboza




On 10/8/19 6:15 AM, Michal Privoznik wrote:

When connecting to qemu's monitor the @vm object is unlocked.
This is justified - connecting may take a long time and we don't
want to wait with the domain object locked. However, just before
the domain object is locked again, the monitor's FD is registered
in the event loop. Therefore, there is a small window where the
event loop has a chance to call a handler for an event that
occurred on the monitor FD but vm is not initalized properly just
yet (i.e. priv->mon is not set). For instance, if there's an
incoming migration, qemu creates its socket but then fails to
initialize (for various reasons, I'm reproducing this by using
hugepages but leaving the HP pool empty) then the following may
happen:

1) qemuConnectMonitor() unlocks @vm

2) qemuMonitorOpen() connects to the monitor socket and by
calling qemuMonitorOpenInternal() which subsequently calls
qemuMonitorRegister() the event handler is installed

3) qemu fails to initialize and exit()-s, which closes the
monitor

4) The even loop sees EOF on the monitor and the control gets to
qemuProcessEventHandler() which locks @vm and calls
processMonitorEOFEvent() which then calls
qemuMonitorLastError(priv->mon). But priv->mon is not set just
yet.

5) qemuMonitorLastError() dereferences NULL pointer

The solution is to unlock the domain object for a shorter time
and most importantly, register event handler with domain object
locked so that any possible event processing is done only after
@vm's private data was properly initialized.

This issue is also mentioned in v4.2.0-99-ga5a777a8ba.

Since we are unlocking @vm and locking it back, another thread
might have destroyed the domain meanwhile. Therefore we have to
check if domain is still activem, and we have to do it at the


s/activem/active



same place where domain lock is acquired back, i.e. in
qemuMonitorOpen(). This creates a small problem for our test
suite which calls qemuMonitorOpen() directly and passes @vm which
has no definition. This makes virDomainObjIsActive() call crash.
Fortunately, allocating empty domain definition is sufficient.

Signed-off-by: Michal Privoznik 
---


LGTM. Hopefully this will be enough to prevent this vm lock race
with the monitor at VM startup.


Reviewed-by: Daniel Henrique Barboza 



This is an alternative approach to:

https://www.redhat.com/archives/libvir-list/2019-September/msg00749.html

  src/qemu/qemu_monitor.c  | 33 +
  src/qemu/qemu_process.c  | 12 
  tests/qemumonitortestutils.c |  2 ++
  3 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 58de26a276..a53d3b1d60 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -810,35 +810,52 @@ qemuMonitorOpen(virDomainObjPtr vm,
  qemuMonitorCallbacksPtr cb,
  void *opaque)
  {
-int fd;
+int fd = -1;
  bool hasSendFD = false;
-qemuMonitorPtr ret;
+qemuMonitorPtr ret = NULL;
  
  timeout += QEMU_DEFAULT_MONITOR_WAIT;
  
+/* Hold an extra reference because we can't allow 'vm' to be

+ * deleted until the monitor gets its own reference. */
+virObjectRef(vm);
+
  switch (config->type) {
  case VIR_DOMAIN_CHR_TYPE_UNIX:
  hasSendFD = true;
-if ((fd = qemuMonitorOpenUnix(config->data.nix.path,
-  vm->pid, retry, timeout)) < 0)
-return NULL;
+virObjectUnlock(vm);
+fd = qemuMonitorOpenUnix(config->data.nix.path,
+ vm->pid, retry, timeout);
+virObjectLock(vm);
  break;
  
  case VIR_DOMAIN_CHR_TYPE_PTY:

-if ((fd = qemuMonitorOpenPty(config->data.file.path)) < 0)
-return NULL;
+virObjectUnlock(vm);
+fd = qemuMonitorOpenPty(config->data.file.path);
+virObjectLock(vm);
  break;
  
  default:

  virReportError(VIR_ERR_INTERNAL_ERROR,
 _("unable to handle monitor type: %s"),
 virDomainChrTypeToString(config->type));
-return NULL;
+break;
+}
+
+if (fd < 0)
+goto cleanup;
+
+if (!virDomainObjIsActive(vm)) {
+virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+   _("domain is not running"));
+goto cleanup;
  }
  
  ret = qemuMonitorOpenInternal(vm, fd, hasSendFD, cb, opaque);

+ cleanup:
  if (!ret)
  VIR_FORCE_CLOSE(fd);
+virObjectUnref(vm);
  return ret;
  }
  
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c

index a50cd54393..b303e5ba05 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1955,13 +1955,8 @@ qemuConnectMonitor(virQEMUDriverPtr driver, 
virDomainObjPtr vm, int asyncJob,
   * 1GiB of guest RAM. */
  timeout = vm->def->mem.total_memory / (1024 * 1024);
  
-/*

[libvirt] [PATCH v2 2/3] qemu: Implement the ccf-assist pSeries feature

2019-10-08 Thread Daniel Henrique Barboza
This patch adds the implementation of the ccf-assist pSeries
feature, based on the QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST
capability that was added in the previous patch.

Signed-off-by: Daniel Henrique Barboza 
---
 docs/formatdomain.html.in |  9 +
 docs/schemas/domaincommon.rng |  5 +
 src/conf/domain_conf.c|  4 
 src/conf/domain_conf.h|  1 +
 src/qemu/qemu_command.c   | 20 +++
 src/qemu/qemu_domain.c|  1 +
 tests/qemuxml2argvdata/pseries-features.args  |  2 +-
 tests/qemuxml2argvdata/pseries-features.xml   |  1 +
 tests/qemuxml2argvtest.c  |  1 +
 tests/qemuxml2xmloutdata/pseries-features.xml |  1 +
 tests/qemuxml2xmltest.c   |  1 +
 11 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 647f96f651..059781a0c3 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2059,6 +2059,7 @@
 48
   
   
+  
   
 
 ...
@@ -2357,6 +2358,14 @@
   will not be ignored.
   Since 5.1.0 (bhyve only)
   
+  ccf-assist
+  Configure ccf-assist (Count Cache Flush Assist) availability for
+  pSeries guests.
+  Possible values for the state attribute
+  are on and off. If the attribute is not
+  defined, the hypervisor default will be used.
+  Since 5.8.0 (QEMU/KVM only)
+  
 
 
 Time keeping
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 40eb4a2d75..0d6ff86044 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -5120,6 +5120,11 @@
   
 
   
+  
+
+  
+
+  
 
   
 
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a53cd6a725..dd2e7fb6b9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -171,6 +171,7 @@ VIR_ENUM_IMPL(virDomainFeature,
   "htm",
   "nested-hv",
   "msrs",
+  "ccf-assist",
 );
 
 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy,
@@ -20396,6 +20397,7 @@ virDomainDefParseXML(xmlDocPtr xml,
 
 case VIR_DOMAIN_FEATURE_HTM:
 case VIR_DOMAIN_FEATURE_NESTED_HV:
+case VIR_DOMAIN_FEATURE_CCF_ASSIST:
 if (!(tmp = virXMLPropString(nodes[i], "state"))) {
 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("missing state attribute '%s' of feature 
'%s'"),
@@ -22621,6 +22623,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr 
src,
 case VIR_DOMAIN_FEATURE_VMCOREINFO:
 case VIR_DOMAIN_FEATURE_HTM:
 case VIR_DOMAIN_FEATURE_NESTED_HV:
+case VIR_DOMAIN_FEATURE_CCF_ASSIST:
 if (src->features[i] != dst->features[i]) {
 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("State of feature '%s' differs: "
@@ -28187,6 +28190,7 @@ virDomainDefFormatFeatures(virBufferPtr buf,
 case VIR_DOMAIN_FEATURE_VMPORT:
 case VIR_DOMAIN_FEATURE_HTM:
 case VIR_DOMAIN_FEATURE_NESTED_HV:
+case VIR_DOMAIN_FEATURE_CCF_ASSIST:
 switch ((virTristateSwitch) def->features[i]) {
 case VIR_TRISTATE_SWITCH_LAST:
 case VIR_TRISTATE_SWITCH_ABSENT:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 2884af49d8..e8662e4bc5 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1755,6 +1755,7 @@ typedef enum {
 VIR_DOMAIN_FEATURE_HTM,
 VIR_DOMAIN_FEATURE_NESTED_HV,
 VIR_DOMAIN_FEATURE_MSRS,
+VIR_DOMAIN_FEATURE_CCF_ASSIST,
 
 VIR_DOMAIN_FEATURE_LAST
 } virDomainFeature;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index cbf25d5f07..3bd841919d 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7409,6 +7409,26 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
 virBufferAsprintf(&buf, ",cap-nested-hv=%s", str);
 }
 
+if (def->features[VIR_DOMAIN_FEATURE_CCF_ASSIST] != 
VIR_TRISTATE_SWITCH_ABSENT) {
+const char *str;
+
+if (!virQEMUCapsGet(qemuCaps, 
QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST)) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+   _("ccf-assist configuration is not supported by 
this "
+ "QEMU binary"));
+return -1;
+}
+
+str = 
virTristateSwitchTypeToString(def->features[VIR_DOMAIN_FEATURE_CCF_ASSIST]);
+if (!str) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+   _("Invalid setting for ccf-assist state"));
+return -1;
+}
+
+virBuffe

[libvirt] [PATCH v2 3/3] news: Update for the ccf-assist pSeries feature

2019-10-08 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza 
---
 docs/news.xml | 9 +
 1 file changed, 9 insertions(+)

diff --git a/docs/news.xml b/docs/news.xml
index d9c402e6bb..b8002368ae 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -41,6 +41,15 @@
 
   
 
+  
+
+  qemu: Implement the ccf-assist pSeries feature
+
+
+  Users can now decide whether ccf-assist (Count Cache Flush Assist)
+  support should be available to pSeries guests.
+
+  
 
 
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH v2 1/3] qemu: Add capability for the ccf-assist pSeries feature

2019-10-08 Thread Daniel Henrique Barboza
Linux kernel 5.1 added a new PPC KVM capability named
KVM_PPC_CPU_CHAR_BCCTR_FLUSH_ASSIST, which is exposed to the QEMU guest
since QEMU commit 8ff43ee404d under a new sPAPR capability called
SPAPR_CAP_CCF_ASSIST. This cap indicates whether the processor supports
hardware acceleration for the count cache flush workaround, which
is a software workaround that flushes the count cache on context
switch. If the processor has this hardware acceleration, the software
flush can be shortened, resulting in performance gain.

This hardware acceleration is defaulted to 'off' in QEMU. The reason
is that earlier versions of the Power 9 processor didn't support
it (it is available on Power 9 DD2.3 and newer), and defaulting this
option to 'on' would break migration compatibility between the Power 9
processor class.

However, the user running a P9 DD2.3+ hypervisor might want to create
guests with ccf-assist=on, accepting the downside of only being able
to migrate them only between other P9 DD2.3+ hosts running upstream
kernel 5.1+, to get a performance boost.

This patch adds this new capability to Libvirt, with the name of
QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST.

Signed-off-by: Daniel Henrique Barboza 
---
 src/qemu/qemu_capabilities.c| 2 ++
 src/qemu/qemu_capabilities.h| 1 +
 tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 +
 3 files changed, 4 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 46a056340b..b73534c0d1 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -545,6 +545,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
   "incremental-backup",
   "query-cpu-model-baseline",
   "query-cpu-model-comparison",
+  "machine.pseries.cap-ccf-assist",
 );
 
 
@@ -1440,6 +1441,7 @@ static struct virQEMUCapsStringFlags 
virQEMUCapsMachinePropsPSeries[] = {
 { "cap-hpt-max-page-size", QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE 
},
 { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM },
 { "cap-nested-hv", QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV },
+{ "cap-ccf-assist", QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST },
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 72da3691f2..3da8e3d0f0 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -526,6 +526,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for 
syntax-check */
 QEMU_CAPS_INCREMENTAL_BACKUP, /* incremental backup is supported */
 QEMU_CAPS_QUERY_CPU_MODEL_BASELINE, /* qmp query-cpu-model-baseline */
 QEMU_CAPS_QUERY_CPU_MODEL_COMPARISON, /* qmp query-cpu-model-comparison */
+QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, /* -machine 
pseries.cap-ccf-assist */
 
 QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml 
b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml
index 9ea6f4d046..5edd2c1c31 100644
--- a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml
@@ -170,6 +170,7 @@
   
   
   
+  
   400
   0
   42900758
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH v2 0/3] Adding the 'ccf-assist' pSeries capability

2019-10-08 Thread Daniel Henrique Barboza
changes in v2:
- rebased with newer master (412cc0f403)
- changed the 'news' text to be in the v5.9.0 section

Hi,

This short series exposes, implements and documents a
pSeries guest capability called Count Cache Flush Assist
(ccf-assist), which was added in the Linux kernel since
5.1 and in QEMU since 4.0.0.

The reason why this capability needs to exposed via Libvirt
is because it is defaulted to 'off' in QEMU to not break
migration compatibility in the Power 9 processor class. However,
there is a performance gain in activating it, thus the user
might want to choose less migration options for more power.
More details can be found in the commit message of patch 1.


v1: https://www.redhat.com/archives/libvir-list/2019-September/msg00649.html

Daniel Henrique Barboza (3):
  qemu: Add capability for the ccf-assist pSeries feature
  qemu: Implement the ccf-assist pSeries feature
  news: Update for the ccf-assist pSeries feature

 docs/formatdomain.html.in |  9 +
 docs/news.xml |  9 +
 docs/schemas/domaincommon.rng |  5 +
 src/conf/domain_conf.c|  4 
 src/conf/domain_conf.h|  1 +
 src/qemu/qemu_capabilities.c  |  2 ++
 src/qemu/qemu_capabilities.h  |  1 +
 src/qemu/qemu_command.c   | 20 +++
 src/qemu/qemu_domain.c|  1 +
 .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml |  1 +
 tests/qemuxml2argvdata/pseries-features.args  |  2 +-
 tests/qemuxml2argvdata/pseries-features.xml   |  1 +
 tests/qemuxml2argvtest.c  |  1 +
 tests/qemuxml2xmloutdata/pseries-features.xml |  1 +
 tests/qemuxml2xmltest.c   |  1 +
 15 files changed, 58 insertions(+), 1 deletion(-)

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 0/2] Fix ppc64 CPU configuration for QEMU 2.11+

2019-10-08 Thread Ján Tomko

On Tue, Oct 08, 2019 at 02:53:08PM +0200, Jiri Denemark wrote:

The original fix was both incomplete and too general. It only fixed
domain startup, but libvirt would still report empty list of supported
CPU models with recent QEMU for ppc64. On the other hand, while ppc64
QEMU ignores case when looking up CPU model names, x86_64 QEMU does
case sensitive lookup.

Jiri Denemark (2):
 Revert "domcaps: Treat host models as case-insensitive strings"
 qemu: Adapt to changed ppc64 CPU model names

src/conf/domain_capabilities.c|  2 +-
src/qemu/qemu_capabilities.c  | 26 +--
src/qemu/qemu_capabilities.h  |  3 ++-
src/qemu/qemu_process.c   |  2 +-
.../qemu_2.12.0.ppc64.xml |  6 -
.../caps_2.12.0.ppc64.xml | 12 -
.../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 12 -
.../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 12 -
.../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 12 -
9 files changed, 57 insertions(+), 30 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 17/23] conf: convert over to use GRegex for regular expressions

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:19PM +0100, Daniel P. Berrangé wrote:

Reviewed-by: Pavel Hrdina 
Signed-off-by: Daniel P. Berrangé 
---
src/conf/domain_event.c | 25 ++---
1 file changed, 10 insertions(+), 15 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 16/23] libxl: convert over to use GRegex for regular expressions

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:18PM +0100, Daniel P. Berrangé wrote:

Reviewed-by: Pavel Hrdina 
Signed-off-by: Daniel P. Berrangé 
---
src/libxl/libxl_capabilities.c | 42 +++---
1 file changed, 19 insertions(+), 23 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 15/23] util: convert virIdentity class to use GObject

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:17PM +0100, Daniel P. Berrangé wrote:

Converting from virObject to GObject is reasonably straightforward,
as illustrated by this patch for virIdentity

In the header file

- Remove

typedef struct _virIdentity virIdentity

- Add

#define VIR_TYPE_IDENTITY virIdentity_get_type ()
G_DECLARE_FINAL_TYPE (virIdentity, virIdentity, VIR, IDENTITY, GObject);

  Which provides the typedef we just removed, and class
  declaration boilerplate and various other constants/macros.

In the source file

- Change 'virObject parent' to 'GObject parent' in the struct
- Remove the virClass variable and its initializing call
- Add

 G_DEFINE_TYPE(virIdentity, virIdentity, G_TYPE_OBJECT)

  which declares the instance & class constructor functions

- Add an impl of the instance & class constructors
  wiring up the finalize method to point to our dispose impl

In all files

- Replace VIR_AUTOUNREF(virIdentityPtr) with g_autoptr(virIdentity)

- Replace virObjectRef/Unref with g_object_ref/unref. Note
  the latter functions do *NOT* accept a NULL object where as
  libvirt's do. If you replace g_object_unref with g_clear_object
  it is NULL safe, but also clears the pointer.

Signed-off-by: Daniel P. Berrangé 
---
m4/virt-glib.m4  |  4 +--
src/qemu/qemu_process.c  |  4 +--
src/rpc/virnetserverclient.c | 10 +++
src/util/viridentity.c   | 57 ++--
src/util/viridentity.h   |  9 +++---
tests/viridentitytest.c  |  5 +---
6 files changed, 50 insertions(+), 39 deletions(-)

diff --git a/src/util/viridentity.c b/src/util/viridentity.c
index a24704b690..c6299a6b09 100644
--- a/src/util/viridentity.c
+++ b/src/util/viridentity.c
@@ -43,25 +43,29 @@
-static void virIdentityDispose(void *object)
+static void virIdentityFinalize(GObject *object)
{
-virIdentityPtr ident = object;
+virIdentityPtr ident = VIR_IDENTITY(object);

virTypedParamsFree(ident->params, ident->nparams);
+
+G_OBJECT_CLASS(virIdentity_parent_class)->finalize(object);
}


+


Extra whitespace


/*
 * Returns: 0 if not present, 1 if present, -1 on error
 */
diff --git a/src/util/viridentity.h b/src/util/viridentity.h
index 7513dd4e35..df658ea844 100644
--- a/src/util/viridentity.h
+++ b/src/util/viridentity.h
@@ -21,12 +21,13 @@

#pragma once

-#include "virobject.h"
+#include "internal.h"
+#include 

-typedef struct _virIdentity virIdentity;
-typedef virIdentity *virIdentityPtr;
+#define VIR_TYPE_IDENTITY virIdentity_get_type()


Consider not mixing camel case with snake case.


+G_DECLARE_FINAL_TYPE(virIdentity, virIdentity, VIR, IDENTITY, GObject);

-G_DEFINE_AUTOPTR_CLEANUP_FUNC(virIdentity, virObjectUnref);
+typedef virIdentity *virIdentityPtr;

virIdentityPtr virIdentityGetCurrent(void);
int virIdentitySetCurrent(virIdentityPtr ident);


Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 14/23] remote: convert methods using virIdentityPtr to auto free macros

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:16PM +0100, Daniel P. Berrangé wrote:

Signed-off-by: Daniel P. Berrangé 
---
src/remote/remote_daemon.c  |  3 +--
src/remote/remote_daemon_dispatch.c | 35 ++---
2 files changed, 13 insertions(+), 25 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 13/23] rpc: convert methods using virIdentityPtr to auto free macros

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:15PM +0100, Daniel P. Berrangé wrote:

Signed-off-by: Daniel P. Berrangé 
---
src/rpc/virnetserverclient.c   | 47 ++
src/rpc/virnetserverprogram.c  | 13 +++---
tests/virnetserverclienttest.c |  3 +--
3 files changed, 23 insertions(+), 40 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 12/23] admin: convert admin server code to use auto free macros

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:14PM +0100, Daniel P. Berrangé wrote:

Signed-off-by: Daniel P. Berrangé 
---
src/admin/admin_server.c | 204 ---
1 file changed, 85 insertions(+), 119 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 0/7] security: apparmor: prep for qcow2 data_file

2019-10-08 Thread Cole Robinson

On 10/8/19 12:22 PM, Cole Robinson wrote:

This series does some preparation cleanup and refactoring to
simplify adding qcow2 data_file support to the apparmor driver.
More info on the qcow2 feature and libvirt work here:
https://www.redhat.com/archives/libvir-list/2019-October/msg00303.html



Should have mentioned here: I found apparmor libs/devel packages for 
fedora, so this is compile tested but not runtime tested. Help with that 
appreciated.


virt-aa-helper-test doesn't seem to regress, but it is failing for me on 
master before these patches:


./virt-aa-helper-test
ls: cannot access '/boot/initrd*': No such file or directory
Skipping /boot/initrd* tests. Could not find /boot/initrd*
FAIL: exited with '1'
  OVMF (new path):  '--dryrun -r -u 
libvirt-----0123456789ab':

FAIL: exited with '1'
  AAVMF:  '--dryrun -r -u libvirt-----0123456789ab':
FAIL: exited with '1'
  AAVMF32:  '--dryrun -r -u libvirt-----0123456789ab':

- Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 00/30] storagefile, security: qcow2 data_file support

2019-10-08 Thread Cole Robinson

On 10/8/19 1:52 AM, Christian Ehrhardt wrote:

On Mon, Oct 7, 2019 at 11:49 PM Cole Robinson  wrote:


This series is the first steps to teaching libvirt about qcow2
data_file support, aka external data files or qcow2 external metadata.

A bit about the feature: it was added in qemu 4.0. It essentially
creates a two part image file: a qcow2 layer that just tracks the
image metadata, and a separate data file which is stores the VM
disk contents. AFAICT the driving use case is to keep a fully coherent
raw disk image on disk, and only use qcow2 as an intermediate metadata
layer when necessary, for things like incremental backup support.

The original qemu patch posting is here:
https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg07496.html

For testing, you can create a new qcow2+raw data_file image from an
existing image, like:

 qemu-img convert -O qcow2 \
 -o data_file=NEW.raw,data_file_raw=yes
 EXISTING.raw NEW.qcow2

The goal of this series is to teach libvirt enough about this case
so that we can correctly relabel the data_file on VM startup/shutdown.
The main functional changes are

   * Teach storagefile how to parse out data_file from the qcow2 header
   * Store the raw string as virStorageSource->externalDataStoreRaw
   * Track that as its out virStorageSource in externalDataStore
   * dac/selinux relabel externalDataStore as needed

>From libvirt's perspective, externalDataStore is conceptually pretty
close to a backingStore, but the main difference is its read/write
permissions should match its parent image, rather than being readonly
like backingStore.

This series has only been tested on top of the -blockdev enablement
series, but I don't think it actually interacts with that work at
the moment.


Future work:
   * Exposing this in the runtime XML. We need to figure out an XML
 schema. It will reuse virStorageSource obviously, but the main
 thing to figure out is probably 1) what the top element name
 should be ('dataFile' maybe?), 2) where it sits in the XML
 hierarchy (under  or under  I guess)

   * Exposing this on the qemu -blockdev command line. Similar to how
 in the blockdev world we are explicitly putting the disk backing
 chain on the command line, we can do that for data_file too. Then
 like persistent  XML the user will have the power
 to overwrite the data_file location for an individual VM run.

   * Figure out how we expect ovirt/rhev to be using this at runtime.
 Possibly taking a running VM using a raw image, doing blockdev-*
 magic to pivot it to qcow2+raw data_file, so it can initiate
 incremental backup on top of a previously raw only VM?


Known issues:
   * In the qemu driver, the qcow2 image metadata is only parsed
 in -blockdev world if no  is specified in the
 persistent XML. So basically if there's a  listed,
 we never parse the qcow2 header and detect the presence of
 data_file. Fixable I'm sure but I didn't look into it much yet.

Most of this is cleanups and refactorings to simplify the actual
functional changes.

Cole Robinson (30):
   storagefile: Make GetMetadataInternal static
   storagefile: qcow1: Check for BACKING_STORE_OK
   storagefile: qcow1: Fix check for empty backing file
   storagefile: qcow1: Let qcowXGetBackingStore fill in format
   storagefile: Check version to determine if qcow2 or not
   storagefile: Drop now unused isQCow2 argument
   storagefile: Use qcowXGetBackingStore directly
   storagefile: Push 'start' into qcow2GetBackingStoreFormat
   storagefile: Push extension_end calc to qcow2GetBackingStoreFormat
   storagefile: Rename qcow2GetBackingStoreFormat
   storagefile: Rename qcow2GetExtensions 'format' argument
   storagefile: Fix backing format \0 check
   storagefile: Add externalDataStoreRaw member
   storagefile: Parse qcow2 external data file
   storagefile: Fill in meta->externalDataStoreRaw
   storagefile: Don't access backingStoreRaw directly in
 FromBackingRelative
   storagefile: Split out virStorageSourceNewFromChild
   storagefile: Add externalDataStore member
   storagefile: Fill in meta->externalDataStore
   security: dac: Drop !parent handling in SetImageLabelInternal
   security: dac: Add is_toplevel to SetImageLabelInternal
   security: dac: Restore image label for externalDataStore
   security: dac: break out SetImageLabelRelative
   security: dac: Label externalDataStore
   security: selinux: Simplify SetImageLabelInternal
   security: selinux: Drop !parent handling in SetImageLabelInternal
   security: selinux: Add is_toplevel to SetImageLabelInternal
   security: selinux: Restore image label for externalDataStore
   security: selinux: break out SetImageLabelRelative
   security: selinux: Label externalDataStore


Hi Cole,
it seems the changes to dac/selinux follow a common pattern, in the
past those changes then mostly applied to security-apparmor as well.
Are you going to add patches for that security backend as well before
this i

[libvirt] [PATCH 7/7] security: apparmor: Make storage_source_add_files recursively callable

2019-10-08 Thread Cole Robinson
This will simplify adding support for qcow2 external data_file

Signed-off-by: Cole Robinson 
---
 src/security/virt-aa-helper.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index b675572144..d9f6b5638b 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -939,9 +939,9 @@ add_file_path(virStorageSourcePtr src,
 
 static int
 storage_source_add_files(virStorageSourcePtr src,
- virBufferPtr buf)
+ virBufferPtr buf,
+ size_t depth)
 {
-size_t depth = 0;
 virStorageSourcePtr tmp;
 
 for (tmp = src; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) {
@@ -994,7 +994,7 @@ get_files(vahControl * ctl)
 
  /* XXX should handle open errors more careful than just ignoring them.
  */
-if (storage_source_add_files(disk->src, &buf) < 0)
+if (storage_source_add_files(disk->src, &buf, 0) < 0)
 goto cleanup;
 }
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 0/7] security: apparmor: prep for qcow2 data_file

2019-10-08 Thread Cole Robinson
This series does some preparation cleanup and refactoring to
simplify adding qcow2 data_file support to the apparmor driver.
More info on the qcow2 feature and libvirt work here:
https://www.redhat.com/archives/libvir-list/2019-October/msg00303.html

Cole Robinson (7):
  conf: Move -virDomainDiskDefForeachPath to virt-aa-helper
  security: apparmor: Remove unused ignoreOpenFailure
  security: apparmor: Drop disk_foreach_iterator
  security: apparmor: Pass virStorageSource to add_file_path
  security: apparmor: Push virStorageSource checks to add_file_path
  security: apparmor: Use only virStorageSource for disk paths
  security: apparmor: Make storage_source_add_files recursively callable

 src/conf/domain_conf.c| 42 --
 src/conf/domain_conf.h| 10 
 src/libvirt_private.syms  |  1 -
 src/security/virt-aa-helper.c | 43 ---
 4 files changed, 30 insertions(+), 66 deletions(-)

-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 2/7] security: apparmor: Remove unused ignoreOpenFailure

2019-10-08 Thread Cole Robinson
true is always passed here, so delete the unused code path and
adjust the associated comment

Signed-off-by: Cole Robinson 
---
 src/security/virt-aa-helper.c | 25 +++--
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 6e358ff5b6..511443dd3e 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -943,30 +943,14 @@ typedef int (*disk_foreach_iterator)(virDomainDiskDefPtr 
disk,
 
 /* Call iter(disk, name, depth, opaque) for each element of disk and
  * its backing chain in the pre-populated disk->src.backingStore.
- * ignoreOpenFailure determines whether to warn about a chain that
- * mentions a backing file without also having metadata on that
- * file.  */
+ */
 static int
 disk_foreach_path(virDomainDiskDefPtr disk,
-  bool ignoreOpenFailure,
   disk_foreach_iterator iter,
   void *opaque)
 {
 size_t depth = 0;
 virStorageSourcePtr tmp;
-VIR_AUTOFREE(char *) brokenRaw = NULL;
-
-if (!ignoreOpenFailure) {
-if (virStorageFileChainGetBroken(disk->src, &brokenRaw) < 0)
-return -1;
-
-if (brokenRaw) {
-virReportError(VIR_ERR_INTERNAL_ERROR,
-   _("unable to visit backing chain file %s"),
-   brokenRaw);
-return -1;
-}
-}
 
 for (tmp = disk->src; virStorageSourceIsBacking(tmp); tmp = 
tmp->backingStore) {
 /* execute the callback only for local storage */
@@ -1020,12 +1004,9 @@ get_files(vahControl * ctl)
 if (!virStorageSourceHasBacking(disk->src))
 virStorageFileGetMetadata(disk->src, -1, -1, false);
 
-/* XXX passing ignoreOpenFailure = true to get back to the behavior
- * from before using virDomainDiskDefForeachPath. actually we should
- * be passing ignoreOpenFailure = false and handle open errors more
- * careful than just ignoring them.
+ /* XXX should handle open errors more careful than just ignoring them.
  */
-if (disk_foreach_path(disk, true, add_file_path, &buf) < 0)
+if (disk_foreach_path(disk, add_file_path, &buf) < 0)
 goto cleanup;
 }
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 3/7] security: apparmor: Drop disk_foreach_iterator

2019-10-08 Thread Cole Robinson
There's only one caller, so open code the file_add_path behavior

Signed-off-by: Cole Robinson 
---
 src/security/virt-aa-helper.c | 21 +
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 511443dd3e..7148e3c760 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -914,9 +914,8 @@ static int
 add_file_path(virDomainDiskDefPtr disk,
   const char *path,
   size_t depth,
-  void *opaque)
+  virBufferPtr buf)
 {
-virBufferPtr buf = opaque;
 int ret;
 
 if (depth == 0) {
@@ -935,19 +934,9 @@ add_file_path(virDomainDiskDefPtr disk,
 }
 
 
-typedef int (*disk_foreach_iterator)(virDomainDiskDefPtr disk,
- const char *path,
- size_t depth,
- void *opaque);
-
-
-/* Call iter(disk, name, depth, opaque) for each element of disk and
- * its backing chain in the pre-populated disk->src.backingStore.
- */
 static int
-disk_foreach_path(virDomainDiskDefPtr disk,
-  disk_foreach_iterator iter,
-  void *opaque)
+disk_add_files(virDomainDiskDefPtr disk,
+   virBufferPtr buf)
 {
 size_t depth = 0;
 virStorageSourcePtr tmp;
@@ -956,7 +945,7 @@ disk_foreach_path(virDomainDiskDefPtr disk,
 /* execute the callback only for local storage */
 if (virStorageSourceIsLocalStorage(tmp) &&
 tmp->path) {
-if (iter(disk, tmp->path, depth, opaque) < 0)
+if (add_file_path(disk, tmp->path, depth, buf) < 0)
 return -1;
 }
 
@@ -1006,7 +995,7 @@ get_files(vahControl * ctl)
 
  /* XXX should handle open errors more careful than just ignoring them.
  */
-if (disk_foreach_path(disk, add_file_path, &buf) < 0)
+if (disk_add_files(disk, &buf) < 0)
 goto cleanup;
 }
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 6/7] security: apparmor: Use only virStorageSource for disk paths

2019-10-08 Thread Cole Robinson
This is closer to what security_selinux.c does, and will help add
support for qcow2 external data_files

Signed-off-by: Cole Robinson 
---
 src/security/virt-aa-helper.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 20281c38b7..b675572144 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -938,13 +938,13 @@ add_file_path(virStorageSourcePtr src,
 
 
 static int
-disk_add_files(virDomainDiskDefPtr disk,
-   virBufferPtr buf)
+storage_source_add_files(virStorageSourcePtr src,
+ virBufferPtr buf)
 {
 size_t depth = 0;
 virStorageSourcePtr tmp;
 
-for (tmp = disk->src; virStorageSourceIsBacking(tmp); tmp = 
tmp->backingStore) {
+for (tmp = src; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) {
 if (add_file_path(tmp, depth, buf) < 0)
 return -1;
 
@@ -994,7 +994,7 @@ get_files(vahControl * ctl)
 
  /* XXX should handle open errors more careful than just ignoring them.
  */
-if (disk_add_files(disk, &buf) < 0)
+if (storage_source_add_files(disk->src, &buf) < 0)
 goto cleanup;
 }
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 5/7] security: apparmor: Push virStorageSource checks to add_file_path

2019-10-08 Thread Cole Robinson
This mirrors the code layout in security_selinux.c. It will also make
it easier to share the checks for qcow2 external data_file support
eventually

Signed-off-by: Cole Robinson 
---
 src/security/virt-aa-helper.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 9f39eb2e2b..20281c38b7 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -917,6 +917,10 @@ add_file_path(virStorageSourcePtr src,
 {
 int ret;
 
+/* execute the callback only for local storage */
+if (!src->path || !virStorageSourceIsLocalStorage(src))
+return 0;
+
 if (depth == 0) {
 if (src->readonly)
 ret = vah_add_file(buf, src->path, "rk");
@@ -941,12 +945,8 @@ disk_add_files(virDomainDiskDefPtr disk,
 virStorageSourcePtr tmp;
 
 for (tmp = disk->src; virStorageSourceIsBacking(tmp); tmp = 
tmp->backingStore) {
-/* execute the callback only for local storage */
-if (virStorageSourceIsLocalStorage(tmp) &&
-tmp->path) {
-if (add_file_path(tmp, depth, buf) < 0)
-return -1;
-}
+if (add_file_path(tmp, depth, buf) < 0)
+return -1;
 
 depth++;
 }
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 1/7] conf: Move -virDomainDiskDefForeachPath to virt-aa-helper

2019-10-08 Thread Cole Robinson
It is the only user. Rename it to match the local style

Signed-off-by: Cole Robinson 
---
 src/conf/domain_conf.c| 42 -
 src/conf/domain_conf.h| 10 ---
 src/libvirt_private.syms  |  1 -
 src/security/virt-aa-helper.c | 50 ++-
 4 files changed, 49 insertions(+), 54 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a53cd6a725..5fe03ea866 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -29486,48 +29486,6 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def,
 }
 
 
-/* Call iter(disk, name, depth, opaque) for each element of disk and
- * its backing chain in the pre-populated disk->src.backingStore.
- * ignoreOpenFailure determines whether to warn about a chain that
- * mentions a backing file without also having metadata on that
- * file.  */
-int
-virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
-bool ignoreOpenFailure,
-virDomainDiskDefPathIterator iter,
-void *opaque)
-{
-size_t depth = 0;
-virStorageSourcePtr tmp;
-VIR_AUTOFREE(char *) brokenRaw = NULL;
-
-if (!ignoreOpenFailure) {
-if (virStorageFileChainGetBroken(disk->src, &brokenRaw) < 0)
-return -1;
-
-if (brokenRaw) {
-virReportError(VIR_ERR_INTERNAL_ERROR,
-   _("unable to visit backing chain file %s"),
-   brokenRaw);
-return -1;
-}
-}
-
-for (tmp = disk->src; virStorageSourceIsBacking(tmp); tmp = 
tmp->backingStore) {
-/* execute the callback only for local storage */
-if (virStorageSourceIsLocalStorage(tmp) &&
-tmp->path) {
-if (iter(disk, tmp->path, depth, opaque) < 0)
-return -1;
-}
-
-depth++;
-}
-
-return 0;
-}
-
-
 /* Copy src into a new definition; with the quality of the copy
  * depending on the migratable flag (false for transitions between
  * persistent and active, true for transitions across save files or
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 2884af49d8..653dcaf2bc 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3327,11 +3327,6 @@ int virDomainChrDefForeach(virDomainDefPtr def,
virDomainChrDefIterator iter,
void *opaque);
 
-typedef int (*virDomainDiskDefPathIterator)(virDomainDiskDefPtr disk,
-const char *path,
-size_t depth,
-void *opaque);
-
 typedef int (*virDomainUSBDeviceDefIterator)(virDomainDeviceInfoPtr info,
  void *opaque);
 int virDomainUSBDeviceDefForeach(virDomainDefPtr def,
@@ -3339,11 +3334,6 @@ int virDomainUSBDeviceDefForeach(virDomainDefPtr def,
  void *opaque,
  bool skipHubs);
 
-int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
-bool ignoreOpenFailure,
-virDomainDiskDefPathIterator iter,
-void *opaque);
-
 void
 virDomainObjSetState(virDomainObjPtr obj, virDomainState state, int reason)
 ATTRIBUTE_NONNULL(1);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index c818bc807a..5949cba08d 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -334,7 +334,6 @@ virDomainDiskCacheTypeFromString;
 virDomainDiskCacheTypeToString;
 virDomainDiskDefAssignAddress;
 virDomainDiskDefCheckDuplicateInfo;
-virDomainDiskDefForeachPath;
 virDomainDiskDefFree;
 virDomainDiskDefNew;
 virDomainDiskDefParse;
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 5853ad985f..6e358ff5b6 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -934,6 +934,54 @@ add_file_path(virDomainDiskDefPtr disk,
 return ret;
 }
 
+
+typedef int (*disk_foreach_iterator)(virDomainDiskDefPtr disk,
+ const char *path,
+ size_t depth,
+ void *opaque);
+
+
+/* Call iter(disk, name, depth, opaque) for each element of disk and
+ * its backing chain in the pre-populated disk->src.backingStore.
+ * ignoreOpenFailure determines whether to warn about a chain that
+ * mentions a backing file without also having metadata on that
+ * file.  */
+static int
+disk_foreach_path(virDomainDiskDefPtr disk,
+  bool ignoreOpenFailure,
+  disk_foreach_iterator iter,
+  void *opaque)
+{
+size_t depth = 0;
+virStorageSourcePtr tmp;
+VIR_AUTOFREE(char *) brokenRaw = NULL;
+
+if (!ignoreOpenFailure) {
+if (virStorageFileChainGetBroken(di

[libvirt] [PATCH 4/7] security: apparmor: Pass virStorageSource to add_file_path

2019-10-08 Thread Cole Robinson
The virStorageSource must have everything it needs

Signed-off-by: Cole Robinson 
---
 src/security/virt-aa-helper.c | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 7148e3c760..9f39eb2e2b 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -911,20 +911,19 @@ file_iterate_pci_cb(virPCIDevicePtr dev ATTRIBUTE_UNUSED,
 }
 
 static int
-add_file_path(virDomainDiskDefPtr disk,
-  const char *path,
+add_file_path(virStorageSourcePtr src,
   size_t depth,
   virBufferPtr buf)
 {
 int ret;
 
 if (depth == 0) {
-if (disk->src->readonly)
-ret = vah_add_file(buf, path, "rk");
+if (src->readonly)
+ret = vah_add_file(buf, src->path, "rk");
 else
-ret = vah_add_file(buf, path, "rwk");
+ret = vah_add_file(buf, src->path, "rwk");
 } else {
-ret = vah_add_file(buf, path, "rk");
+ret = vah_add_file(buf, src->path, "rk");
 }
 
 if (ret != 0)
@@ -945,7 +944,7 @@ disk_add_files(virDomainDiskDefPtr disk,
 /* execute the callback only for local storage */
 if (virStorageSourceIsLocalStorage(tmp) &&
 tmp->path) {
-if (add_file_path(disk, tmp->path, depth, buf) < 0)
+if (add_file_path(tmp, depth, buf) < 0)
 return -1;
 }
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [jenkins-ci PATCH v2 12/12] Switch libvirt-dbus to Meson

2019-10-08 Thread Andrea Bolognani
On Tue, 2019-10-08 at 09:58 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/playbooks/build/projects/libvirt-dbus.yml
>vars:
>  # flake8 and pyflakes versions available on FreeBSD (3.5.0 and 2.0.0
> -# respectively) are not compatible
> +# respectively) are not compatible.
> +# Python3 version in Ubuntu 16.04 and python3-pytest version
> +# in CentOS 7 are too old

[...]

> +++ b/jenkins/projects/libvirt-dbus.yaml
> @@ -6,30 +6,24 @@
> +  - meson-check-job:
>parent_jobs: 'libvirt-dbus-build'
># flake8 and pyflakes versions currently available on FreeBSD
># (3.5.0 and 2.0.0 respectively) are not compatible.
> +  # pytest version is CentOS 7 is too old.

Make sure the comments match.

With that fixed, and with the obvious caveat that we'll have to
coordinate with Pavel so that this is merged at the same time as the
libvirt-dbus patches,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH v2 11/12] libvirt-dbus: Remove misleading comment

2019-10-08 Thread Andrea Bolognani
On Tue, 2019-10-08 at 09:58 +0200, Fabiano Fidêncio wrote:
> +++ b/jenkins/projects/libvirt-dbus.yaml
> @@ -21,8 +21,7 @@
>  - libvirt-fedora-rawhide
>- autotools-check-job:
>parent_jobs: 'libvirt-dbus-syntax-check'
> -  # Python 3 version in Ubuntu 16.04 and python3-pytest version
> -  # in CentOS 7 are too old
> +  # python3-pytest version in CentOS 7 is too old

We want the Ansible and Jenkins parts to be as close as possible,
even when that means a comment or two are not accurate.

NACK

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH v2 09/12] virt-manager: Build again on Debian9 and Ubuntu18

2019-10-08 Thread Andrea Bolognani
On Tue, 2019-10-08 at 09:58 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/host_vars/libvirt-centos-7/main.yml
> @@ -10,6 +10,7 @@ projects:
>- libvirt-python
>- osinfo-db
>- osinfo-db-tools
> +  - virt-manager
>- virt-viewer

This hunk...

> +++ b/guests/host_vars/libvirt-ubuntu-16/main.yml
> @@ -13,6 +13,7 @@ projects:
>- libvirt-tck
>- osinfo-db
>- osinfo-db-tools
> +  - virt-manager
>- virt-viewer

and this one are incorrect: we still can't build virt-manager on
CentOS 7 and Ubuntu 16.04. Please drop them.

> +++ b/guests/playbooks/build/projects/virt-manager.yml
> @@ -5,6 +5,7 @@
>  # virt-manager is Python 3 only, so it can't be built on CentOS 7;
>  # Ubuntu 16.04 has Python 3 but not the libxml2 bindings, so it can't
>  # build the project either
>  machines:
> +  - libvirt-debian-9
>- libvirt-debian-10
>- libvirt-debian-sid
>- libvirt-fedora-29

The comment should be updated, as the motivation for not building
virt-manager is the same for both CentOS 7 and Ubuntu 16.04 now.

With these issues addressed,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH v2 10/12] libvirt-dbus: Take advantage of Python 3 on CentOS 7

2019-10-08 Thread Andrea Bolognani
On Tue, 2019-10-08 at 09:58 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/playbooks/build/projects/libvirt-dbus.yml
> @@ -9,10 +9,10 @@
>  - include: '{{ playbook_base }}/jobs/autotools-build-job.yml'
>  - include: '{{ playbook_base }}/jobs/autotools-syntax-check-job.yml'
>vars:
> -# CentOS 7 doesn't include Python 3, while the versions of flake8
> -# and pyflakes currently available on FreeBSD (3.5.0 and 2.0.0
> +# flake8 and pyflakes versions available on FreeBSD (3.5.0 and 2.0.0
>  # respectively) are not compatible

This comment...

> +++ b/jenkins/projects/libvirt-dbus.yaml
> @@ -10,10 +10,10 @@
>parent_jobs: 'libvirt-glib-build'
>- autotools-syntax-check-job:
>parent_jobs: 'libvirt-dbus-build'
> -  # CentOS 7 doesn't include Python 3, while the versions of flake8
> -  # and pyflakes currently available on FreeBSD (3.5.0 and 2.0.0
> -  # respectively) are not compatible
> +  # flake8 and pyflakes versions currently available on FreeBSD
> +  # (3.5.0 and 2.0.0 respectively) are not compatible.

... and this one don't match. Make sure they do.

With that fixed,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH v2 05/12] guests: Install meson via pip

2019-10-08 Thread Andrea Bolognani
On Tue, 2019-10-08 at 09:58 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/lcitool
>  pkg_align = " \\\n" + (" " * len("RUN " + package_manager + " "))
> +pip_pkg_align = " \\\n" + (" " * len("RUN pip3 install "))

s/pip3 install /pip3 /

> +if pip_pkgs:
> +sys.stdout.write(textwrap.dedent("""
> +RUN pip3 install {pip_pkgs}
> +""").format(**varmap))
> +

For cross Dockerfiles, this results in ENV directives being generated
in between RUN directives, which is kinda messy. Please shuffle stuff
around so that you avoid that.

> +++ b/guests/playbooks/update/tasks/packages.yml
> +- name: '{{ project }}: Verify pip mappings'
> +  fail:
> +msg: 'No mappings defined for {{ item }}'
> +  with_items:
> +'{{ packages }}'
> +  when:
> +- pip_mappings[item] is undefined and mappings[item] is undefined

This can be just

  when:
- pip_mappings[item] is undefined

since we checked the other part earlier.

> +- set_fact:
> +pip_executable: pip3

You use this only once... No need to define a fact for it.

> +- name: '{{ project }}: Install packages from pip'
> +  pip:
> +name: '{{ pip_temp[item] }}'
> +executable: '{{ pip_executable }}'
> +state: '{{ state }}'
> +  with_items:
> +'{{ packages }}'
> +  when:
> +- temp[item] is defined
> +- temp[item] == None
> +- pip_temp[item] is defined
> +- pip_temp[item] != None

I would flatten and sort the list before acting on it, same as we do
for native packages.

> +++ b/guests/vars/mappings.yml
> +pip_mappings:
> +
> +  meson:
> +default: meson==0.49.0

Please add a comment explaining how these mappings differ from the
native ones.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH v2 08/12] libosinfo: Build again on all machines

2019-10-08 Thread Andrea Bolognani
On Tue, 2019-10-08 at 09:58 +0200, Fabiano Fidêncio wrote:
> As now we've the needed packages for building and testing libosinfo
> on all systems supported by libvirt-jenkins-ci, let's build libosinfo
> everywhere.
> 
> RPM build is still not possible in CentOS7 as it doesn't have the
> needed RPM macros for Meson.
> 
> Signed-off-by: Fabiano Fidêncio 
> ---
>  guests/host_vars/libvirt-centos-7/main.yml|  1 +
>  guests/host_vars/libvirt-debian-9/main.yml|  1 +
>  guests/host_vars/libvirt-ubuntu-16/main.yml   |  1 +
>  guests/host_vars/libvirt-ubuntu-18/main.yml   |  1 +
>  guests/playbooks/build/projects/libosinfo.yml | 14 +++---
>  jenkins/projects/libosinfo.yaml   | 10 +++---
>  6 files changed, 10 insertions(+), 18 deletions(-)

Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH v2 07/12] osinfo-db: Build again on all machines

2019-10-08 Thread Andrea Bolognani
On Tue, 2019-10-08 at 09:58 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/playbooks/build/projects/osinfo-db.yml
> @@ -21,14 +21,12 @@
>$MAKE install OSINFO_DB_TARGET="--system"
>  - include: '{{ playbook_base }}/jobs/generic-check-job.yml'
>vars:
> +machines: '{{ all_machines }}'
>  command: |
>$MAKE check

These changes are not correct: you got it right...

> +++ b/jenkins/projects/osinfo-db.yaml
> @@ -1,13 +1,7 @@
>  ---
>  - project:
>  name: osinfo-db
> -machines:
> -  - libvirt-debian-10
> -  - libvirt-fedora-29
> -  - libvirt-fedora-30
> -  - libvirt-fedora-rawhide
> -  - libvirt-freebsd-11
> -  - libvirt-freebsd-12
> +machines: '{all_machines}'

... in the Jenkins part, so just do the same thing in the Ansible
part too.

With that fixed,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH v2 5/5] build: merge all syntax-check logic into one file

2019-10-08 Thread Daniel P . Berrangé
The gnulib syntax-check rules are spread across GNUmakefile, cfg.mk and
maint.mk. This made sense when we were getting two of the files from the
gnulib submodule. Now that we own all files though, we can at least
merge maint.mk and cfg.mk together. GNUmakefile can be eliminated when
we switch to meson.

Signed-off-by: Daniel P. Berrangé 
---
 GNUmakefile   |6 +-
 Makefile.am   |3 +-
 build-aux/maint.mk| 1036 
 build-aux/{cfg.mk => syntax-check.mk} | 1071 -
 4 files changed, 1049 insertions(+), 1067 deletions(-)
 delete mode 100644 build-aux/maint.mk
 rename build-aux/{cfg.mk => syntax-check.mk} (53%)

diff --git a/GNUmakefile b/GNUmakefile
index 288794ca25..78d06751f6 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -35,8 +35,7 @@ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
 ALL_RECURSIVE_TARGETS =
 
 include Makefile
-include $(srcdir)/$(_build-aux)/cfg.mk
-include $(srcdir)/$(_build-aux)/maint.mk
+include $(srcdir)/$(_build-aux)/syntax-check.mk
 
 else
 
@@ -44,8 +43,7 @@ else
 srcdir = .
 
 # The package can override .DEFAULT_GOAL to run actions like autoreconf.
-include $(srcdir)/$(_build-aux)/cfg.mk
-include $(srcdir)/$(_build-aux)/maint.mk
+include $(srcdir)/$(_build-aux)/syntax-check.mk
 
 ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
 $(MAKECMDGOALS): abort-due-to-no-makefile
diff --git a/Makefile.am b/Makefile.am
index a569a4260a..53f694840b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,13 +46,12 @@ EXTRA_DIST = \
   README.md \
   AUTHORS.in \
   build-aux/augeas-gentest.pl \
-  build-aux/cfg.mk \
   build-aux/check-spacing.pl \
   build-aux/header-ifdef.pl \
-  build-aux/maint.mk \
   build-aux/minimize-po.pl \
   build-aux/mock-noinline.pl \
   build-aux/prohibit-duplicate-header.pl \
+  build-aux/syntax-check.mk \
   build-aux/useless-if-before-free \
   build-aux/vc-list-files \
   ci/Makefile \
diff --git a/build-aux/maint.mk b/build-aux/maint.mk
deleted file mode 100644
index 45ef6f03c2..00
--- a/build-aux/maint.mk
+++ /dev/null
@@ -1,1036 +0,0 @@
-# -*-Makefile-*-
-# This Makefile fragment tries to be general-purpose enough to be
-# used by many projects via the gnulib maintainer-makefile module.
-
-## Copyright (C) 2001-2019 Free Software Foundation, Inc.
-##
-## This program is free software: you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation, either version 3 of the License, or
-## (at your option) any later version.
-##
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see .
-
-# This is reported not to work with make-3.79.1
-# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
-ME := $(_build-aux)/maint.mk
-
-# These variables ought to be defined through the configure.ac section
-# of the module description. But some packages import this file directly,
-# ignoring the module description.
-AWK ?= awk
-GREP ?= grep
-SED ?= sed
-
-# Helper variables.
-_empty =
-_sp = $(_empty) $(_empty)
-
-# _equal,S1,S2
-# 
-# If S1 == S2, return S1, otherwise the empty string.
-_equal = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))
-
-GIT = git
-VC = $(GIT)
-
-VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir)
-
-# You can override this variable in cfg.mk if your gnulib submodule lives
-# in a different location.
-gnulib_dir ?= $(srcdir)/gnulib
-
-# You can override this variable in cfg.mk to set your own regexp
-# matching files to ignore.
-VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
-
-# This is to preprocess robustly the output of $(VC_LIST), so that even
-# when $(srcdir) is a pathological name like "", the leading sed command
-# removes only the intended prefix.
-_dot_escaped_srcdir = $(subst .,\.,$(srcdir))
-
-# Post-process $(VC_LIST) output, prepending $(srcdir)/, but only
-# when $(srcdir) is not ".".
-ifeq ($(srcdir),.)
-  _prepend_srcdir_prefix =
-else
-  _prepend_srcdir_prefix = | $(SED) 's|^|$(srcdir)/|'
-endif
-
-# In order to be able to consistently filter "."-relative names,
-# (i.e., with no $(srcdir) prefix), this definition is careful to
-# remove any $(srcdir) prefix, and to restore what it removes.
-_sc_excl = \
-  $(or $(exclude_file_name_regexp--$@),^$$)
-VC_LIST_EXCEPT = \
-  $(VC_LIST) | $(SED) 's|^$(_dot_escaped_srcdir)/||' \
-   | if test -f $(srcdir)/.x-$@; then $(GREP) -vEf $(srcdir)/.x-$@; \
- else $(GREP) -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
-   | $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
-   $(_prepend_srcdi

[libvirt] [PATCH v2 4/5] build: delete all syntax check rules we're skipping

2019-10-08 Thread Daniel P . Berrangé
If we've marked rules as skipped, there's no sense keeping them in the
maint.mk file.

Signed-off-by: Daniel P. Berrangé 
---
 build-aux/cfg.mk   |  38 ---
 build-aux/maint.mk | 245 -
 2 files changed, 283 deletions(-)

diff --git a/build-aux/cfg.mk b/build-aux/cfg.mk
index 3add2b7e94..2252f4a939 100644
--- a/build-aux/cfg.mk
+++ b/build-aux/cfg.mk
@@ -31,44 +31,6 @@ generated_files = \
 # We haven't converted all scripts to using gnulib's init.sh yet.
 _test_script_regex = \<\(init\|test-lib\)\.sh\>
 
-# Tests not to run as part of "make distcheck".
-local-checks-to-skip = \
-  changelog-check \
-  makefile-check \
-  makefile_path_separator_check \
-  patch-check \
-  sc_GPL_version \
-  sc_always_defined_macros \
-  sc_cast_of_alloca_return_value \
-  sc_cross_check_PATH_usage_in_tests \
-  sc_dd_max_sym_length \
-  sc_error_exit_success \
-  sc_file_system \
-  sc_immutable_NEWS \
-  sc_makefile_path_separator_check \
-  sc_obsolete_symbols \
-  sc_prohibit_S_IS_definition \
-  sc_prohibit_atoi_atof \
-  sc_prohibit_gnu_make_extensions \
-  sc_prohibit_hash_without_use \
-  sc_prohibit_jm_in_m4 \
-  sc_prohibit_quote_without_use \
-  sc_prohibit_quotearg_without_use \
-  sc_prohibit_stat_st_blocks \
-  sc_prohibit_undesirable_word_seq \
-  sc_root_tests \
-  sc_space_tab \
-  sc_sun_os_names \
-  sc_system_h_headers \
-  sc_texinfo_acronym \
-  sc_tight_scope \
-  sc_two_space_separator_in_usage \
-  sc_error_message_uppercase \
-  sc_program_name \
-  sc_require_test_exit_idiom \
-  sc_makefile_check \
-  sc_useless_cpp_parens
-
 # Most developers don't run 'make distcheck'.  We want the official
 # dist to be secure, but don't want to penalize other developers
 # using a distro that has not yet picked up the automake fix.
diff --git a/build-aux/maint.mk b/build-aux/maint.mk
index 9467815711..45ef6f03c2 100644
--- a/build-aux/maint.mk
+++ b/build-aux/maint.mk
@@ -285,24 +285,6 @@ sc_cast_of_x_alloc_return_value:
halt="don't cast x*alloc return value"  \
  $(_sc_search_regexp)
 
-sc_cast_of_alloca_return_value:
-   @prohibit='\*\) *alloca\>'  \
-   halt="don't cast alloca return value"   \
- $(_sc_search_regexp)
-
-sc_space_tab:
-   @prohibit='[ ]  '   \
-   halt='found SPACE-TAB sequence; remove the SPACE'   \
- $(_sc_search_regexp)
-
-# Don't use *scanf or the old ato* functions in "real" code.
-# They provide no error checking mechanism.
-# Instead, use strto* functions.
-sc_prohibit_atoi_atof:
-   @prohibit='\<([fs]?scanf|ato([filq]|ll)) *\('   
\
-   halt='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q'   
\
- $(_sc_search_regexp)
-
 # Use STREQ rather than comparing strcmp == 0, or != 0.
 sp_ = strcmp *\(.+\)
 sc_prohibit_strcmp:
@@ -335,51 +317,6 @@ sc_prohibit_magic_number_exit:
halt='use EXIT_* values rather than magic number'   \
  $(_sc_search_regexp)
 
-# Check that we don't use $< in non-implicit Makefile rules.
-#
-# To find the Makefiles, trace AC_CONFIG_FILES.  Using VC_LIST would
-# miss the Makefiles that are not under VC control (e.g., symlinks
-# installed for gettext).  "Parsing" (recursive) uses of SUBDIRS seems
-# too delicate.
-#
-# Use GNU Make's --print-data-base to normalize the rules into some
-# easy to parse format: they are separated by two \n.  Look for the
-# "section" about non-pattern rules (marked with "# Files") inside
-# which there are still the POSIX Make like implicit rules (".c.o").
-sc_prohibit_gnu_make_extensions_awk_ = \
-  BEGIN {  \
-  RS = "\n\n"; \
-  in_rules = 0;\
-  }\
-  /^\# Files/ {
\
-  in_rules = 1;\
-  }\
-  /\$$/dev/null 2>&1; then   \
- (cd $(srcdir) && autoconf --trace AC_CONFIG_FILES:'$$1') |\
-   tr ' ' '\n' |   \
-   $(SED) -ne '/Makefile/{s/\.in$$//;p;}' |\
-   while read m; do\
- $(MAKE) -qp -f $$m .DUMMY-TARGET 2>/dev/null |\
-   $(AWK) -v file=$$m -e '$($@_awk_)' || exit 1;   \
-   done;   \
-   fi
-
-# Using EXIT_SUCCESS as the first argument to error is misleading,
-# since when that parameter is 0, error does not

[libvirt] [PATCH v2 3/5] build: remove all logic unrelated to syntax-check

2019-10-08 Thread Daniel P . Berrangé
The standard maint.mk from gnulib provides alot more than just the
'syntax-check' target. This can all be purged to give a more minimal
file.

Signed-off-by: Daniel P. Berrangé 
---
 GNUmakefile|  42 
 build-aux/cfg.mk   |  10 -
 build-aux/maint.mk | 473 -
 3 files changed, 525 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 728f4a9ae8..288794ca25 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -38,48 +38,6 @@ include Makefile
 include $(srcdir)/$(_build-aux)/cfg.mk
 include $(srcdir)/$(_build-aux)/maint.mk
 
-# Ensure that $(VERSION) is up to date for dist-related targets, but not
-# for others: rerunning autoreconf and recompiling everything isn't cheap.
-_have-git-version-gen := \
-  $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
-ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
-  _is-dist-target ?= $(filter-out %clean, \
-$(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
-  _is-install-target ?= $(filter-out %check, $(filter 
install%,$(MAKECMDGOALS)))
-  ifneq (,$(_is-dist-target)$(_is-install-target))
-_curr-ver := $(shell cd $(srcdir)  \
-   && $(_build-aux)/git-version-gen\
- .tarball-version  \
- $(git-version-gen-tag-sed-script))
-ifneq ($(_curr-ver),$(VERSION))
-  ifeq ($(_curr-ver),UNKNOWN)
-$(info WARNING: unable to verify if $(VERSION) is the correct version)
-  else
-ifneq (,$(_is-install-target))
-  # GNU Coding Standards state that 'make install' should not cause
-  # recompilation after 'make all'.  But as long as changing the 
version
-  # string alters config.h, the cost of having 'make all' always have 
an
-  # up-to-date version is prohibitive.  So, as a compromise, we merely
-  # warn when installing a version string that is out of date; the user
-  # should run 'autoreconf' (or something like 'make distcheck') to
-  # fix the version, 'make all' to propagate it, then 'make install'.
-  $(info WARNING: version string $(VERSION) is out of date;)
-  $(info run '$(MAKE) _version' to fix it)
-else
-  $(info INFO: running autoreconf for new version string: $(_curr-ver))
-GNUmakefile: _version
-   touch GNUmakefile
-endif
-  endif
-endif
-  endif
-endif
-
-.PHONY: _version
-_version:
-   cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf)
-   $(MAKE) $(AM_MAKEFLAGS) Makefile
-
 else
 
 .DEFAULT_GOAL := abort-due-to-no-makefile
diff --git a/build-aux/cfg.mk b/build-aux/cfg.mk
index 31c0d68a81..3add2b7e94 100644
--- a/build-aux/cfg.mk
+++ b/build-aux/cfg.mk
@@ -16,16 +16,6 @@
 # along with this program.  If not, see
 # .
 
-# Use alpha.gnu.org for alpha and beta releases.
-# Use ftp.gnu.org for major releases.
-gnu_ftp_host-alpha = alpha.gnu.org
-gnu_ftp_host-beta = alpha.gnu.org
-gnu_ftp_host-major = ftp.gnu.org
-gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
-
-url_dir_list = \
-  ftp://$(gnu_rel_host)/gnu/coreutils
-
 # We use .gnulib, not gnulib.
 gnulib_dir = $(srcdir)/.gnulib
 
diff --git a/build-aux/maint.mk b/build-aux/maint.mk
index e570e45462..9467815711 100644
--- a/build-aux/maint.mk
+++ b/build-aux/maint.mk
@@ -37,26 +37,6 @@ _sp = $(_empty) $(_empty)
 # If S1 == S2, return S1, otherwise the empty string.
 _equal = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))
 
-# member-check,VARIABLE,VALID-VALUES
-# --
-# Check that $(VARIABLE) is in the space-separated list of VALID-VALUES, and
-# return it.  Die otherwise.
-member-check = \
-  $(strip  \
-$(if $($(1)),  \
-  $(if $(findstring $(_sp),$($(1))),   \
-  $(error invalid $(1): '$($(1))', expected $(2)), \
-  $(or $(findstring $(_sp)$($(1))$(_sp),$(_sp)$(2)$(_sp)), \
-$(error invalid $(1): '$($(1))', expected $(2, \
-  $(error $(1) undefined)))
-
-# Do not save the original name or timestamp in the .tar.gz file.
-# Use --rsyncable if available.
-gzip_rsyncable := \
-  $(shell gzip --help 2>/dev/null|$(GREP) rsyncable >/dev/null \
-&& printf %s --rsyncable)
-GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
-
 GIT = git
 VC = $(GIT)
 
@@ -95,62 +75,10 @@ VC_LIST_EXCEPT = \
| $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
$(_prepend_srcdir_prefix)
 
-ifeq ($(origin prev_version_file), undefined)
-  prev_version_file = $(srcdir)/.prev-version
-endif
-
-PREV_VERSION := $(shell cat $(prev_version_file) 2>/dev/null)
-VERSION_REGEXP = $(subst .,\.,$(VERSION))
-PREV_VERSION_REGEXP = $(subst .,\.

[libvirt] [PATCH v2 0/5] build: take full ownership of syntax-check from gnulib

2019-10-08 Thread Daniel P . Berrangé
Our syntax-check rule relies in various files imported during the gnulib
bootstrap process. As we switch to meson & try to eliminate gnulib, we
need to take ownership of syntax-check.

This patch series follows the approach taken for libosinfo & other
projects wrt syntax-check rules, but goes a step further and eliminates
alot of baggage we don't care about & merges all logic into one file.

Changed in v2:

 - Keep a top level GNUmakefile to preserve the hack
   that forced serialization of build targets

Daniel P. Berrangé (5):
  build: import gnulib's syntax-check make rules
  build: move syntax-check code into build-aux directory
  build: remove all logic unrelated to syntax-check
  build: delete all syntax check rules we're skipping
  build: merge all syntax-check logic into one file

 .gitignore  |9 +-
 GNUmakefile |   74 ++
 Makefile.am |7 +-
 bootstrap.conf  |4 -
 cfg.mk => build-aux/syntax-check.mk | 1122 +--
 build-aux/useless-if-before-free|  226 ++
 build-aux/vc-list-files |  113 +++
 configure.ac|6 +
 8 files changed, 1482 insertions(+), 79 deletions(-)
 create mode 100644 GNUmakefile
 rename cfg.mk => build-aux/syntax-check.mk (53%)
 create mode 100755 build-aux/useless-if-before-free
 create mode 100755 build-aux/vc-list-files

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH v2 2/5] build: move syntax-check code into build-aux directory

2019-10-08 Thread Daniel P . Berrangé
The syntax-check rules are the one bit of make usage that will
stay around for a while after the meson conversion. Move them
into the build-aux directory in preparation for refactoring
to make them independent from automake.

Signed-off-by: Daniel P. Berrangé 
---
 GNUmakefile| 23 ++---
 Makefile.am|  4 +--
 cfg.mk => build-aux/cfg.mk | 45 --
 maint.mk => build-aux/maint.mk | 18 ++
 4 files changed, 44 insertions(+), 46 deletions(-)
 rename cfg.mk => build-aux/cfg.mk (96%)
 rename maint.mk => build-aux/maint.mk (99%)

diff --git a/GNUmakefile b/GNUmakefile
index da25113fc3..728f4a9ae8 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -20,6 +20,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see .
 
+_build-aux ?= build-aux
+_autoreconf ?= autoreconf -v
+
 # If the user runs GNU make but has not yet run ./configure,
 # give them a diagnostic.
 _gl-Makefile := $(wildcard [M]akefile)
@@ -32,15 +35,8 @@ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
 ALL_RECURSIVE_TARGETS =
 
 include Makefile
-
-# Some projects override e.g., _autoreconf here.
--include $(srcdir)/cfg.mk
-
-# Allow cfg.mk to override these.
-_build-aux ?= build-aux
-_autoreconf ?= autoreconf -v
-
-include $(srcdir)/maint.mk
+include $(srcdir)/$(_build-aux)/cfg.mk
+include $(srcdir)/$(_build-aux)/maint.mk
 
 # Ensure that $(VERSION) is up to date for dist-related targets, but not
 # for others: rerunning autoreconf and recompiling everything isn't cheap.
@@ -90,13 +86,8 @@ else
 srcdir = .
 
 # The package can override .DEFAULT_GOAL to run actions like autoreconf.
--include ./cfg.mk
-
-# Allow cfg.mk to override these.
-_build-aux ?= build-aux
-_autoreconf ?= autoreconf -v
-
-include ./maint.mk
+include $(srcdir)/$(_build-aux)/cfg.mk
+include $(srcdir)/$(_build-aux)/maint.mk
 
 ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
 $(MAKECMDGOALS): abort-due-to-no-makefile
diff --git a/Makefile.am b/Makefile.am
index c91e7c55a5..a569a4260a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,15 +41,15 @@ EXTRA_DIST = \
   libvirt-admin.pc.in \
   Makefile.nonreentrant \
   autogen.sh \
-  cfg.mk \
   GNUmakefile \
-  maint.mk \
   run.in \
   README.md \
   AUTHORS.in \
   build-aux/augeas-gentest.pl \
+  build-aux/cfg.mk \
   build-aux/check-spacing.pl \
   build-aux/header-ifdef.pl \
+  build-aux/maint.mk \
   build-aux/minimize-po.pl \
   build-aux/mock-noinline.pl \
   build-aux/prohibit-duplicate-header.pl \
diff --git a/cfg.mk b/build-aux/cfg.mk
similarity index 96%
rename from cfg.mk
rename to build-aux/cfg.mk
index 2224d4da25..31c0d68a81 100644
--- a/cfg.mk
+++ b/build-aux/cfg.mk
@@ -1206,13 +1206,13 @@ exclude_file_name_regexp--sc_bindtextdomain = .*
 exclude_file_name_regexp--sc_gettext_init = 
^((tests|examples)/|tools/virt-login-shell.c)
 
 exclude_file_name_regexp--sc_copyright_format = \
-   ^cfg\.mk$$
+   ^build-aux/cfg\.mk$$
 
 exclude_file_name_regexp--sc_copyright_usage = \
-  ^(COPYING(|\.LESSER))|maint\.mk$$
+  ^COPYING(|\.LESSER)|build-aux/maint.mk$$
 
 exclude_file_name_regexp--sc_flags_usage = \
-  
^(cfg\.mk|docs/|src/util/virnetdevtap\.c$$|tests/((vir(cgroup|pci|test|usb)|nss|qemuxml2argv|qemusecurity)mock|virfilewrapper)\.c$$)
+  
^(build-aux/cfg\.mk|docs/|src/util/virnetdevtap\.c$$|tests/((vir(cgroup|pci|test|usb)|nss|qemuxml2argv|qemusecurity)mock|virfilewrapper)\.c$$)
 
 exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
   ^(src/rpc/gendispatch\.pl$$|tests/)
@@ -1220,16 +1220,22 @@ 
exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
 exclude_file_name_regexp--sc_po_check = ^(docs/|src/rpc/gendispatch\.pl$$)
 
 exclude_file_name_regexp--sc_prohibit_VIR_ERR_NO_MEMORY = \
-  
^(cfg\.mk|include/libvirt/virterror\.h|src/remote/remote_daemon_dispatch\.c|src/util/virerror\.c|docs/internals/oomtesting\.html\.in)$$
+  
^(build-aux/cfg\.mk|include/libvirt/virterror\.h|src/remote/remote_daemon_dispatch\.c|src/util/virerror\.c|docs/internals/oomtesting\.html\.in)$$
+
+exclude_file_name_regexp--sc_makefile_TAB_only_indentation = \
+  ^build-aux/maint\.mk$$
+
+exclude_file_name_regexp--sc_makefile_at_at_check = \
+  ^build-aux/maint\.mk$$
 
 exclude_file_name_regexp--sc_prohibit_PATH_MAX = \
-   ^cfg\.mk$$
+   ^build-aux/(cfg|maint)\.mk$$
 
 exclude_file_name_regexp--sc_prohibit_access_xok = \
-   ^(cfg\.mk|src/util/virutil\.c)$$
+   ^(build-aux/cfg\.mk|src/util/virutil\.c)$$
 
 exclude_file_name_regexp--sc_prohibit_asprintf = \
-  
^(cfg\.mk|bootstrap.conf$$|examples/|src/util/virstring\.[ch]$$|tests/vircgroupmock\.c|tools/virt-login-shell\.c|tools/nss/libvirt_nss\.c$$)
+  
^(build-aux/cfg\.mk|bootstrap.conf$$|examples/|src/util/virstring\.[ch]$$|tests/vircgroupmock\.c|tools/virt-login-shell\.c|tools/nss/libvirt_nss\.c$$)
 
 exclude_file_name_regexp--sc_prohibit_strdup = \
   
^(docs/|examples/

[libvirt] [PATCH v2 1/5] build: import gnulib's syntax-check make rules

2019-10-08 Thread Daniel P . Berrangé
We're going to be eliminating autotools and gnulib, but we still wish to
have the 'make syntax-check' functionality.

This imports the minimal set of gnulib files required to keep this
working.

Signed-off-by: Daniel P. Berrangé 
---
 .gitignore   |9 +-
 GNUmakefile  |  127 +++
 Makefile.am  |6 +
 bootstrap.conf   |4 -
 build-aux/useless-if-before-free |  226 
 build-aux/vc-list-files  |  113 ++
 cfg.mk   |2 +-
 configure.ac |6 +
 maint.mk | 1756 ++
 9 files changed, 2240 insertions(+), 9 deletions(-)
 create mode 100644 GNUmakefile
 create mode 100755 build-aux/useless-if-before-free
 create mode 100755 build-aux/vc-list-files
 create mode 100644 maint.mk

diff --git a/.gitignore b/.gitignore
index 82495e8692..42c3cd0790 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,12 +37,15 @@
 .sc-start-sc_*
 .ycm_extra_conf.py
 /AUTHORS
-/GNUmakefile
 /INSTALL
 /NEWS
 /aclocal.m4
 /autom4te.cache
-/build-aux/*
+/build-aux/.gitignore
+/build-aux/compile
+/build-aux/depcomp
+/build-aux/missing
+/build-aux/test-driver
 /build/
 /ci/scratch/
 /confdefs.h
@@ -95,7 +98,6 @@
 /ltconfig
 /ltmain.sh
 /m4/*
-/maint.mk
 /mingw-libvirt.spec
 /mkinstalldirs
 /po/*gmo
@@ -264,7 +266,6 @@ stamp-h
 stamp-h.in
 stamp-h1
 tags
-!/build-aux/*.pl
 !/gnulib/lib/Makefile.am
 !/gnulib/tests/Makefile.am
 !/m4/virt-*.m4
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 00..da25113fc3
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,127 @@
+# Having a separate GNUmakefile lets me 'include' the dynamically
+# generated rules created via cfg.mk (package-local configuration)
+# as well as maint.mk (generic maintainer rules).
+# This makefile is used only if you run GNU Make.
+# It is necessary if you want to build targets usually of interest
+# only to the maintainer.
+
+# Copyright (C) 2001, 2003, 2006-2019 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# If the user runs GNU make but has not yet run ./configure,
+# give them a diagnostic.
+_gl-Makefile := $(wildcard [M]akefile)
+ifneq ($(_gl-Makefile),)
+
+# Make tar archive easier to reproduce.
+export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
+
+# Allow the user to add to this in the Makefile.
+ALL_RECURSIVE_TARGETS =
+
+include Makefile
+
+# Some projects override e.g., _autoreconf here.
+-include $(srcdir)/cfg.mk
+
+# Allow cfg.mk to override these.
+_build-aux ?= build-aux
+_autoreconf ?= autoreconf -v
+
+include $(srcdir)/maint.mk
+
+# Ensure that $(VERSION) is up to date for dist-related targets, but not
+# for others: rerunning autoreconf and recompiling everything isn't cheap.
+_have-git-version-gen := \
+  $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
+ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
+  _is-dist-target ?= $(filter-out %clean, \
+$(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
+  _is-install-target ?= $(filter-out %check, $(filter 
install%,$(MAKECMDGOALS)))
+  ifneq (,$(_is-dist-target)$(_is-install-target))
+_curr-ver := $(shell cd $(srcdir)  \
+   && $(_build-aux)/git-version-gen\
+ .tarball-version  \
+ $(git-version-gen-tag-sed-script))
+ifneq ($(_curr-ver),$(VERSION))
+  ifeq ($(_curr-ver),UNKNOWN)
+$(info WARNING: unable to verify if $(VERSION) is the correct version)
+  else
+ifneq (,$(_is-install-target))
+  # GNU Coding Standards state that 'make install' should not cause
+  # recompilation after 'make all'.  But as long as changing the 
version
+  # string alters config.h, the cost of having 'make all' always have 
an
+  # up-to-date version is prohibitive.  So, as a compromise, we merely
+  # warn when installing a version string that is out of date; the user
+  # should run 'autoreconf' (or something like 'make distcheck') to
+  # fix the version, 'make all' to propagate it, then 'make install'.
+  $(info WARNING: version string $(VERSION) is out of date;)
+  $(info run '$(MAKE) _version' to fix it)
+else
+  $(info INFO: running 

Re: [libvirt] [jenkins-ci PATCH v2 03/12] mappings: Add python3-pip

2019-10-08 Thread Andrea Bolognani
On Tue, 2019-10-08 at 09:58 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/vars/mappings.yml
> @@ -790,6 +790,12 @@ mappings:
>python2-setuptools:
>  CentOS7: python2-setuptools
>  
> +  python3-pip:
> +CentOS7: python3-pip
> +Debian9: python3-pip
> +Ubuntu16: python3-pip
> +Ubuntu18: python3-pip

This also belong further down.

With that fixed,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH v2 02/12] guests: Add python2-setuptools to the base project

2019-10-08 Thread Andrea Bolognani
On Tue, 2019-10-08 at 09:58 +0200, Fabiano Fidêncio wrote:
> Signed-off-by: Fabiano Fidêncio 
> ---
>  guests/vars/projects/base.yml | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] build: stop clang complaining about redefined typedefs

2019-10-08 Thread Peter Krempa
On Tue, Oct 08, 2019 at 15:39:22 +0100, Daniel Berrange wrote:
> Clang's gnu99 mode is not quite the same as GCC's. It will complain
> about redefined typedefs being a C11 feature, while GCC does not
> complain and allows them in GNU99.
> 
> Signed-off-by: Daniel P. Berrangé 
> ---
> 
> Technically a build breaker fix, but given my track record of
> breaking the build today/yestday, lets have a reviewer approve :-)
> 
>  m4/virt-compile-warnings.m4 | 4 
>  1 file changed, 4 insertions(+)

ACK,

tested with:

clang version 8.0.0 (Fedora 8.0.0-1.fc30)
gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [jenkins-ci PATCH v2 01/12] mappings: Add python2-setuptools

2019-10-08 Thread Andrea Bolognani
On Tue, 2019-10-08 at 09:58 +0200, Fabiano Fidêncio wrote:
> python-setuptools, which will only be used on CentOS7, is needed in order
> to properly use the pip module for installing meson.
> 
> Without this package, we would see failures as `ImportError: No module
> named pkg_resources` when trying to use the pip module, even when using
> its python3 version.

It's a bummer that we still can't leave Python 2 behind :(

> +++ b/guests/vars/mappings.yml
> @@ -787,6 +787,9 @@ mappings:
>  rpm: perl-generators
>  CentOS7:
>  
> +  python2-setuptools:
> +CentOS7: python2-setuptools

This belongs further down, after python2-nose.

With that fixed,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] build: stop clang complaining about redefined typedefs

2019-10-08 Thread Fabiano Fidêncio
On Tue, Oct 8, 2019 at 5:14 PM Daniel P. Berrangé  wrote:
>
> Clang's gnu99 mode is not quite the same as GCC's. It will complain
> about redefined typedefs being a C11 feature, while GCC does not
> complain and allows them in GNU99.
>
> Signed-off-by: Daniel P. Berrangé 
> ---
>
> Technically a build breaker fix, but given my track record of
> breaking the build today/yestday, lets have a reviewer approve :-)
>
>  m4/virt-compile-warnings.m4 | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
> index 26f231f97e..4f9eee121c 100644
> --- a/m4/virt-compile-warnings.m4
> +++ b/m4/virt-compile-warnings.m4
> @@ -125,6 +125,10 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
>  # We do "bad" function casts all the time for event callbacks
>  wantwarn="$wantwarn -Wno-cast-function-type"
>
> +# CLang incorrectly complains about dup typedefs win gnu99 mode
> +# so use this CLang-specific arg to keep it quiet
> +wantwarn="$wantwarn -Wno-typedef-redefinition"
> +

Is this the *only* failure we have with CLang? If so ...
Reviewed-by: Fabiano Fidêncio 

Best Regards,
-- 
Fabiano Fidêncio

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] tests: delete objectlocking test code

2019-10-08 Thread Daniel P . Berrangé
The object locking test code is not run by any CI tests and has
bitrotted to the point where it isn't worth the effort to try to
fix it.

Signed-off-by: Daniel P. Berrangé 
---
 .gitignore |   3 -
 configure.ac   |  12 -
 tests/Makefile.am  |  29 +-
 tests/objectlocking.ml | 819 -
 4 files changed, 1 insertion(+), 862 deletions(-)
 delete mode 100644 tests/objectlocking.ml

diff --git a/.gitignore b/.gitignore
index 82495e8692..6b4b2096cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -231,9 +231,6 @@
 !/tests/virsh-self-test
 !/tests/virt-aa-helper-test
 !/tests/virt-admin-self-test
-/tests/objectlocking
-/tests/objectlocking-files.txt
-/tests/objectlocking.cm[ix]
 /tests/reconnect
 /tests/ssh
 /tests/test_file_access.txt
diff --git a/configure.ac b/configure.ac
index 40e93e251e..74d3aea10c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -770,18 +770,6 @@ if test "$enable_test_coverage" = yes; then
   WARN_CFLAGS=$save_WARN_CFLAGS
 fi
 
-LIBVIRT_ARG_ENABLE([TEST_LOCKING], [thread locking tests using CIL], [no])
-case "$enable_test_locking" in
-  yes|no) ;;
-  *) AC_MSG_ERROR([bad value ${enable_test_locking} for test-locking option]) 
;;
-esac
-
-if test "$enable_test_locking" = "yes"; then
-  LOCK_CHECKING_CFLAGS="-save-temps"
-  AC_SUBST([LOCK_CHECKING_CFLAGS])
-fi
-AM_CONDITIONAL([WITH_CIL],[test "$enable_test_locking" = "yes"])
-
 dnl Cygwin, MinGW and MSVC checks
 LIBVIRT_WIN_CHECK_COMMON
 LIBVIRT_WIN_CHECK_CYGWIN
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d88ad7f686..10e1a5d78d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -332,10 +332,6 @@ test_programs += bhyvexml2argvtest bhyvexml2xmltest 
bhyveargv2xmltest
 test_libraries += libbhyvexml2argvmock.la libbhyveargv2xmlmock.la
 endif WITH_BHYVE
 
-if WITH_CIL
-test_programs += objectlocking
-endif WITH_CIL
-
 if WITH_YAJL
 test_programs += virjsontest
 endif WITH_YAJL
@@ -1547,27 +1543,4 @@ else ! WITH_LINUX
 EXTRA_DIST += virscsitest.c
 endif  ! WITH_LINUX
 
-if WITH_CIL
-CILOPTFLAGS =
-CILOPTINCS =
-CILOPTPACKAGES = -package unix,str,cil
-CILOPTLIBS = -linkpkg
-
-objectlocking_SOURCES = objectlocking.ml
-
-%.cmx: %.ml
-   ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) -c $<
-
-objectlocking: objectlocking.cmx objectlocking-files.txt
-   ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
- $(CILOPTLIBS) $< -o $@
-
-objectlocking-files.txt:
-   find $(top_builddir)/src/ -name '*.i' > $@
-
-else ! WITH_CIL
-EXTRA_DIST += objectlocking.ml
-endif ! WITH_CIL
-
-CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \
-   objectlocking-files.txt
+CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
diff --git a/tests/objectlocking.ml b/tests/objectlocking.ml
deleted file mode 100644
index 6726d29e73..00
--- a/tests/objectlocking.ml
+++ /dev/null
@@ -1,819 +0,0 @@
-(*
- * Analyse libvirt driver API methods for mutex locking mistakes
- *
- * Copyright (C) 2008-2010, 2012, 2014 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * .
- *)
-
-open Pretty
-open Cil
-
-(*
- * Convenient routine to load the contents of a file into
- * a list of strings
- *)
-let input_file filename =
-  let chan = open_in filename in
-  let lines = ref [] in
-  try while true; do lines := input_line chan :: !lines done; []
-  with
-End_of_file -> close_in chan; List.rev !lines
-
-module DF = Dataflow
-module UD = Usedef
-module IH = Inthash
-module E = Errormsg
-module VS = UD.VS
-
-let debug = ref false
-
-
-let driverTables = [
-  "virDriver";
-  "virNetworkDriver";
-  "virStorageDriver";
-  "virNodeDeviceDriver";
-(*  "virStateDriver"; Disable for now, since shutdown/startup have weird 
locking rules *)
-]
-
-(*
- * This is the list of all libvirt methods which return
- * pointers to locked objects
- *)
-let lockedObjMethods = [
-   "virDomainFindByID";
-   "virDomainFindByUUID";
-   "virDomainFindByName";
-   "virDomainAssignDef";
-
-   "virNetworkObjFindByUUID";
-   "virNetworkObjFindByName";
-   "virNetworkAssignDef";
-
-   "virNodeDeviceFindByName";
-   "virNodeDeviceAssignDef";
-
-   "virStoragePoolObjFindByUUID";
-   "virStoragePoolObjFindByName";
-   "virStoragePoolObjAssignDef"
-]
-
-
-(*
- * This is the list of all libvirt methods which
- * c

[libvirt] [PATCH] build: stop clang complaining about redefined typedefs

2019-10-08 Thread Daniel P . Berrangé
Clang's gnu99 mode is not quite the same as GCC's. It will complain
about redefined typedefs being a C11 feature, while GCC does not
complain and allows them in GNU99.

Signed-off-by: Daniel P. Berrangé 
---

Technically a build breaker fix, but given my track record of
breaking the build today/yestday, lets have a reviewer approve :-)

 m4/virt-compile-warnings.m4 | 4 
 1 file changed, 4 insertions(+)

diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index 26f231f97e..4f9eee121c 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -125,6 +125,10 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
 # We do "bad" function casts all the time for event callbacks
 wantwarn="$wantwarn -Wno-cast-function-type"
 
+# CLang incorrectly complains about dup typedefs win gnu99 mode
+# so use this CLang-specific arg to keep it quiet
+wantwarn="$wantwarn -Wno-typedef-redefinition"
+
 # GNULIB expects this to be part of -Wc++-compat, but we turn
 # that one off, so we need to manually enable this again
 wantwarn="$wantwarn -Wjump-misses-init"
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 11/23] access: convert polkit driver to auto free memory

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:13PM +0100, Daniel P. Berrangé wrote:

Signed-off-by: Daniel P. Berrangé 
---
src/access/viraccessdriverpolkit.c | 38 +++---
1 file changed, 14 insertions(+), 24 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 10/23] util: convert virIdentity implementation and test suite to g_autoptr

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:12PM +0100, Daniel P. Berrangé wrote:

To simplify the later conversion from virObject to GObject, introduce
the use of g_autoptr to the virIdentity implementnation and test suite.

Signed-off-by: Daniel P. Berrangé 
---
src/util/viridentity.c  | 40 +++--
tests/viridentitytest.c | 44 +
2 files changed, 34 insertions(+), 50 deletions(-)

diff --git a/src/util/viridentity.c b/src/util/viridentity.c
index 22e2644c19..a24704b690 100644
--- a/src/util/viridentity.c
+++ b/src/util/viridentity.c
@@ -105,7 +105,7 @@ virIdentityPtr virIdentityGetCurrent(void)
 */
int virIdentitySetCurrent(virIdentityPtr ident)
{
-virIdentityPtr old;
+g_autoptr(virIdentity) old = NULL;

if (virIdentityInitialize() < 0)
return -1;
@@ -120,8 +120,6 @@ int virIdentitySetCurrent(virIdentityPtr ident)
return -1;
}

-virObjectUnref(old);
-
return 0;
}

@@ -136,60 +134,54 @@ int virIdentitySetCurrent(virIdentityPtr ident)
 */
virIdentityPtr virIdentityGetSystem(void)
{
-VIR_AUTOFREE(char *) username = NULL;
-VIR_AUTOFREE(char *) groupname = NULL;
+g_autofree char *username = NULL;
+g_autofree char *groupname = NULL;
unsigned long long startTime;
-virIdentityPtr ret = NULL;



-#if WITH_SELINUX
-security_context_t con;
-#endif


Unrelated change.


+g_autoptr(virIdentity) ret = NULL;

if (!(ret = virIdentityNew()))
-goto error;
+return NULL;

if (virIdentitySetProcessID(ret, getpid()) < 0)
-goto error;
+return NULL;

if (virProcessGetStartTime(getpid(), &startTime) < 0)
-goto error;
+return NULL;
if (startTime != 0 &&
virIdentitySetProcessTime(ret, startTime) < 0)
-goto error;
+return NULL;

if (!(username = virGetUserName(geteuid(
return ret;
if (virIdentitySetUserName(ret, username) < 0)
-goto error;
+return NULL;
if (virIdentitySetUNIXUserID(ret, getuid()) < 0)
-goto error;
+return NULL;

if (!(groupname = virGetGroupName(getegid(
return ret;
if (virIdentitySetGroupName(ret, groupname) < 0)
-goto error;
+return NULL;
if (virIdentitySetUNIXGroupID(ret, getgid()) < 0)
-goto error;
+return NULL;

#if WITH_SELINUX
if (is_selinux_enabled() > 0) {
+security_context_t con;
if (getcon(&con) < 0) {
virReportSystemError(errno, "%s",
 _("Unable to lookup SELinux process context"));
-return ret;


Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 09/23] util: use glib base64 encoding/decoding APIs

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:11PM +0100, Daniel P. Berrangé wrote:

Replace use of the gnulib base64 module with glib's own base64 API family.

Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf|  1 -
configure.ac  |  5 -
src/conf/virsecretobj.c   | 26 --
src/libvirt_private.syms  |  1 -
src/libxl/libxl_conf.c|  3 +--
src/qemu/qemu_agent.c |  6 ++
src/qemu/qemu_command.c   |  5 ++---
src/qemu/qemu_domain.c|  8 +++-
src/secret/secret_driver.c|  1 -
src/storage/storage_backend_rbd.c |  4 +---
src/util/virstring.c  | 21 -
src/util/virstring.h  |  2 --
tools/virsh-secret.c  | 17 -
13 files changed, 17 insertions(+), 83 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 08/23] conf: convert virSecretObj APIs to use autofree

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:10PM +0100, Daniel P. Berrangé wrote:

Signed-off-by: Daniel P. Berrangé 
---
src/conf/virsecretobj.c | 46 +++--
1 file changed, 17 insertions(+), 29 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [libvirt-dbus] [PATCH 0/2] Implement Snaphots

2019-10-08 Thread Fabiano Fidêncio
Simon,

On Mon, Oct 7, 2019 at 5:30 PM Simon Kobyda  wrote:
>
> Implement snapshot interface and its APIs.
>

Apart from the comments made by Jano, I'd strongly recommend to have
this series rebased atop of Pavel Hrdina's series switching
libvirt-dbus to meson.

His series is already reviewed and will be pushed as soon as we have
libvirt-jenkins-ci work merged.

Best Regards,
-- 
Fabiano Fidêncio

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 07/23] src: add support for g_autoptr with virObject instances

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:09PM +0100, Daniel P. Berrangé wrote:

Libvirt currently uses the VIR_AUTOUNREF macro for auto cleanup of
virObject instances. GLib approaches things differently with GObject,
reusing their g_autoptr() concept.

This introduces support for g_autoptr() with virObject, to facilitate
the conversion to GObject.

Only virObject classes which are currently used with VIR_AUTOREF are
updated. Any others should be converted to GObject before introducing
use of autocleanup.

Signed-off-by: Daniel P. Berrangé 
---
docs/hacking.html.in|  5 +
src/conf/capabilities.h |  3 +++
src/conf/domain_capabilities.h  |  3 +++
src/conf/domain_conf.h  |  3 +++
src/conf/snapshot_conf.h|  3 +++
src/conf/storage_capabilities.h |  3 +++
src/datatypes.h | 15 +++
src/libxl/libxl_conf.h  |  2 ++
src/qemu/qemu_blockjob.h|  1 +
src/qemu/qemu_capabilities.h|  2 ++
src/qemu/qemu_conf.h|  3 +++
src/util/virhostdev.h   |  3 +++
src/util/viridentity.h  |  2 ++
src/util/virmdev.h  |  3 +++
src/util/virobject.h|  4 
src/util/virpci.h   |  3 +++
src/util/virresctrl.h   |  4 
src/util/virscsi.h  |  3 +++
src/util/virscsivhost.h |  3 +++
src/util/virstoragefile.h   |  2 ++
src/util/virusb.h   |  3 +++
21 files changed, 73 insertions(+)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 06/23] util: rewrite auto cleanup macros to use glib's equivalent

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:08PM +0100, Daniel P. Berrangé wrote:

To facilitate porting over to glib, this rewrites the auto cleanup
macros to use glib's equivalent.

As a result it is now possible to use g_autoptr/VIR_AUTOPTR, and
g_auto/VIR_AUTOCLEAN, g_autofree/VIR_AUTOFREE interchangably, regardless
of which macros were used to declare the cleanup types.

Within the scope of any single method, code must remain consistent
using either GLib or Libvirt macros, never mixing both. New code
must preferentially use the GLib macros, and old code will be
converted incrementally.

Signed-off-by: Daniel P. Berrangé 
---
cfg.mk  |  2 +-
docs/hacking.html.in| 18 ++
src/util/viralloc.h |  5 -
src/util/virautoclean.h | 38 --
4 files changed, 43 insertions(+), 20 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 3eae469165..7319a14d19 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1061,7 +1061,7 @@ sc_prohibit_backslash_alignment:
# Rule to ensure that variables declared using a cleanup macro are
# always initialized.
sc_require_attribute_cleanup_initialization:
-   @prohibit='VIR_AUTO((FREE|PTR|UNREF|CLEAN)\(.+\)|CLOSE|STRINGLIST) 
*[^=]+;' \
+   
@prohibit='((g_auto(ptr|free)?)|(VIR_AUTO((FREE|PTR|UNREF|CLEAN)\(.+\)|CLOSE|STRINGLIST)))
 *[^=]+;' \
in_vc_files='\.[chx]$$' \
halt='variable declared with a cleanup macro must be initialized' \
  $(_sc_search_regexp)
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index 5839464e99..40a3c60573 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -1028,6 +1028,24 @@ BAD:
  The GLib APIs g_strdup_printf / g_strdup_vprint can be used,
but beware that they don't abort on OOM, so the libvirt wrappers
may still be desirable to use. Don't use g_vasprintf or g_asprintf.
+
+  VIR_AUTOPTR, VIR_AUTOCLEAN, VIR_AUTOFREE
+  The GLib macros g_autoptr, g_auto and g_autofree must be used
+instead in all new code. In existing code, the GLib macros must
+never be mixed with libvirt macros within a method, nor should
+they be mixed with VIR_FREE. If introducing GLib macros to an
+existing method, any use of libvirt macros must be converted
+in an independent commit.
+  
+
+  VIR_DEFINE_AUTOPTR_FUNC, VIR_DEFINE_AUTOCLEAN_FUNC
+  The Gib macros G_DEFINE_AUTOPTR_CLEANUP_FUNC and
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC must be used in all
+new code. Existing code should be converted to the
+new macros where relevant. It is permissible to use
+g_autoptr, g_auto on an object whose cleanup function
+is declared with the libvirt macros and vica-verca.


vice-versa


+  


File handling
diff --git a/src/util/viralloc.h b/src/util/viralloc.h
index 517f9aada6..f81ea42902 100644
--- a/src/util/viralloc.h
+++ b/src/util/viralloc.h
@@ -494,8 +494,11 @@ void virDisposeString(char **strptr)
 * VIR_AUTOFREE:
 * @type: type of the variable to be freed automatically
 *
+ * DEPRECATED: use g_autofree for new code. See hacking


HACKING


+ * for further guidance.
+ *
 * Macro to automatically free the memory allocated to
 * the variable declared with it by calling virFree
 * when the variable goes out of scope.
 */
-#define VIR_AUTOFREE(type) __attribute__((cleanup(virFree))) type
+#define VIR_AUTOFREE(type) g_autofree type
diff --git a/src/util/virautoclean.h b/src/util/virautoclean.h
index 6da288e67d..d7c1c1ec8b 100644
--- a/src/util/virautoclean.h
+++ b/src/util/virautoclean.h
@@ -20,7 +20,21 @@

#pragma once

-#define VIR_AUTOPTR_FUNC_NAME(type) type##AutoPtrFree
+/**
+ * DEPRECATION WARNING
+ *
+ * The macros in this file should not be used in newly written code.
+ * Use the equivalent GLib macros instead.
+ *
+ * For existing code, use of the libvirt and GLib macros must NEVER
+ * be mixed within a single method.
+ *
+ * The use of the libvirt VIR_FREE macros should also not be mixed
+ * with GLib auto-free macros and vica-verca.


vice-versa

Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 5/5] Revert "src: Document autostart for session demon"

2019-10-08 Thread Daniel P . Berrangé
On Mon, Oct 07, 2019 at 11:11:23AM +0200, Michal Privoznik wrote:
> This reverts commit 61b4e8aaf1bce07f282c152de556c3d6aa8d65be.
> 
> After previous commits this is no longer needed.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  src/libvirt-domain.c | 5 -
>  1 file changed, 5 deletions(-)

Reviewed-by: Daniel P. Berrangé 

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 4/5] news: Document autostart fix

2019-10-08 Thread Daniel P . Berrangé
On Mon, Oct 07, 2019 at 11:11:22AM +0200, Michal Privoznik wrote:
> Signed-off-by: Michal Privoznik 
> ---
>  docs/news.xml | 15 +++
>  1 file changed, 15 insertions(+)

Reviewed-by: Daniel P. Berrangé 


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 3/5] lib: autostart objects exactly once

2019-10-08 Thread Daniel P . Berrangé
On Mon, Oct 07, 2019 at 11:11:21AM +0200, Michal Privoznik wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1755303
> 
> With the recent work in daemon split and socket activation
> daemons can come and go. They can and will be started many times
> during a session which results in objects being autostarted
> multiple times. This is not optimal. Use
> virDriverShouldAutostart() to determine if autostart should be
> done or not.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  src/bhyve/bhyve_driver.c |  8 +++-
>  src/libxl/libxl_driver.c | 12 +---
>  src/lxc/lxc_driver.c |  7 ++-
>  src/network/bridge_driver.c  | 12 +---
>  src/qemu/qemu_driver.c   |  7 ++-
>  src/storage/storage_driver.c |  7 ++-
>  6 files changed, 43 insertions(+), 10 deletions(-)

Reviewed-by: Daniel P. Berrangé 

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 2/5] driver: Introduce virDriverShouldAutostart()

2019-10-08 Thread Daniel P . Berrangé
On Mon, Oct 07, 2019 at 11:11:20AM +0200, Michal Privoznik wrote:
> Some of objects we manage can be autostarted on libvirtd startup
> (e.g. domains, network, storage pools). The idea was that when
> the host is started up these objects are started too without need
> of user intervention. However, with the latest daemon split and
> switch to socket activated, short lived daemons (we put --timeout
> 120 onto each daemon's command line) this doesn't do what we want
> it to. The problem is not new though, we already had the session
> daemon come and go and we circumvented this problem by
> documenting it (see v4.10.0-92-g61b4e8aaf1). But now that we meet
> the same problem at all fronts it's time to deal with it.
> 
> The solution implemented in this commit is to have a file (one
> per each driver) that:
> 
>   1) if doesn't exist, is created and autostart is allowed for
>  given driver,
> 
>   2) if it does exist, then autostart is suppressed for given
>  driver.
> 
> All the files live in a location that doesn't survive host
> reboots (/var/run/ for instance) and thus the file is
> automatically not there on fresh host boot.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  src/driver.c | 39 +++
>  src/driver.h |  3 +++
>  src/libvirt_private.syms |  1 +
>  3 files changed, 43 insertions(+)

Reviewed-by: Daniel P. Berrangé 


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 1/5] qemu_driver: Fix comment of qemuStateCleanup()

2019-10-08 Thread Daniel P . Berrangé
On Mon, Oct 07, 2019 at 11:11:19AM +0200, Michal Privoznik wrote:
> The comment says that the function kills domains and networks.
> This is obviously not the case.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  src/qemu/qemu_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé 


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 05/23] util: convert virSystemdActivation to use VIR_DEFINE_AUTOPTR_FUNC

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:07PM +0100, Daniel P. Berrangé wrote:

Using the standard macro will facilitate the conversion to glib's
auto cleanup macros.

Signed-off-by: Daniel P. Berrangé 
---
src/util/virsystemd.c  | 10 +-
src/util/virsystemd.h  |  5 +++--
tests/virsystemdtest.c |  2 +-
3 files changed, 9 insertions(+), 8 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 04/23] util: use glib string allocation/formatting functions

2019-10-08 Thread Daniel P . Berrangé
On Tue, Oct 08, 2019 at 03:49:50PM +0200, Ján Tomko wrote:
> On Mon, Oct 07, 2019 at 06:14:06PM +0100, Daniel P. Berrangé wrote:
> > Convert the string duplication APIs to use the g_strdup family of APIs.
> > 
> > We previously used the 'strdup-posix' gnulib module because mingw does
> > not set errno to ENOMEM on failure
> > 
> > We previously used the 'strndup' gnulib module because this function
> > does not exist on mingw.
> > 
> > We previously used the 'vasprintf' gnulib module because of many GNU
> > supported format specifiers not working on non-Linux platforms. glib's
> > own equivalent standardizes on GNU format specifiers too.
> > 
> > Signed-off-by: Daniel P. Berrangé 
> > ---
> > bootstrap.conf   |  3 ---
> > docs/hacking.html.in |  8 
> > src/util/virstring.c | 28 ++--
> > src/util/virstring.h |  8 
> > 4 files changed, 38 insertions(+), 9 deletions(-)
> > 
> > diff --git a/bootstrap.conf b/bootstrap.conf
> > index b98fdedeb1..7105ae2eeb 100644
> > --- a/bootstrap.conf
> > +++ b/bootstrap.conf
> > @@ -82,8 +82,6 @@ snprintf
> > socket
> > stat-time
> > strchrnul
> > -strdup-posix
> > -strndup
> > strerror
> > strerror_r-posix
> > strptime
> > @@ -99,7 +97,6 @@ uname
> > unsetenv
> > useless-if-before-free
> > usleep
> > -vasprintf
> > verify
> > vc-list-files
> > vsnprintf
> > diff --git a/docs/hacking.html.in b/docs/hacking.html.in
> > index 8072796312..5839464e99 100644
> > --- a/docs/hacking.html.in
> > +++ b/docs/hacking.html.in
> > @@ -1020,6 +1020,14 @@ BAD:
> > classic libvirt memory allocation APIs and GLib APIs within
> > a single method. Keep the style consistent, converting existing
> > code to GLib style in a separate, prior commit.
> > +
> > +  VIR_STRDUP, VIR_STRNDUP
> > +  Prefer the GLib APIs g_strdup and g_strndup.
> > +
> > +  virAsprintf, virVasprintf
> > +  The GLib APIs g_strdup_printf / g_strdup_vprint can be used,
> > +but beware that they don't abort on OOM, so the libvirt wrappers
> > +may still be desirable to use. Don't use g_vasprintf or 
> > g_asprintf.
> 
> What do you mean by g_asprintf? I cannot find that function.

yeah, my bad. I blindly assumed there was a non-valist variant.

> 
> > 
> > 
> > File handling
> 
> Reviewed-by: Ján Tomko 
> 
> Jano



Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 04/23] util: use glib string allocation/formatting functions

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:06PM +0100, Daniel P. Berrangé wrote:

Convert the string duplication APIs to use the g_strdup family of APIs.

We previously used the 'strdup-posix' gnulib module because mingw does
not set errno to ENOMEM on failure

We previously used the 'strndup' gnulib module because this function
does not exist on mingw.

We previously used the 'vasprintf' gnulib module because of many GNU
supported format specifiers not working on non-Linux platforms. glib's
own equivalent standardizes on GNU format specifiers too.

Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf   |  3 ---
docs/hacking.html.in |  8 
src/util/virstring.c | 28 ++--
src/util/virstring.h |  8 
4 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index b98fdedeb1..7105ae2eeb 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -82,8 +82,6 @@ snprintf
socket
stat-time
strchrnul
-strdup-posix
-strndup
strerror
strerror_r-posix
strptime
@@ -99,7 +97,6 @@ uname
unsetenv
useless-if-before-free
usleep
-vasprintf
verify
vc-list-files
vsnprintf
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index 8072796312..5839464e99 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -1020,6 +1020,14 @@ BAD:
classic libvirt memory allocation APIs and GLib APIs within
a single method. Keep the style consistent, converting existing
code to GLib style in a separate, prior commit.
+
+  VIR_STRDUP, VIR_STRNDUP
+  Prefer the GLib APIs g_strdup and g_strndup.
+
+  virAsprintf, virVasprintf
+  The GLib APIs g_strdup_printf / g_strdup_vprint can be used,
+but beware that they don't abort on OOM, so the libvirt wrappers
+may still be desirable to use. Don't use g_vasprintf or 
g_asprintf.


What do you mean by g_asprintf? I cannot find that function.




File handling


Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] m4: fix setting of warning flags

2019-10-08 Thread Daniel P . Berrangé
When adding the -std=gnu99 flag, we set $wantwarn instead
of appending to it. This meant all the compiler warnings
were accidentally discarded.

Signed-off-by: Daniel P. Berrangé 
---

Pushed as a trivial fix for the previous commit

 m4/virt-compile-warnings.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index 411d257465..26f231f97e 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -192,7 +192,7 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
 # Request the gnu99 standard which is the best choice with
 # gcc 4.8.0. Not a warning flag, but the probing mechanism
 # is convenient
-wantwarn="-std=gnu99"
+wantwarn="$wantwarn -std=gnu99"
 
 # Check for $CC support of each warning
 for w in $wantwarn; do
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 03/23] util: use glib memory allocation functions

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:05PM +0100, Daniel P. Berrangé wrote:

Convert the VIR_ALLOC family of APIs with use of the g_malloc family of
APIs. Use of VIR_ALLOC related functions should be incrementally phased
out over time, allowing return value checks to be dropped. Use of
VIR_FREE should be replaced with auto-cleanup whenever possible.

We previously used the 'calloc-posix' gnulib module because mingw does
not set errno to ENOMEM on failure.

Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf   |   1 -
docs/hacking.html.in | 108 ++-
src/util/viralloc.c  |  29 +++-
src/util/viralloc.h  |   9 
4 files changed, 28 insertions(+), 119 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 02/23] build: link to glib library

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:04PM +0100, Daniel P. Berrangé wrote:

Add the main glib.h to internal.h so that all common code can use it.

Historically glib allowed applications to register an alternative
memory allocator, so mixing g_malloc/g_free with malloc/free was not
safe.

This was feature was dropped in 2.46.0 with:

 commit 3be6ed60aa58095691bd697344765e715a327fc1
 Author: Alexander Larsson 
 Date:   Sat Jun 27 18:38:42 2015 +0200

   Deprecate and drop support for memory vtables

Applications are still encourged to match g_malloc/g_free, but it is no
longer a mandatory requirement for correctness, just stylistic. This is
explicitly clarified in

   commit 1f24b36607bf708f037396014b2cdbc08d67b275
   Author: Daniel P. Berrangé 
   Date:   Thu Sep 5 14:37:54 2019 +0100

   gmem: clarify that g_malloc always uses the system allocator

Applications can still use custom allocators in general, but they must
do this by linking to a library that replaces the core malloc/free
implemenentation entirely, instead of via a glib specific call.

This means that libvirt does not need to be concerned about use of
g_malloc/g_free causing an ABI change in the public libary, and can
avoid memory copying when talking to external libraries.

This patch probes for glib, which provides the foundation layer with
a collection of data structures, helper APIs, and platform portability
logic.

Later patches will introduce linkage to gobject which provides the
object type system, built on glib, and gio which providing objects
for various interesting tasks, most notably including DBus client
and server support and portable sockets APIs, but much more too.

Reviewed-by: Pavel Hrdina 
Signed-off-by: Daniel P. Berrangé 
---
docs/hacking.html.in   | 21 +
src/Makefile.am|  2 ++
src/internal.h |  1 +
src/lxc/Makefile.inc.am|  2 ++
src/remote/Makefile.inc.am |  1 +
src/util/Makefile.inc.am   |  1 +
tests/Makefile.am  |  3 ++-
tools/Makefile.am  |  1 +
8 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index edf2f54ce3..93b451591e 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -989,6 +989,27 @@ BAD:
  it points to, or it is aliased to another pointer that is.


+Adoption of GLib APIs
+


Trailing whitespace at the end of this line ^^


+
+  Libvirt has adopted use of the
+  https://developer.gnome.org/glib/stable/";>GLib library.
+  Due to libvirt's long history of development, there are many APIs
+  in libvirt, for which GLib provides an alternative solution. The
+  general rule to follow is that the standard GLib solution will be
+  preferred over historical libvirt APIs. Existing code will be
+  ported over to use GLib APIs over time, but new code should use
+  the GLib APIs straight away where possible.
+
+
+
+  The following is a list of libvirt APIs that should no longer be
+  used in new code, and their suggested GLib replacements:
+
+
+
+
+
Low level memory management




Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 01/23] build: probe for glib-2 library in configure

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 06:14:03PM +0100, Daniel P. Berrangé wrote:

Prepare for linking with glib by probing for it at configure
time. Per supported platforms target, the min glib versions on
relevant distros are:

 RHEL-8: 2.56.1
 RHEL-7: 2.50.3
 Debian (Buster): 2.58.3
 Debian (Stretch): 2.50.3
 OpenBSD (Ports): 2.58.3
 FreeBSD (Ports): 2.56.3
 OpenSUSE Leap 15: 2.54.3
 SLE12-SP2: 2.48.2
 Ubuntu (Xenial): 2.48.0
 macOS (Homebrew): 2.56.0

This suggests that a minimum glib of 2.48 is a reasonable target.
This aligns with the minimum version required by qemu too.

Reviewed-by: Pavel Hrdina 
Signed-off-by: Daniel P. Berrangé 
---
configure.ac  |  2 ++
libvirt.spec.in   |  1 +
m4/virt-glib.m4   | 36 
mingw-libvirt.spec.in |  2 ++
4 files changed, 41 insertions(+)
create mode 100644 m4/virt-glib.m4



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [libvirt-dbus] [PATCH 2/2] Implement snapshots APIs

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 05:22:34PM +0200, Simon Kobyda wrote:

Signed-off-by: Simon Kobyda 
---
data/org.libvirt.Domain.xml |  26 
data/org.libvirt.DomainSnapshot.xml |  34 +
src/domain.c| 158 +
src/domainsnapshot.c| 204 +++-
tests/Makefile.am   |   1 +
tests/libvirttest.py|  14 ++
tests/test_domain.py|   8 ++
tests/test_snapshot.py  |  43 ++
tests/xmldata.py|   6 +
9 files changed, 493 insertions(+), 1 deletion(-)
create mode 100755 tests/test_snapshot.py

diff --git a/src/domainsnapshot.c b/src/domainsnapshot.c
index 590cbef..4bffe5d 100644
--- a/src/domainsnapshot.c
+++ b/src/domainsnapshot.c
@@ -1,14 +1,216 @@
static virtDBusGDBusMethodTable virtDBusDomainSnapshotMethodTable[] = {
-{ 0 }
+{ "Delete", virtDBusDomainSnapshotDelete },
+{ "GetParent", virtDBusDomainSnapshotGetParent },
+{ "GetXMLDesc", virtDBusDomainSnapshotGetXMLDesc },
+{ "IsCurrent", virtDBusDomainSnapshotIsCurrent }, // Needs to be method 
since it takes 'flags' parameter


/* ... */ is the prevailing comment style, however there are no rules
for that.


+{ "ListChildren", virtDBusDomainSnapshotListAllChildren },
+{ "Revert", virtDBusDomainSnapshotRevert },
};

static gchar **
diff --git a/tests/Makefile.am b/tests/Makefile.am
index cd1fbd7..7757429 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,6 +14,7 @@ test_programs = \
test_interface.py \
test_network.py \
test_nodedev.py \
+   test_snapshot.py \
test_storage.py \
$(NULL)

diff --git a/tests/libvirttest.py b/tests/libvirttest.py
index a442196..8462fc3 100644
--- a/tests/libvirttest.py
+++ b/tests/libvirttest.py
@@ -112,6 +112,20 @@ class BaseTestClass():
"""
return self.node_device_create()

+@pytest.fixture
+def snapshot_create(self):
+""" Fixture to create simple snapshot the test driver
+
+This fixture should be used in the setup of every test manipulating
+with snaphots.
+"""
+_, test_domain = self.get_test_domain()
+interface_obj = dbus.Interface(test_domain, 'org.libvirt.Domain')
+path = interface_obj.SnapshotCreateXML(xmldata.minimal_snapshot_xml, 0)
+obj = self.bus.get_object('org.libvirt', path)
+interface_obj = dbus.Interface(obj, 'org.libvirt.DomainSnapshot')
+return interface_obj
+
@pytest.fixture
def storage_volume_create(self):
""" Fixture to create dummy storage volume on the test driver
diff --git a/tests/test_domain.py b/tests/test_domain.py
index b5879b4..fdb5aa4 100755
--- a/tests/test_domain.py
+++ b/tests/test_domain.py
@@ -2,6 +2,7 @@

import dbus
import libvirttest
+import xmldata

DBUS_EXCEPTION_MISSING_FUNCTION = 'this function is not supported by the 
connection driver'

@@ -160,6 +161,13 @@ class TestDomain(libvirttest.BaseTestClass):
pinInfo = domain.GetVcpuPinInfo(0)
assert pinInfo == pinInfo_expected

+def test_snapshot(self):
+obj, domain = self.get_test_domain()
+domain.SnapshotCreateXML(xmldata.minimal_snapshot_xml, 0)
+assert isinstance(domain.SnapshotCurrent(0), dbus.ObjectPath)
+assert isinstance(domain.SnapshotLookupByName("my_snapshot", 0), 
dbus.ObjectPath)
+assert isinstance(domain.ListDomainSnapshots(0), dbus.Array)

if __name__ == '__main__':
libvirttest.run()
+


syntax-check fails with 'flake8' installed:

$ make syntax-check
/usr/bin/flake8 --show-source --ignore=E501 .
./tests/test_domain.py:171:1: E305 expected 2 blank lines after class or 
function definition, found 1
if __name__ == '__main__':
^
./tests/test_domain.py:173:1: W391 blank line at end of file

^
./tests/test_snapshot.py:9:1: E302 expected 2 blank lines, found 1
@pytest.mark.usefixtures("snapshot_create")
^
./tests/test_snapshot.py:42:1: E305 expected 2 blank lines after class or 
function definition, found 1
if __name__ == '__main__':
^
make: *** [Makefile:906: flake8] Error 1

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [libvirt-dbus] [PATCH 1/2] Introduce Domain Snapshot Interface

2019-10-08 Thread Ján Tomko

On Mon, Oct 07, 2019 at 05:22:33PM +0200, Simon Kobyda wrote:

Signed-off-by: Simon Kobyda 
---
data/Makefile.am|  1 +
data/org.libvirt.DomainSnapshot.xml |  7 +++
src/Makefile.am |  2 +
src/connect.c   |  6 +++
src/connect.h   |  1 +
src/domainsnapshot.c| 79 +
src/domainsnapshot.h|  9 
src/util.c  | 47 +
src/util.h  | 16 ++
9 files changed, 168 insertions(+)
create mode 100644 data/org.libvirt.DomainSnapshot.xml
create mode 100644 src/domainsnapshot.c
create mode 100644 src/domainsnapshot.h

diff --git a/src/util.c b/src/util.c
index 103bb29..2be616c 100644
--- a/src/util.c
+++ b/src/util.c
@@ -279,6 +279,53 @@ virtDBusUtilVirDomainListFree(virDomainPtr *domains)
g_free(domains);
}

+virDomainSnapshotPtr
+virtDBusUtilVirDomainSnapshotFromBusPath(virConnectPtr connection,
+ const gchar *path,
+ const gchar *domainSnapshotPath)
+{
+g_autofree gchar *domainName = NULL;
+g_autofree gchar *snapshotName = NULL;
+g_autoptr(virDomain) domain = NULL;
+gsize prefixLen = strlen(domainSnapshotPath) + 1;
+gchar** strings = g_strsplit(path + prefixLen, "_", 2);
+


This won't work correctly with domain names containing "_" - you will
split in the domain name instead.

Using UUIDs instead of names should give you a fixed point where to
split.


+domainName = virtDBusUtilDecodeStr(strings[0]);
+snapshotName = virtDBusUtilDecodeStr(strings[1]);
+
+domain = virDomainLookupByName(connection, domainName);
+
+return virDomainSnapshotLookupByName(domain, snapshotName, 0); // TODO 
flags for external?
+}
+


Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 1/2] Revert "domcaps: Treat host models as case-insensitive strings"

2019-10-08 Thread Jiri Denemark
This reverts commit 2d8721e2606806164782028ecf1ee33a9bbaa8fe.

This fix was both incomplete and too general. It only fixed domain
startup, but libvirt would still report empty list of supported CPU
models with recent QEMU for ppc64. On the other hand, while ppc64 QEMU
ignores case when looking up CPU model names, x86_64 QEMU does case
sensitive lookup. Without reverting this patch, libvirt could happily
accept CPU model names which are not supported by QEMU.

Signed-off-by: Jiri Denemark 
---
 src/conf/domain_capabilities.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 1000d8b969..fe93388cce 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -278,7 +278,7 @@ virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr 
cpuModels,
 return NULL;
 
 for (i = 0; i < cpuModels->nmodels; i++) {
-if (STRCASEEQ(cpuModels->models[i].name, name))
+if (STREQ(cpuModels->models[i].name, name))
 return cpuModels->models + i;
 }
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 0/2] Fix ppc64 CPU configuration for QEMU 2.11+

2019-10-08 Thread Jiri Denemark
The original fix was both incomplete and too general. It only fixed
domain startup, but libvirt would still report empty list of supported
CPU models with recent QEMU for ppc64. On the other hand, while ppc64
QEMU ignores case when looking up CPU model names, x86_64 QEMU does
case sensitive lookup.

Jiri Denemark (2):
  Revert "domcaps: Treat host models as case-insensitive strings"
  qemu: Adapt to changed ppc64 CPU model names

 src/conf/domain_capabilities.c|  2 +-
 src/qemu/qemu_capabilities.c  | 26 +--
 src/qemu/qemu_capabilities.h  |  3 ++-
 src/qemu/qemu_process.c   |  2 +-
 .../qemu_2.12.0.ppc64.xml |  6 -
 .../caps_2.12.0.ppc64.xml | 12 -
 .../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 12 -
 .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 12 -
 .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 12 -
 9 files changed, 57 insertions(+), 30 deletions(-)

-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 2/2] qemu: Adapt to changed ppc64 CPU model names

2019-10-08 Thread Jiri Denemark
QEMU 2.11 for ppc64 changed all CPU model names to lower case. Since
libvirt can't change the model names for compatibility reasons, we need
to translate the matching lower case models to the names known by
libvirt.

Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c  | 26 +--
 src/qemu/qemu_capabilities.h  |  3 ++-
 src/qemu/qemu_process.c   |  2 +-
 .../qemu_2.12.0.ppc64.xml |  6 -
 .../caps_2.12.0.ppc64.xml | 12 -
 .../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 12 -
 .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 12 -
 .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 12 -
 8 files changed, 56 insertions(+), 29 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 46a056340b..a340973f14 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2437,7 +2437,8 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemuCaps,
 
 
 virDomainCapsCPUModelsPtr
-virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon)
+virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon,
+   virArch arch)
 {
 virDomainCapsCPUModelsPtr models = NULL;
 qemuMonitorCPUDefInfoPtr *cpus = NULL;
@@ -2447,6 +2448,27 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon)
 if ((ncpus = qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0)
 return NULL;
 
+/* QEMU 2.11 for Power renamed all CPU models to lower case, we need to
+ * translate them back to libvirt's upper case model names. */
+if (ARCH_IS_PPC(arch)) {
+VIR_AUTOSTRINGLIST libvirtModels = NULL;
+char **name;
+
+if (virCPUGetModels(arch, &libvirtModels) < 0)
+goto error;
+
+for (name = libvirtModels; name && *name; name++) {
+for (i = 0; i < ncpus; i++) {
+if (STRCASENEQ(cpus[i]->name, *name))
+continue;
+
+VIR_FREE(cpus[i]->name);
+if (VIR_STRDUP(cpus[i]->name, *name) < 0)
+goto error;
+}
+}
+}
+
 if (!(models = virDomainCapsCPUModelsNew(ncpus)))
 goto error;
 
@@ -2486,7 +2508,7 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps,
 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS))
 return 0;
 
-if (!(models = virQEMUCapsFetchCPUDefinitions(mon)))
+if (!(models = virQEMUCapsFetchCPUDefinitions(mon, qemuCaps->arch)))
 return -1;
 
 if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM))
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 72da3691f2..6c77b9d943 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -567,7 +567,8 @@ int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
  virDomainCapsCPUUsable usable);
 virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
virDomainVirtType type);
-virDomainCapsCPUModelsPtr virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon);
+virDomainCapsCPUModelsPtr virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon,
+ virArch arch);
 
 typedef enum {
 /* Host CPU definition reported in domain capabilities. */
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index a50cd54393..7774a82972 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4379,7 +4379,7 @@ qemuProcessFetchCPUDefinitions(virQEMUDriverPtr driver,
 if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
 goto error;
 
-models = virQEMUCapsFetchCPUDefinitions(priv->mon);
+models = virQEMUCapsFetchCPUDefinitions(priv->mon, vm->def->os.arch);
 
 if (qemuDomainObjExitMonitor(driver, vm) < 0)
 goto error;
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml 
b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
index 99de2b0a8e..e8d3c22337 100644
--- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
+++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
@@ -29,7 +29,11 @@
 
   POWER8
 
-
+
+  POWER9
+  POWER8
+  POWER7
+
   
   
 
diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml 
b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
index fd9ae0bcb8..ede28439cd 100644
--- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml
@@ -163,12 +163,12 @@
   
   
   
-  
+  
   
-  
+  
   
   
-  
+  
   
   
   
@@ -601,12 +601,12 @@
   
   
   
-  
+  
   
-  
+  
   
   
-  
+  
   
   
   
diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml 
b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml
index 61be1df782..221e0d1756 100644
--- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml
+++ b/tests/qemucapabi

Re: [libvirt] [PATCH 1/3] conf: Set rebootTimeout valid range to 0..0xffff

2019-10-08 Thread Han Han
On Tue, Oct 8, 2019 at 5:50 PM Michal Privoznik  wrote:

> On 10/8/19 10:36 AM, Han Han wrote:
> > Adjust valid range of rebootTimeout according to qemu-4.0.0 commit
> > ee5d0f89de3.
> >
> > Signed-off-by: Han Han 
> > ---
> >   src/conf/domain_conf.c | 6 --
> >   1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> > index a53cd6a725..57ab254f52 100644
> > --- a/src/conf/domain_conf.c
> > +++ b/src/conf/domain_conf.c
> > @@ -18090,10 +18090,12 @@ virDomainDefParseBootXML(xmlXPathContextPtr
> ctxt,
> >   /* that was really just for the check if it is there */
> >
> >   if (virStrToLong_i(tmp, NULL, 0, &def->os.bios.rt_delay) <
> 0 ||
> > -def->os.bios.rt_delay < -1 || def->os.bios.rt_delay >
> 65535) {
> > +def->os.bios.rt_delay < 0 || def->os.bios.rt_delay >
> 65535) {
> >   virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> >  _("invalid value for rebootTimeout, "
> > - "must be in range [-1,65535]"));
> > + "must be in range [0,65535]. "
> > + "To disable reboot, "
> > + "just remove this attribute."));
> >   return -1;
> >   }
> >   def->os.bios.rt_set = true;
> >
>
> Firstly¸patch 2/3 must come before 1/3 because we require patches to be
> able to compile & run 'make syntax-check check' successfuly after every
> single one.
>
> But more serious problem is, that we document that -1 is a special value
> that disables automatic reboot. So did QEMU just lose functionality
> there? If they have some other way to prevent automatic reboot on failed
>
Yes.
The qemu commit ee5d0f89de3 says:
" This patch checks for conversion errors properly, and reject all values
  outside 0...0x."
And check the definition of fw_cfg_reboot(), you can found the default value
passed to pointer argument is alwarys -1 before or after the commit.

Test on qemu-4.0.0:
# qemu-system-x86_64 -boot reboot-timeout=-1 /tmp/new
WARNING: Image format was not specified for '/tmp/new' and probing guessed
raw.
 Automatically detecting the format is dangerous for raw images,
write operations on block 0 will be restricted.
 Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-x86_64: reboot timeout is invalid,it should be a value between
0 and 65535

# echo $?
1

> boot, then we need to use that if user requested -1.
>
> Michal
>


-- 
Best regards,
---
Han Han
Quality Engineer
Redhat.

Email: h...@redhat.com
Phone: +861065339333
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 00/22] qemu: Store default CPU in domain XML

2019-10-08 Thread Jiri Denemark
On Mon, Oct 07, 2019 at 17:24:11 +0200, Andrea Bolognani wrote:
> On Thu, 2019-10-03 at 16:00 +0200, Jiri Denemark wrote:
> > When starting a domain without a CPU model specified in the domain XML,
> > QEMU will choose a default one. Which is fine unless the domain gets
> > migrated to another host because libvirt doesn't perform any CPU ABI
> > checks and the virtual CPU provided by QEMU on the destination host can
> > differ from the one on the source host.
> > 
> > With QEMU 4.2.0 we can probe for the default CPU model used by QEMU for
> > a particular machine type and store it in the domain XML. This way the
> > chosen CPU model is more visible to users and libvirt will make sure
> > the guest will see the exact same CPU after migration.
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=1598151
> > https://bugzilla.redhat.com/show_bug.cgi?id=1598162
> 
> Unfortunately this will break all ppc64 guests that have been defined
> without specifying a CPU model, because it will result in something
> like
> 
>   
> power8
>   
> 
> being added to the domain XML, which in turn at runtime will cause
> 
>   error: internal error: Unknown CPU model power8

This should be fixed by an old forgotten series "Fix ppc64 CPU
configuration for QEMU 2.11+". I'll send a rebased version of that
series and once approved, I will base a v2 of this series on top.

Thanks for checking the behaviour on a different architecture.

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 3/3] qemu: Adapt to changed ppc64 CPU model names

2019-10-08 Thread Jiri Denemark
Resurrecting an old forgotten series... It should fix PPC64 issues with
my recent "qemu: Store default CPU in domain XML" patches.

On Tue, May 22, 2018 at 16:51:44 +0200, Andrea Bolognani wrote:
> On Tue, 2018-05-22 at 15:46 +0200, Jiri Denemark wrote:
> > On Tue, May 22, 2018 at 11:02:17 +0200, Andrea Bolognani wrote:
> > > On Thu, 2018-05-17 at 17:33 +0200, Jiri Denemark wrote:
> > > [...]
> > > > --- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
> > > > +++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
> > > > @@ -25,7 +25,11 @@
> > > >  
> > > >POWER8
> > > >  
> > > 
> > > This is quite suspicious - it looks like a proper CPU model, but
> > > it's really a compatibility mode, so it should be lowercase rather
> > > than uppercase. You certainly won't be able to use
> > > 
> > >   
  POWER8


means  CPU definition can be used in domain XML
and the CPU model corresponding to the host CPU is POWER8. This is not
supposed to be translated to


  POWER8


The interpretation of the domain capabilities snippet is either



or


  POWER8


And both will work, although the first one will not do what a user would
expect due to the way host-model is misused for ppc. There's just no way
of reporting this misuse in domain capabilities now. Perhaps we will
come up with a way to solve this in the future. But we can stick with
the current state now.

...
> You have a point. The current situation is a bit confusing, again
> because of the misuse of host-model, but it's probably better to
> stick with the confusing situation we've grown used to rather than
> change things around for cosmetic reasons.
> 
> Plus, it's already strongly recommended to use
> 
>   
> power8
>   
> 
> rather than
> 
>   
> POWER8
>   
> 
> because the resulting QEMU command line is more idiomatic, so
> applications and users sticking with the best practices wouldn't
> benefit from the change either way.
>
> I disagree on having a mixture of uppercase and lowercase model,
> though: that's just bad UI, and a clear violation of the principle
> of least surprise; if and when a 'power10' CPU model will be added
> to QEMU, we should introduce a suitable 'POWER10' alias along with
> the existing ones.

OK, we can revisit this discussion later when a new power CPU model is
introduced.

I'll rebase this series on current master and resend it.

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 00/22] qemu: Store default CPU in domain XML

2019-10-08 Thread Andrea Bolognani
On Thu, 2019-10-03 at 16:00 +0200, Jiri Denemark wrote:
> When starting a domain without a CPU model specified in the domain XML,
> QEMU will choose a default one. Which is fine unless the domain gets
> migrated to another host because libvirt doesn't perform any CPU ABI
> checks and the virtual CPU provided by QEMU on the destination host can
> differ from the one on the source host.
> 
> With QEMU 4.2.0 we can probe for the default CPU model used by QEMU for
> a particular machine type and store it in the domain XML. This way the
> chosen CPU model is more visible to users and libvirt will make sure
> the guest will see the exact same CPU after migration.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1598151
> https://bugzilla.redhat.com/show_bug.cgi?id=1598162

Also, this is definitely a user-visible change significant enough to
be documented in the release notes, so please provide a patch that
does so :)

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [dockerfiles PATCH] Refresh after adding Meson, GLib and flake8

2019-10-08 Thread Andrea Bolognani
The corresponding libvirt-jenkins-ci commit is 97340ae946d4.

Signed-off-by: Andrea Bolognani 
---
Pushed under the Dockerfiles refresh rule.

 buildenv-libosinfo-debian-10.zip   | Bin 629 -> 638 bytes
 buildenv-libosinfo-debian-sid.zip  | Bin 629 -> 638 bytes
 buildenv-libosinfo-fedora-29.zip   | Bin 502 -> 507 bytes
 buildenv-libosinfo-fedora-30.zip   | Bin 564 -> 569 bytes
 buildenv-libosinfo-fedora-rawhide.zip  | Bin 522 -> 527 bytes
 buildenv-libvirt-centos-7.zip  | Bin 662 -> 671 bytes
 buildenv-libvirt-debian-10-cross-aarch64.zip   | Bin 956 -> 981 bytes
 buildenv-libvirt-debian-10-cross-armv6l.zip| Bin 949 -> 976 bytes
 buildenv-libvirt-debian-10-cross-armv7l.zip| Bin 954 -> 978 bytes
 buildenv-libvirt-debian-10-cross-i686.zip  | Bin 952 -> 977 bytes
 buildenv-libvirt-debian-10-cross-mips.zip  | Bin 947 -> 972 bytes
 buildenv-libvirt-debian-10-cross-mips64el.zip  | Bin 960 -> 984 bytes
 buildenv-libvirt-debian-10-cross-mipsel.zip| Bin 952 -> 978 bytes
 buildenv-libvirt-debian-10-cross-ppc64le.zip   | Bin 961 -> 985 bytes
 buildenv-libvirt-debian-10-cross-s390x.zip | Bin 951 -> 978 bytes
 buildenv-libvirt-debian-10.zip | Bin 843 -> 868 bytes
 buildenv-libvirt-debian-9-cross-aarch64.zip| Bin 964 -> 991 bytes
 buildenv-libvirt-debian-9-cross-armv6l.zip | Bin 955 -> 983 bytes
 buildenv-libvirt-debian-9-cross-armv7l.zip | Bin 961 -> 988 bytes
 buildenv-libvirt-debian-9-cross-mips.zip   | Bin 954 -> 978 bytes
 buildenv-libvirt-debian-9-cross-mips64el.zip   | Bin 966 -> 989 bytes
 buildenv-libvirt-debian-9-cross-mipsel.zip | Bin 958 -> 986 bytes
 buildenv-libvirt-debian-9-cross-ppc64le.zip| Bin 966 -> 990 bytes
 buildenv-libvirt-debian-9-cross-s390x.zip  | Bin 958 -> 984 bytes
 buildenv-libvirt-debian-9.zip  | Bin 846 -> 871 bytes
 buildenv-libvirt-debian-sid-cross-aarch64.zip  | Bin 956 -> 981 bytes
 buildenv-libvirt-debian-sid-cross-armv6l.zip   | Bin 948 -> 976 bytes
 buildenv-libvirt-debian-sid-cross-armv7l.zip   | Bin 954 -> 978 bytes
 buildenv-libvirt-debian-sid-cross-i686.zip | Bin 952 -> 980 bytes
 buildenv-libvirt-debian-sid-cross-mips.zip | Bin 947 -> 975 bytes
 buildenv-libvirt-debian-sid-cross-mips64el.zip | Bin 960 -> 988 bytes
 buildenv-libvirt-debian-sid-cross-mipsel.zip   | Bin 951 -> 980 bytes
 buildenv-libvirt-debian-sid-cross-ppc64le.zip  | Bin 961 -> 985 bytes
 buildenv-libvirt-debian-sid-cross-s390x.zip| Bin 951 -> 978 bytes
 buildenv-libvirt-debian-sid.zip| Bin 843 -> 868 bytes
 buildenv-libvirt-fedora-29.zip | Bin 706 -> 731 bytes
 buildenv-libvirt-fedora-30.zip | Bin 821 -> 854 bytes
 buildenv-libvirt-fedora-rawhide.zip| Bin 726 -> 752 bytes
 buildenv-libvirt-ubuntu-16.zip | Bin 854 -> 877 bytes
 buildenv-libvirt-ubuntu-18.zip | Bin 855 -> 877 bytes
 40 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/buildenv-libosinfo-debian-10.zip b/buildenv-libosinfo-debian-10.zip
index 
99f51211237b4baa509307809e52669c8fc0e6b0..4650523d4663f138366562b67b3caa29bcaf4780
 100644
GIT binary patch
delta 589
zcmV-T0@6aWAK2mr2YNKaS=Q1#RS003_V000UA8~{XbV{2t{W@&6?
zRa6N80~d3gT^DnlU3GX1009K(0{{R7=mP)%b(G(4(=ZUn-}_fs0&RfmZY>BQBpyI(
zB_8Ocvc6SJj(ttMIzD4xO8ei>=_nEx*HRSa^Yz8PpNrLh{SRTFvdVv+-i}7A^-{ng
zU?g!j|Mvas@^P`cUp~y2cV9eu>j|RLWcMJhuEb^}@=}3h4J5i?6cxC!iDVb*s0;{s
z9B!~ak#bH*=~4dukP$StEqIf9n-_!gQXQd2zb)Wa?Vx}I=BqPasnisZ%;yFNWYIHK
zE2$xp-CCW09Zg)-N;mxMO!RKRB6{vptu-g6;sl7`z}=|rfY44F)RGV#zh(0$CrL4w
zW8?bG3_Dw?sGFQ@X<$DT^~W-=ZG?cy62{|na(iJ@erA`%r-WYiJIZpxF3ct$%3|4(
zp32JdlxF47x>@;8C#54h2x6}#N7IrSYUKvC;S%zHVl5PE3u#bu9;led+=@?1R-JW*
zDM69ubsZq`n1o$jXrXYV2L1aol`co*f|TEocp;v}2*10mavze80Nmk3dBE_HllYjFdlZ(cG!sk0~l%uSB&X@dE!t-A>4vKT!BP)h*<9s?8r000O8u4_n7SOrk^
b)BykhZ<8njBm)<7oRd!iAO;u$0W}*q2

delta 580
zcmV-K0=xbG1oZ@eP)h>@6aWAK2mtbJDNpS*)6mNS00315000UA8~{XbV{2t{W@&6?
zRa6N81J^rtUDrEyU3GX1009K(0{{R7=mP)%b(B$W(=ZUn-}@;nfi{NfZtW04NIZbn
zN<7d>WqqrdT>F}sIzD4xLi_D;I*P=_wG>79{e7|jzVj`AR*&C=fvr{kz)#LJMzI^!P(OXXtl_uMPxVjRXk;p>@k`<6>gHcrA#wL<&sG>3;
zSJC4&O^0?8vU+-8?}c54w$#j_*SL5fMi}bI3SCj
zsai=5k?hWY>TEP|RV!WdwKLKC0gLFlrAli~%$5@%f&;fv*#V)wG^iyZI=;*LcTSRG
zFrSUy2G*})<9T5>ckg`rk%P#Z3PAurZKp*D~PHRpkfc?^m)uigNW
zI}iJ+a8bgMYV`MIDqZ${LCSAPyxh)WgkNn|`A(CL0Nhrh+(x+n)EZ={Q%>=V(b;C$
zL;6b|p~0@)Von{yf%5;U35<|)E3VV{$1Cv${PX(zX0m=-$PZ%j_U83?GaX-xTOfV=
zlGjNrm7V+xH~Dl=eai1_)kZicfAj}XO928N0~7!N00;o`Z7EOfG}F+_0RRA1lQ9A$
S1J^rtlUM>E1`h%N0002R6AUW=

diff --git a/buildenv-libosinfo-debian-sid.zip 
b/buildenv-libosinfo-debian-sid.zip
index 
d006478897bc06ac3a7d95f9d41781d2ae5f2846..0478a9e5b2adc9dc8aa823a1cd15de125561680c
 100644
GIT binary patch
delta 589
zcmV-T0@6aWAK2mr2YNKZ=|-89qz003|W000UA8~{XbV{2t{W@&6?
zRa6N80~m9hT^MtmU3GX1009K(0{{R7=mP)%b(G(4(=ZUn-}_fs0&NV{9qkZ8NIZbn
zN<7d>Wqqrd9Q&Ghb$rIYl=i>J=_nEx*HRSa^Yz8PpNrLh!*^kzvdVu-){I80^-{ng
zU?g!r|N8CA@@cVpSU%2|_n$p_>j|RLWc

[libvirt] [PATCH 1/1] qemu: fix type of default video device

2019-10-08 Thread Pavel Mores
If a graphics device is added to XML that has no video device, libvirt
automatically adds a video device which is always of type 'cirrus', even if
the underlying qemu doesn't support cirrus.

This patch refines a bit the decision about the type of the video device.
Based on QEMU capabilities, cirrus is still preferred but only added if QEMU
supports it, otherwise QXL is preferred for SPICE and Bochs for UEFI guests.
VGA is used as a fallback.

(For some info about QEMU display devices see e.g.
https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/ .)

https://bugzilla.redhat.com/show_bug.cgi?id=1668141

Signed-off-by: Pavel Mores 
---
 src/qemu/qemu_domain.c | 21 +
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index b4175a846e..a37ff1d384 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -7821,7 +7821,8 @@ qemuDomainDeviceNetDefPostParse(virDomainNetDefPtr net,
 
 static int
 qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video,
-  const virDomainDef *def)
+  const virDomainDef *def,
+  virQEMUCapsPtr qemuCaps)
 {
 if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) {
 if (ARCH_IS_PPC64(def->os.arch))
@@ -7830,8 +7831,20 @@ qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr 
video,
  qemuDomainIsRISCVVirt(def) ||
  ARCH_IS_S390(def->os.arch))
 video->type = VIR_DOMAIN_VIDEO_TYPE_VIRTIO;
-else
-video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
+else {
+if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA)) {
+video->type = VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
+} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE)
+&& virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) {
+video->type = VIR_DOMAIN_VIDEO_TYPE_QXL;
+video->vgamem = QEMU_QXL_VGAMEM_DEFAULT;
+} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_BOCHS_DISPLAY)
+&& def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) {
+video->type = VIR_DOMAIN_VIDEO_TYPE_BOCHS;
+} else {
+video->type = VIR_DOMAIN_VIDEO_TYPE_VGA;
+}
+}
 }
 
 if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
@@ -7926,7 +7939,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
 break;
 
 case VIR_DOMAIN_DEVICE_VIDEO:
-ret = qemuDomainDeviceVideoDefPostParse(dev->data.video, def);
+ret = qemuDomainDeviceVideoDefPostParse(dev->data.video, def, 
qemuCaps);
 break;
 
 case VIR_DOMAIN_DEVICE_PANIC:
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 0/1] qemu: fix type of default video device

2019-10-08 Thread Pavel Mores
This patch does seem to fix the original bug as it was reported, however it
also raises the broader question of how exactly to decide under various
circumstances what the type of the video device we're silently adding
should be.

This patch is meant to be an initial suggestion to kick off discussion.  If
you don't like anything about it please comment. :-)

Pavel Mores (1):
  qemu: fix type of default video device

 src/qemu/qemu_domain.c | 21 +
 1 file changed, 17 insertions(+), 4 deletions(-)

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 08/22] qemu: Flatten qemuMonitorCPUDefs.cpus

2019-10-08 Thread Ján Tomko

On Thu, Oct 03, 2019 at 04:00:26PM +0200, Jiri Denemark wrote:

Let's store qemuMonitorCPUDefInfo directly in the array of CPUs in
qemuMonitorCPUDefs rather then using an array of pointers.

Signed-off-by: Jiri Denemark 
---
src/qemu/qemu_capabilities.c | 8 
src/qemu/qemu_monitor.c  | 5 ++---
src/qemu/qemu_monitor.h  | 2 +-
src/qemu/qemu_monitor_json.c | 7 +--
tests/qemumonitorjsontest.c  | 8 
5 files changed, 12 insertions(+), 18 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH] guests: add flake8 to libvirt project

2019-10-08 Thread Fabiano Fidêncio
On Tue, Oct 8, 2019 at 11:57 AM Daniel P. Berrangé  wrote:
>
> Signed-off-by: Daniel P. Berrangé 
> ---
>  guests/vars/projects/libvirt.yml | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/guests/vars/projects/libvirt.yml 
> b/guests/vars/projects/libvirt.yml
> index 04c3ecd..8fcb286 100644
> --- a/guests/vars/projects/libvirt.yml
> +++ b/guests/vars/projects/libvirt.yml
> @@ -9,6 +9,7 @@ packages:
>- dtrace
>- dwarves
>- ebtables
> +  - flake8
>- fuse
>- glib2
>- glusterfs
> --
> 2.21.0
>
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

Reviewed-by: Fabiano Fidêncio 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH] guests: add flake8 to libvirt project

2019-10-08 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé 
---
 guests/vars/projects/libvirt.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml
index 04c3ecd..8fcb286 100644
--- a/guests/vars/projects/libvirt.yml
+++ b/guests/vars/projects/libvirt.yml
@@ -9,6 +9,7 @@ packages:
   - dtrace
   - dwarves
   - ebtables
+  - flake8
   - fuse
   - glib2
   - glusterfs
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 1/3] conf: Set rebootTimeout valid range to 0..0xffff

2019-10-08 Thread Michal Privoznik

On 10/8/19 10:36 AM, Han Han wrote:

Adjust valid range of rebootTimeout according to qemu-4.0.0 commit
ee5d0f89de3.

Signed-off-by: Han Han 
---
  src/conf/domain_conf.c | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a53cd6a725..57ab254f52 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -18090,10 +18090,12 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt,
  /* that was really just for the check if it is there */
  
  if (virStrToLong_i(tmp, NULL, 0, &def->os.bios.rt_delay) < 0 ||

-def->os.bios.rt_delay < -1 || def->os.bios.rt_delay > 65535) {
+def->os.bios.rt_delay < 0 || def->os.bios.rt_delay > 65535) {
  virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
 _("invalid value for rebootTimeout, "
- "must be in range [-1,65535]"));
+ "must be in range [0,65535]. "
+ "To disable reboot, "
+ "just remove this attribute."));
  return -1;
  }
  def->os.bios.rt_set = true;



Firstly¸patch 2/3 must come before 1/3 because we require patches to be 
able to compile & run 'make syntax-check check' successfuly after every 
single one.


But more serious problem is, that we document that -1 is a special value 
that disables automatic reboot. So did QEMU just lose functionality 
there? If they have some other way to prevent automatic reboot on failed 
boot, then we need to use that if user requested -1.


Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 0/3] Update rebootTimeout range to 0..0xffff

2019-10-08 Thread Michal Privoznik

On 10/8/19 10:36 AM, Han Han wrote:

Since qemu v4.0.0(commit ee5d0f89de3), reboot-timeout valid range was
set 0~0x. Update libvirt codes, docs, tests for that change.

I am not sure if po files should be updated. If so, please point it out.


No, they are refreshed just before release.
However, I'm not sure we can do this, see 1/3.



Han Han (3):
   conf: Set rebootTimeout valid range to 0..0x
   tests: Remove test reboot-timeout-disabled
   docs: Update docs on rebootTimeout valid value range

  docs/formatdomain.html.in |  5 ++--
  src/conf/domain_conf.c|  6 ++--
  .../reboot-timeout-disabled.args  | 28 ---
  .../reboot-timeout-disabled.xml   | 24 
  .../reboot-timeout-disabled.xml   | 26 -
  5 files changed, 6 insertions(+), 83 deletions(-)
  delete mode 100644 tests/qemuxml2argvdata/reboot-timeout-disabled.args
  delete mode 100644 tests/qemuxml2argvdata/reboot-timeout-disabled.xml
  delete mode 100644 tests/qemuxml2xmloutdata/reboot-timeout-disabled.xml



Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 1/2] qemu: Fix @vm locking issue when connecting to the monitor

2019-10-08 Thread Michal Privoznik
When connecting to qemu's monitor the @vm object is unlocked.
This is justified - connecting may take a long time and we don't
want to wait with the domain object locked. However, just before
the domain object is locked again, the monitor's FD is registered
in the event loop. Therefore, there is a small window where the
event loop has a chance to call a handler for an event that
occurred on the monitor FD but vm is not initalized properly just
yet (i.e. priv->mon is not set). For instance, if there's an
incoming migration, qemu creates its socket but then fails to
initialize (for various reasons, I'm reproducing this by using
hugepages but leaving the HP pool empty) then the following may
happen:

1) qemuConnectMonitor() unlocks @vm

2) qemuMonitorOpen() connects to the monitor socket and by
   calling qemuMonitorOpenInternal() which subsequently calls
   qemuMonitorRegister() the event handler is installed

3) qemu fails to initialize and exit()-s, which closes the
   monitor

4) The even loop sees EOF on the monitor and the control gets to
   qemuProcessEventHandler() which locks @vm and calls
   processMonitorEOFEvent() which then calls
   qemuMonitorLastError(priv->mon). But priv->mon is not set just
   yet.

5) qemuMonitorLastError() dereferences NULL pointer

The solution is to unlock the domain object for a shorter time
and most importantly, register event handler with domain object
locked so that any possible event processing is done only after
@vm's private data was properly initialized.

This issue is also mentioned in v4.2.0-99-ga5a777a8ba.

Since we are unlocking @vm and locking it back, another thread
might have destroyed the domain meanwhile. Therefore we have to
check if domain is still activem, and we have to do it at the
same place where domain lock is acquired back, i.e. in
qemuMonitorOpen(). This creates a small problem for our test
suite which calls qemuMonitorOpen() directly and passes @vm which
has no definition. This makes virDomainObjIsActive() call crash.
Fortunately, allocating empty domain definition is sufficient.

Signed-off-by: Michal Privoznik 
---

This is an alternative approach to:

https://www.redhat.com/archives/libvir-list/2019-September/msg00749.html

 src/qemu/qemu_monitor.c  | 33 +
 src/qemu/qemu_process.c  | 12 
 tests/qemumonitortestutils.c |  2 ++
 3 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 58de26a276..a53d3b1d60 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -810,35 +810,52 @@ qemuMonitorOpen(virDomainObjPtr vm,
 qemuMonitorCallbacksPtr cb,
 void *opaque)
 {
-int fd;
+int fd = -1;
 bool hasSendFD = false;
-qemuMonitorPtr ret;
+qemuMonitorPtr ret = NULL;
 
 timeout += QEMU_DEFAULT_MONITOR_WAIT;
 
+/* Hold an extra reference because we can't allow 'vm' to be
+ * deleted until the monitor gets its own reference. */
+virObjectRef(vm);
+
 switch (config->type) {
 case VIR_DOMAIN_CHR_TYPE_UNIX:
 hasSendFD = true;
-if ((fd = qemuMonitorOpenUnix(config->data.nix.path,
-  vm->pid, retry, timeout)) < 0)
-return NULL;
+virObjectUnlock(vm);
+fd = qemuMonitorOpenUnix(config->data.nix.path,
+ vm->pid, retry, timeout);
+virObjectLock(vm);
 break;
 
 case VIR_DOMAIN_CHR_TYPE_PTY:
-if ((fd = qemuMonitorOpenPty(config->data.file.path)) < 0)
-return NULL;
+virObjectUnlock(vm);
+fd = qemuMonitorOpenPty(config->data.file.path);
+virObjectLock(vm);
 break;
 
 default:
 virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to handle monitor type: %s"),
virDomainChrTypeToString(config->type));
-return NULL;
+break;
+}
+
+if (fd < 0)
+goto cleanup;
+
+if (!virDomainObjIsActive(vm)) {
+virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+   _("domain is not running"));
+goto cleanup;
 }
 
 ret = qemuMonitorOpenInternal(vm, fd, hasSendFD, cb, opaque);
+ cleanup:
 if (!ret)
 VIR_FORCE_CLOSE(fd);
+virObjectUnref(vm);
 return ret;
 }
 
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index a50cd54393..b303e5ba05 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1955,13 +1955,8 @@ qemuConnectMonitor(virQEMUDriverPtr driver, 
virDomainObjPtr vm, int asyncJob,
  * 1GiB of guest RAM. */
 timeout = vm->def->mem.total_memory / (1024 * 1024);
 
-/* Hold an extra reference because we can't allow 'vm' to be
- * deleted until the monitor gets its own reference. */
-virObjectRef(vm);
-
 ignore_value(virTimeMillisNow(&priv->monStart));
 monConfig = virObjectRef(priv->monConfig);
-virObj

[libvirt] [PATCH 2/2] Revert "qemu: Obtain reference on monConfig"

2019-10-08 Thread Michal Privoznik
This reverts commit a5a777a8bae61cb9e41c4dcd12d2962ad1a65a0d.

After previous commit the domain won't disappear while connecting
to monitor. There's no need to ref monitor config then.

Signed-off-by: Michal Privoznik 
---
 src/qemu/qemu_process.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b303e5ba05..4d26b5a305 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1941,7 +1941,6 @@ qemuConnectMonitor(virQEMUDriverPtr driver, 
virDomainObjPtr vm, int asyncJob,
 qemuDomainObjPrivatePtr priv = vm->privateData;
 qemuMonitorPtr mon = NULL;
 unsigned long long timeout = 0;
-virDomainChrSourceDefPtr monConfig;
 
 if (qemuSecuritySetDaemonSocketLabel(driver->securityManager, vm->def) < 
0) {
 VIR_ERROR(_("Failed to set security context for monitor for %s"),
@@ -1956,10 +1955,9 @@ qemuConnectMonitor(virQEMUDriverPtr driver, 
virDomainObjPtr vm, int asyncJob,
 timeout = vm->def->mem.total_memory / (1024 * 1024);
 
 ignore_value(virTimeMillisNow(&priv->monStart));
-monConfig = virObjectRef(priv->monConfig);
 
 mon = qemuMonitorOpen(vm,
-  monConfig,
+  priv->monConfig,
   retry,
   timeout,
   &monitorCallbacks,
@@ -1973,7 +1971,6 @@ qemuConnectMonitor(virQEMUDriverPtr driver, 
virDomainObjPtr vm, int asyncJob,
 qemuProcessMonitorLogFree);
 }
 
-virObjectUnref(monConfig);
 priv->monStart = 0;
 priv->mon = mon;
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 0/2] qemu: Fix @vm locking issue when connecting to the monitor

2019-10-08 Thread Michal Privoznik
See 1/2 for explanation.

Michal Prívozník (2):
  qemu: Fix @vm locking issue when connecting to the monitor
  Revert "qemu: Obtain reference on monConfig"

 src/qemu/qemu_monitor.c  | 33 +
 src/qemu/qemu_process.c  | 17 +
 tests/qemumonitortestutils.c |  2 ++
 3 files changed, 28 insertions(+), 24 deletions(-)

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 3/3] docs: Update docs on rebootTimeout valid value range

2019-10-08 Thread Han Han
Signed-off-by: Han Han 
---
 docs/formatdomain.html.in | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 647f96f651..8a6f289df7 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -274,9 +274,8 @@
 Since 0.10.2 (QEMU only) there is
 another attribute, rebootTimeout that controls
 whether and after how long the guest should start booting
-again in case the boot fails (according to BIOS). The value is
-in milliseconds with maximum of 65535 and special
-value -1 disables the reboot.
+again in case the boot fails (according to BIOS). The value is in
+milliseconds from 0 to 65535.
   
 
 
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


  1   2   >