integ/virt/libvirt
Thales Elero Cervi 1f37f8b5d4 Debian: Add build structure for virt/libvirt
This change adds the necessary files for the libvirt package to be built
for Debian.
This change is the new approach for porting this package and will be
replacing an old change that will no longer be valid [1].

All the libvirt related packages (rpm) delivered on CentOS builds of
starlingx were verified to exist or have an equivalent package for the
Debian Bullseye (deb) distro [2], which is based on libvirt 7.0.0.

The upstream Debian packaging, patches and configuration will be used as
is, although the deb_patches directory will contain a patch to add few
starlingx specific files that are required, based on how stx-libvirt [3]
was previously built and delivered to CentOS.
This change will deprecate the starlingx-staging/stx-libvirt repository
and any future starlingx change to libvirt will now be placed here,
on top of debian/7.0.0-3 (bullseye) version.

Earlier (on CentOS) the base point was the libvirt 4.7.0 release and 17
starlingx specific commits were added to deliver new features or fix
bugs. Now, the base point will be the libvirt 7.0.0 release package
already prepared for Debian [4] and those 17 commits port will be
evaluated and done, in case they are still needed.

The patches dir will contain source code patches required for
stx-libvirt, that is, the code that was earlier added on top of 4.7.0
libvirt release to add StarlingX required functionalities.
The work done on this change is simply porting the code changes,
copying it and doing the minimum required updates when it is needed.
If more than one commit (from that list) can be placed on a single
patch, the patch description will contain all the necessary references.

The list of commits follow, where the "-" character indicates that the
commit was dropped now that we are based on 7.0.0:
-8c46e4 conf: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStorageVolDef
-e8c2ae storage: add support for new rbd_list2 method
-dee98c storage: split off code for calling rbd_list
-956103 Revert "qemu: hotplug: Prepare disk source in..."
-97d02f STX: po make: limit thread creation ability of libgomp
-6e8f91 STX: Revert "vsh: Fix broken build on mingw"
 0d92d8 STX: pci-sriov perform limited retry on netlink failures
 c49366 STX: Increase timeout for connecting to monitor
 dedd07 STX: Stop processing memory stats if balloon info hard fails
-e0f897 STX: Allow vcpu pinning with TCG
 d8b544 STX: Adding systemd dependencies against pmon.service
-7bf5a9 STX: Set initial cpu affinity of qemu threads
 28b73b STX: Fixed default libvirtd systemd service
 e4c5a6 STX: DPDK parms handling
 fdf5e7 STX: Drop migration poll times to 10mS
 fbc79d STX: System Logging: set group read permission on log files
 2721c7 STX: CPU pinning not working over live-migration

[1] https://review.opendev.org/c/starlingx/integ/+/824928
[2] https://packages.debian.org/source/bullseye/libvirt
[3] https://github.com/starlingx-staging/stx-libvirt
[4] https://salsa.debian.org/libvirt-team/libvirt/-/tree/debian/7.0.0-3/debian

Test Plan:
PASS: Build the libvirt packages
PASS: Build Debian ISO with libvirt packages
PASS: Bootstrap Debian ISO on AIO-SX
PASS: Ensure libvirt packages are installed (apt list --installed)
PASS: Lock/Unlock AIO-SX *
* Future tests regarding the libvirt/qemu runtime features will be done
once all the pieces are in place in the ISO.

Depends-On: https://review.opendev.org/c/starlingx/root/+/865021

Story: 2010317
Task: 46391

Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
Change-Id: Ib3da0e663336021fa2cfd6b400d1081fc0113348
2022-11-18 18:10:54 -03:00
..
centos remove /data which is not being used 2021-08-16 09:50:38 -04:00
debian Debian: Add build structure for virt/libvirt 2022-11-18 18:10:54 -03:00
libvirt Formatting cleanups in libvirt hook bash script 2019-03-13 09:50:35 -06:00
.gitignore Internal restructuring of stx-integ 2018-08-01 10:06:31 -04:00
PKG-INFO Internal restructuring of stx-integ 2018-08-01 10:06:31 -04:00
README Internal restructuring of stx-integ 2018-08-01 10:06:31 -04:00

README

The Centos 7 libvirt source rpm was taken from:
http://vault.centos.org/centos/7/updates/Source/SPackages/libvirt-1.2.17-13.el7_2.3.src.rpm

It's possible to resolve the source rpm based on the yum repos:
$ yumdownloader --source --urls libvirt

The libvirt source code was forked under .../cgcs/git/libvirt.
Notes: - The branch is based on upstream tag v1.2.17-maint.
       - Then each RedHat patches have been committed one by one in the same
         order specified in the RedHat spec (actually this was automated to use
         'git am' for each of the patches mentionned in the spec).
       - The last patch from RedHat is tagged 'libvirt-1.2.17-13.el7_2.3'.
       - After this tag, all the patches are port from R2.

The libvirt git repository doesn't come with the ./configure script (and its
dependancies).  This has to be built using autoconf (but the libvirt releases
comes with those, releases are generated using 'make dist').

One caveat is that bootstrap is made to be executed in a git tree.  Trying to
execute it out of tree, like the Centos build environment, was unsuccessfull
so far.

The current workaround for now is to commit the configure scripts in the
libvirt git repo:

$ NOCONFIGURE=1 ./autogen.sh --copy
$ NOCONFIGURE=1 ./autogen.sh --copy
# Remove all .gitignore temporarily for showing modified files
$ find . -name .gitignore | xargs rm
$ git add -A
$ git reset HEAD .gitignore
# Repeat last command for all .gitignore files removed
$ git commit

Autogen is executed twice.  The first time soft links are created under
build-aux/.  Running it a second time makes bootstrap copying them and
replacing the soft links (there is most likely a smarter way to do this).