[libvirt PATCH v2] docs: list settings required in creating a new git repo
by Daniel P. Berrangé
The libvirt project has alot of git repositories, and they must all be
configured in the same way, more or less. This page documents the
settings changes that I have made in GitLab and GitHub when configuring
projects, both as a reminder for myself, and to help anyone else doing
the same in future. Also included is info about the repo mirroring on
the libvirt.org server.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
In v2:
- Apply all Andrea's suggestions
docs/docs.html.in | 3 +
docs/newreposetup.rst | 137 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 140 insertions(+)
create mode 100644 docs/newreposetup.rst
diff --git a/docs/docs.html.in b/docs/docs.html.in
index 142c79bfa9..6bdf0c32b8 100644
--- a/docs/docs.html.in
+++ b/docs/docs.html.in
@@ -172,6 +172,9 @@
<dt><a href="testsuites.html">Functional testing</a></dt>
<dd>Testing libvirt with <a href="testtck.html">TCK test suite</a> and
<a href="testapi.html">Libvirt-test-API</a></dd>
+
+ <dt><a href="newreposetup.html">New repo setup</a></dt>
+ <dd>Procedure for configuring new git repositories for libvirt</dd>
</dl>
</div>
diff --git a/docs/newreposetup.rst b/docs/newreposetup.rst
new file mode 100644
index 0000000000..7da13830c0
--- /dev/null
+++ b/docs/newreposetup.rst
@@ -0,0 +1,137 @@
+===============================
+Repository infrastructure setup
+===============================
+
+GitLab Configuration
+====================
+
+The `GitLab organization <https://gitlab.com/libvirt>`_ hosts the master copy
+of all the libvirt Git repositories.
+
+When creating a new repository the following changes to the defaults are
+required under the **Settings** page:
+
+* **General**
+
+ * **Naming, topics, avatar**
+
+ * *Project avatar*: upload ``docs/logos/logo-square-256.png``
+
+ * **Visibility, project features, permissions**
+
+ * *Packages*: disabled
+
+ * *Wiki*: disabled
+
+ * *Snippets*: disabled
+
+ * **Merge Requests**
+
+ * *Merge method*: Fast-forward merge
+
+ * *Merge options*: Enable 'delete source branch' option by default
+
+ * *Merge checks*: Pipelines must succeed
+
+ * **Merge request approvals**
+
+ * *Any eligible user*: Num approvals required == 1
+
+* **Integrations**
+
+ * **Pipelines emails**
+
+ * *Recipients*: ``libvirt-ci(a)redhat.com``
+
+* **Repository**
+
+ * **Push rules**
+
+ * *Do not allow users to remove git tags with git push*: enabled
+
+ * *Commit message*: ``Signed-off-by:``
+
+ * *Branch name*: ``^(master|v.*-maint)$``
+
+ * **Mirroring repositories**
+
+ * *Git repository URL*: ``https://libvirtmirror@github.com/libvirt/$repo.git``
+
+ * *Mirror direction*: push
+
+ * *Password*: see ``/root/libvirt-mirror-github-api-token.txt`` on ``libvirt.org``
+
+ * **Protected branches**
+
+ * *Branch*: ``master``
+
+ * *Allowed to merge*: Developers + Maintainers
+
+ * *Allowed to push*: None (or Developers + Maintainers if MRs not used)
+
+ * *Require approval from code owners*: disabled
+
+GitHub configuration
+====================
+
+The `GitHub organization <https://github.com/libvirt>`_ hosts read-only
+mirrors of all the libvirt Git repositories.
+
+When creating a new repository the following changes to the defaults are
+required under the **Settings** page:
+
+* **Options**
+
+ * **Features**
+
+ * *Wikis*: disabled
+
+ * *Sponsorships*: disabled
+
+ * *Projects*: disabled
+
+ * **Manage access**
+
+ * Add the ``@committers`` team with the role "Write", which
+ grants ``libvirtmirror`` access to sync from gitlab.
+
+ * **Integrations**
+
+ * Check for *Repo Lockdown* (should be set automatically for all projects)
+
+In the master git repository create a file `.github/lockdown.yml` to restrict
+use of issue tracker and pull requests.
+
+
+libvirt.org
+===========
+
+The `libvirt project server <https://libvirt.org>`_ hosts read-only mirrors of
+all the libvirt Git repositories in the directory ``/data/git``.
+
+When creating a new repository the following steps are required:
+
+* Create repo with
+ ::
+
+ $ sudo su -
+ # cd /data/git
+ # mkdir $repo.git
+ # cd $repo.git
+ # git init --bare
+ # touch export
+ # touch git-daemon-export-ok
+ # cd ..
+ # chown -R gitmirror.gitmirror $repo.git
+ # chmod -R g+w $repo.git
+ # find -type d $repo.git | xargs chmod g+s
+
+* Set the ``description`` and ``config`` files following other repos' example
+
+* Setup mirroring
+ ::
+
+ $ sudo su - gitmirror
+ # ./newrepo.sh /data/git/$repo.git
+ # cd mirrors
+ # $HOME/sync-one.sh $repo.git
--
2.24.1
4 years, 8 months
[PATCH] virsh: cmdUndefine: Properly extract delete-storage-volume-snapshots flag
by Peter Krempa
Commit 86608f787ee added the above flag as an alias for ambiguous
'delete-snapshots' flag, but forgot to actually change the code that
extracts it, thus the new version actually doesn't work.
https://bugzilla.redhat.com/show_bug.cgi?id=1821988
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tools/virsh-domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 2dc7c38b55..a203b34996 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -3658,7 +3658,7 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd)
bool checkpoints_metadata = vshCommandOptBool(cmd, "checkpoints-metadata");
bool wipe_storage = vshCommandOptBool(cmd, "wipe-storage");
bool remove_all_storage = vshCommandOptBool(cmd, "remove-all-storage");
- bool delete_snapshots = vshCommandOptBool(cmd, "delete-snapshots");
+ bool delete_snapshots = vshCommandOptBool(cmd, "delete-storage-volume-snapshots");
bool nvram = vshCommandOptBool(cmd, "nvram");
bool keep_nvram = vshCommandOptBool(cmd, "keep-nvram");
/* Positive if these items exist. */
--
2.26.0
4 years, 8 months
[libvirt-dockerfiles PATCH 0/5] Update after libvirt-ci repo rename
by Andrea Bolognani
All pushed as trivial.
Andrea Bolognani (5):
README: Update git URLs to point to GitLab
README: Update after libvirt-ci repo rename
refresh: Update after libvirt-ci repo rename
trigger: Update after libvirt-ci repo rename
monitor: Update after libvirt-ci repo rename
README.md | 5 ++---
monitor | 2 +-
refresh | 4 ++--
trigger | 2 +-
4 files changed, 6 insertions(+), 7 deletions(-)
--
2.25.2
4 years, 8 months
[PATCH 0/3] libxl: Add support for max_event_channels
by Jim Fehlig
This series implements support Xen's max_event_channels setting as proposed
in this thread
https://www.redhat.com/archives/libvir-list/2020-April/msg00376.html
See the individual patches for details.
Jim Fehlig (3):
conf: Add a new xenbus controller option for event channels
libxl: Add support for max_event_channels
xenconfig: Add support for max_event_channels
docs/formatdomain.html.in | 8 +-
docs/schemas/domaincommon.rng | 5 ++
src/conf/domain_conf.c | 15 ++++
src/conf/domain_conf.h | 1 +
src/libxl/libxl_conf.c | 14 +--
src/libxl/xen_xl.c | 57 ++++++------
.../max-eventchannels-hvm.json | 90 +++++++++++++++++++
.../max-eventchannels-hvm.xml | 37 ++++++++
tests/libxlxml2domconfigtest.c | 2 +
tests/xlconfigdata/test-max-eventchannels.cfg | 13 +++
tests/xlconfigdata/test-max-eventchannels.xml | 32 +++++++
tests/xlconfigdata/test-usbctrl.xml | 2 +-
tests/xlconfigtest.c | 2 +
13 files changed, 245 insertions(+), 33 deletions(-)
create mode 100644 tests/libxlxml2domconfigdata/max-eventchannels-hvm.json
create mode 100644 tests/libxlxml2domconfigdata/max-eventchannels-hvm.xml
create mode 100644 tests/xlconfigdata/test-max-eventchannels.cfg
create mode 100644 tests/xlconfigdata/test-max-eventchannels.xml
--
2.26.0
4 years, 8 months
[jenkins-ci PATCH 0/3] Update various files after repo rename
by Andrea Bolognani
All pushed as trivial.
Andrea Bolognani (3):
guests: Update README after repo rename
git-publish: Update config after repo rename
github: Update repo-lockdown config after repo rename
.github/lockdown.yml | 6 +++---
.gitpublish | 2 +-
guests/README.markdown | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
--
2.25.2
4 years, 8 months
[PATCH V2 3/5] cpu: Introduce ARM related structs
by Zhenyu Zheng
Introduce vendor and model struct and related
cleanup functions for ARM cpu.
Signed-off-by: Zhenyu Zheng <zhengzhenyulixi(a)gmail.com>
---
src/cpu/cpu_arm.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c
index ee5802198f..d8f571cae3 100644
--- a/src/cpu/cpu_arm.c
+++ b/src/cpu/cpu_arm.c
@@ -1,6 +1,7 @@
/*
* cpu_arm.c: CPU driver for arm CPUs
*
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
* Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) Canonical Ltd. 2012
*
@@ -23,12 +24,16 @@
#include "viralloc.h"
#include "cpu.h"
+#include "cpu_arm.h"
#include "cpu_map.h"
+#include "virlog.h"
#include "virstring.h"
#include "virxml.h"
#define VIR_FROM_THIS VIR_FROM_CPU
+VIR_LOG_INIT("cpu.cpu_arm");
+
static const virArch archs[] = {
VIR_ARCH_ARMV6L,
VIR_ARCH_ARMV7B,
@@ -36,6 +41,21 @@ static const virArch archs[] = {
VIR_ARCH_AARCH64,
};
+typedef struct _virCPUarmVendor virCPUarmVendor;
+typedef virCPUarmVendor *virCPUarmVendorPtr;
+struct _virCPUarmVendor {
+ char *name;
+ unsigned long value;
+};
+
+typedef struct _virCPUarmModel virCPUarmModel;
+typedef virCPUarmModel *virCPUarmModelPtr;
+struct _virCPUarmModel {
+ char *name;
+ virCPUarmVendorPtr vendor;
+ virCPUarmData data;
+};
+
typedef struct _virCPUarmFeature virCPUarmFeature;
typedef virCPUarmFeature *virCPUarmFeaturePtr;
struct _virCPUarmFeature {
@@ -64,6 +84,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUarmFeature, virCPUarmFeatureFree);
typedef struct _virCPUarmMap virCPUarmMap;
typedef virCPUarmMap *virCPUarmMapPtr;
struct _virCPUarmMap {
+ size_t nvendors;
+ virCPUarmVendorPtr *vendors;
+ size_t nmodels;
+ virCPUarmModelPtr *models;
GPtrArray *features;
};
@@ -81,12 +105,62 @@ virCPUarmMapNew(void)
return map;
}
+static void
+virCPUarmDataClear(virCPUarmData *data)
+{
+ if (!data)
+ return;
+
+ VIR_FREE(data->features);
+}
+
+static void
+virCPUarmDataFree(virCPUDataPtr cpuData)
+{
+ if (!cpuData)
+ return;
+
+ virCPUarmDataClear(&cpuData->data.arm);
+ VIR_FREE(cpuData);
+}
+
+static void
+virCPUarmModelFree(virCPUarmModelPtr model)
+{
+ if (!model)
+ return;
+
+ virCPUarmDataClear(&model->data);
+ g_free(model->name);
+ g_free(model);
+}
+
+static void
+virCPUarmVendorFree(virCPUarmVendorPtr vendor)
+{
+ if (!vendor)
+ return;
+
+ g_free(vendor->name);
+ g_free(vendor);
+}
+
static void
virCPUarmMapFree(virCPUarmMapPtr map)
{
if (!map)
return;
+ size_t i;
+
+ for (i = 0; i < map->nmodels; i++)
+ virCPUarmModelFree(map->models[i]);
+ g_free(map->models);
+
+ for (i = 0; i < map->nvendors; i++)
+ virCPUarmVendorFree(map->vendors[i]);
+ g_free(map->vendors);
+
g_ptr_array_free(map->features, TRUE);
g_free(map);
@@ -259,6 +333,7 @@ struct cpuArchDriver cpuDriverArm = {
.compare = virCPUarmCompare,
.decode = NULL,
.encode = NULL,
+ .dataFree = virCPUarmDataFree,
.baseline = virCPUarmBaseline,
.update = virCPUarmUpdate,
.validateFeatures = virCPUarmValidateFeatures,
--
2.26.0.windows.1
4 years, 8 months
[libvirt PATCH] docs: list settings required in creating a new git repo
by Daniel P. Berrangé
The libvirt project has alot of git repositories, and they must all be
configured in the same way, more or less. This page documents the
settings changes that I have made in GitLab and GitHub when configuring
projects, both as a reminder for myself, and to help anyone else doing
the same in future. Also included is info about the repo mirroring on
the libvirt.org server.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
docs/docs.html.in | 3 +
docs/newreposetup.rst | 136 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 139 insertions(+)
create mode 100644 docs/newreposetup.rst
diff --git a/docs/docs.html.in b/docs/docs.html.in
index 142c79bfa9..6bdf0c32b8 100644
--- a/docs/docs.html.in
+++ b/docs/docs.html.in
@@ -172,6 +172,9 @@
<dt><a href="testsuites.html">Functional testing</a></dt>
<dd>Testing libvirt with <a href="testtck.html">TCK test suite</a> and
<a href="testapi.html">Libvirt-test-API</a></dd>
+
+ <dt><a href="newreposetup.html">New repo setup</a></dt>
+ <dd>Procedure for configuring new git repositories for libvirt</dd>
</dl>
</div>
diff --git a/docs/newreposetup.rst b/docs/newreposetup.rst
new file mode 100644
index 0000000000..897caaa1ec
--- /dev/null
+++ b/docs/newreposetup.rst
@@ -0,0 +1,136 @@
+===============================
+Repository infrastructure setup
+===============================
+
+GitLab Configuration
+====================
+
+The `GitLab organization <https://gitlab.com/libvirt>`_ hosts the master copy
+of all the libvirt Git repositories.
+
+When creating a new repository the following changes to the defaults are
+required under the ``Settings`` page
+
+* **General**
+
+ * **Naming, topics, avatar**
+
+ * *Project avatar*: upload ``docs/logos/logo-square-256.png``
+
+ * **Visibility, project features, permissions**
+
+ * *Packages*: disabled
+
+ * *Wiki*: disabled
+
+ * *Snippets*: disabled
+
+ * **Merge Requests**
+
+ * *Merge method*: Fast-forward merge
+
+ * *Merge options*: Enable 'delete source branch' option by default
+
+ * *Merge checks*: Pipelines must succeed
+
+ * **Merge request approvals**
+
+ * *Any eligible user*: Num approvals required == 1
+
+* **Integrations**
+
+ * **Pipelines emails**
+
+ * *Recipients*: ``libvirt-ci(a)redhat.com``
+
+* **Repository**
+
+ * **Push rules**
+
+ * *Do not allow users to remove git tags with git push*: enabled
+
+ * *Commit message*: ``Signed-off-by:``
+
+ * *Branch name*: ``^(master|v.*-maint)$``
+
+ * **Mirroring repositories**
+
+ * *Git repository URL*: ``https://libvirtmirror@github.com/libvirt/$repo.git``
+
+ * *Mirror direction*: push
+
+ * *Password*: see ``/root/libvirt-mirror-github-api-token.txt`` on ``libvirt.org``
+
+ * **Protected branches**
+
+ * *Branch*: ``master``
+
+ * *Allowed to merge*: Developers + Maintainers
+
+ * *Allowed to push*: None (or Developers + Maintainers if MRs not used)
+
+ * *Require approval from code owners*: disabled
+
+GitHub configuration
+====================
+
+The `GitHub organization <https://github.com/libvirt>`_ hosts read-only
+mirrors of all the libvirt Git repositories.
+
+When creating a new repository the following changes to the defaults are
+required under the ``Settings`` page
+
+* **Options**
+
+ * **Features**
+
+ * *Wikis*: disabled
+
+ * *Sponsorships*: disabled
+
+ * *Projects*: disabled
+
+ * **Manage access**
+
+ * Add @committers with role "Write"
+
+ * **Integrations**
+
+ * Check for *Repo Lockdown* (should be set automatically for all projects)
+
+In the master git repository create a file `.github/lockdown.yml` to restrict
+use of issue tracker and pull requests.
+
+
+libvirt.org
+===========
+
+The `Libvirt project server <https://libvirt.org>`_ hosts read-only mirrors of
+all the libvirt Git repositories in the directory ``/data/git``.
+
+When creating a new repository the following steps are required
+
+* Create repo with
+ ::
+
+ $ sudo su -
+ # cd /data/git
+ # mkdir repo.git
+ # cd repo.git
+ # git init --bare
+ # touch export
+ # touch git-daemon-export-ok
+ # cd ..
+ # chown -R gitmirror.gitmirror repo.git
+ # chmod -R g+w repo.git
+ # find -type d repo.git | xargs chmod g+s
+
+* Set the ``description`` and ``config`` files following other repos example
+
+* Setup mirroring
+ ::
+
+ $ sudo su - gitmirror
+ # ./newrepo.sh /data/git/repo.git
+ # cd mirrors
+ # $HOME/sync-one.sh repo.git
--
2.24.1
4 years, 8 months
[libvirt PATCH] docs: add 'edit this page' link to footer of every page
by Daniel P. Berrangé
To encourage contributors to make changes to the main website, add a
footer link to every page which links to the corresponding source file
in git. With gitlab, they are able to edit content directly in the web
browser and then submit a merge request. This gives a way to contribute
content that is arguably easier than our wiki which requires manual
account creation, while this will also benefit from maintainer review.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
docs/Makefile.am | 5 +++++
docs/page.xsl | 7 +++++++
docs/site.xsl | 1 +
docs/subsite.xsl | 1 +
4 files changed, 14 insertions(+)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 61862c4ab7..483414105d 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -429,6 +429,10 @@ manpages/%.html.in: manpages/%.rst
%.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \
$(acl_generated)
$(AM_V_GEN)name=`echo $@ | sed -e 's/.tmp//'`; \
+ genhtmlin=`echo $@ | sed -e 's/.tmp/.in/'`; \
+ rst=`echo $@ | sed -e 's/.html.tmp/.rst/'`; \
+ src="$$genhtmlin"; \
+ test -f "$$genhtmlin" && src="$$rst"; \
dir=`dirname $@` ; \
if test "$$dir" = "."; \
then \
@@ -438,6 +442,7 @@ manpages/%.html.in: manpages/%.rst
style=subsite.xsl; \
fi; \
$(XSLTPROC) --stringparam pagename $$name \
+ --stringparam pagesrc $$src \
--stringparam builddir '$(abs_top_builddir)' \
--stringparam timestamp $(timestamp) --nonet \
$(top_srcdir)/docs/$$style $< > $@ \
diff --git a/docs/page.xsl b/docs/page.xsl
index ddae5ab508..6e3ed6c688 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -77,6 +77,7 @@
<!-- This is the master page structure -->
<xsl:template match="/" mode="page">
<xsl:param name="pagename"/>
+ <xsl:param name="pagesrc"/>
<xsl:param name="timestamp"/>
<xsl:text disable-output-escaping="yes"><!DOCTYPE html>
</xsl:text>
@@ -150,6 +151,12 @@
</div>
</div>
<div id="footer">
+ <div id="contact">
+ <h3>Contribute</h3>
+ <ul>
+ <li><a href="https://gitlab.com/libvirt/libvirt/-/blob/master/docs/{$pagesrc}">edit this page</a></li>
+ </ul>
+ </div>
<div id="contact">
<h3>Contact</h3>
<ul>
diff --git a/docs/site.xsl b/docs/site.xsl
index c9d41f2c93..73ddd8ca6b 100644
--- a/docs/site.xsl
+++ b/docs/site.xsl
@@ -27,6 +27,7 @@
<xsl:template match="/">
<xsl:apply-templates select="." mode="page">
<xsl:with-param name="pagename" select="$pagename"/>
+ <xsl:with-param name="pagesrc" select="$pagesrc"/>
<xsl:with-param name="timestamp" select="$timestamp"/>
</xsl:apply-templates>
</xsl:template>
diff --git a/docs/subsite.xsl b/docs/subsite.xsl
index f56ac0491c..bfd34eebd2 100644
--- a/docs/subsite.xsl
+++ b/docs/subsite.xsl
@@ -17,6 +17,7 @@
<xsl:template match="/">
<xsl:apply-templates select="." mode="page">
<xsl:with-param name="pagename" select="$pagename"/>
+ <xsl:with-param name="pagesrc" select="$pagesrc"/>
<xsl:with-param name="timestamp" select="$timestamp"/>
</xsl:apply-templates>
</xsl:template>
--
2.24.1
4 years, 8 months
[PATCH] apparmor: avoid denials on libpmem initialization
by Christian Ehrhardt
With libpmem support compiled into qemu it will trigger the following
denials on every startup.
apparmor="DENIED" operation="open" name="/"
apparmor="DENIED" operation="open" name="/sys/bus/nd/devices/"
This is due to [1] that tries to auto-detect if the platform supports
auto flush for all region.
Once we know all the paths that are potentially needed if this feature
is really used we can add them conditionally in virt-aa-helper and labelling
calls in case </pmem> is enabled.
But until then the change here silences the denial warnings seen above.
[1]: https://github.com/pmem/pmdk/blob/master/src/libpmem2/auto_flush_linux.c#...
Bug: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1871354
Signed-off-by: Christian Ehrhardt <christian.ehrhardt(a)canonical.com>
---
src/security/apparmor/libvirt-qemu | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/security/apparmor/libvirt-qemu b/src/security/apparmor/libvirt-qemu
index 80986aec61..602f5eb587 100644
--- a/src/security/apparmor/libvirt-qemu
+++ b/src/security/apparmor/libvirt-qemu
@@ -227,3 +227,8 @@
# required for sasl GSSAPI plugin
/etc/gss/mech.d/ r,
/etc/gss/mech.d/* r,
+
+ # scanned on libpmem init, but harmless on any lsb compliant system
+ / r,
+ /sys/bus/nd/devices/ r,
+ /sys/bus/nd/devices/* r,
--
2.26.0
4 years, 8 months