Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libvirt
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Libvirt Packaging Team
libvirt
Commits
db8e6b78
Commit
db8e6b78
authored
5 months ago
by
Andrea Bolognani
Browse files
Options
Downloads
Patches
Plain Diff
patches: Add backport/lxc-remove-no-longer-working-netns-[...]
Closes: #1088929
parent
c8f1b0f5
No related branches found
No related tags found
1 merge request
!250
Prepare 10.10.0-4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/backport/lxc-remove-no-longer-working-netns-check.patch
+112
-0
112 additions, 0 deletions
...s/backport/lxc-remove-no-longer-working-netns-check.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
113 additions
and
0 deletions
debian/patches/backport/lxc-remove-no-longer-working-netns-check.patch
0 → 100644
+
112
−
0
View file @
db8e6b78
From: Leigh Brown <leigh@solinno.co.uk>
Date: Tue, 3 Dec 2024 16:02:08 +0000
Subject: lxc: remove no longer working netns check
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Since iproute2 v6.12.0, the command "ip link set lo netns -1" can
no longer be used to check for netns support, as it now validates
PIDs are not less than zero.
Since every kernel we care about has the support, just remove the
check.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Leigh Brown <leigh@solinno.co.uk>
(cherry picked from commit dd217cd9382cb7d67b26c5b3b4be07e5ce88ef86)
Forwarded: not-needed
Origin: https://gitlab.com/libvirt/libvirt/-/commit/dd217cd9382cb7d67b26c5b3b4be07e5ce88ef86
---
src/lxc/lxc_conf.h | 1 -
src/lxc/lxc_driver.c | 36 ------------------------------------
2 files changed, 37 deletions(-)
diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h
index c0967ac..a639e39 100644
--- a/src/lxc/lxc_conf.h
+++ b/src/lxc/lxc_conf.h
@@ -49,7 +49,6 @@
struct _virLXCDriverConfig {
char *stateDir;
char *logDir;
bool log_libvirtd;
- int have_netns;
char *securityDriverName;
bool securityDefaultConfined;
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index d682e71..2488940 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -422,12 +422,6 @@
lxcDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
if (virSecurityManagerVerify(driver->securityManager, def) < 0)
goto cleanup;
- if ((def->nets != NULL) && !(cfg->have_netns)) {
- virReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("System lacks NETNS support"));
- goto cleanup;
- }
-
if (!(vm = virDomainObjListAdd(driver->domains, &def,
driver->xmlopt,
0, &oldDef)))
@@ -974,12 +968,6 @@
static int lxcDomainCreateWithFiles(virDomainPtr dom,
if (virDomainCreateWithFilesEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if ((vm->def->nets != NULL) && !(cfg->have_netns)) {
- virReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("System lacks NETNS support"));
- goto cleanup;
- }
-
if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0)
goto cleanup;
@@ -1088,13 +1076,6 @@
lxcDomainCreateXMLWithFiles(virConnectPtr conn,
if (virSecurityManagerVerify(driver->securityManager, def) < 0)
goto cleanup;
- if ((def->nets != NULL) && !(cfg->have_netns)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("System lacks NETNS support"));
- goto cleanup;
- }
-
-
if (!(vm = virDomainObjListAdd(driver->domains, &def,
driver->xmlopt,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
@@ -1386,22 +1367,6 @@
lxcDomainDestroy(virDomainPtr dom)
return lxcDomainDestroyFlags(dom, 0);
}
-static int lxcCheckNetNsSupport(void)
-{
- g_autoptr(virCommand) cmd = virCommandNewArgList("ip", "link", "set", "lo",
- "netns", "-1", NULL);
- int ip_rc;
-
- if (virCommandRun(cmd, &ip_rc) < 0 || ip_rc == 255)
- return 0;
-
- if (virProcessNamespaceAvailable(VIR_PROCESS_NAMESPACE_NET) < 0)
- return 0;
-
- return 1;
-}
-
-
static virSecurityManager *
lxcSecurityInit(virLXCDriverConfig *cfg)
{
@@ -1481,7 +1446,6 @@
lxcStateInitialize(bool privileged,
goto cleanup;
cfg->log_libvirtd = false; /* by default log to container logfile */
- cfg->have_netns = lxcCheckNetNsSupport();
/* Call function to load lxc driver configuration information */
if (virLXCLoadDriverConfig(cfg, SYSCONFDIR "/libvirt/lxc.conf") < 0)
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
db8e6b78
backport/virt-aa-helper-allow-riscv64-EDK-II.patch
backport/qemu-tpm-do-not-update-profile-name-for-transient-domains.patch
backport/lxc-remove-no-longer-working-netns-check.patch
debian/Debianize-libvirt-guests.patch
debian/apparmor_profiles_local_include.patch
debian/Use-sensible-editor-by-default.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment