[libvirt] [PATCH v3 RESEND] qemu: Process RDMA GID state change event
by Yuval Shaia
This event is emitted on the monitor when a GID table in pvrdma device
is modified and the change needs to be propagate to the backend RDMA
device's GID table.
The control over the RDMA device's GID table is done by updating the
device's Ethernet function addresses.
Usually the first GID entry is determine by the MAC address, the second
by the first IPv6 address and the third by the IPv4 address. Other
entries can be added by adding more IP addresses. The opposite is the
same, i.e. whenever an address is removed, the corresponding GID entry
is removed.
The process is done by the network and RDMA stacks. Whenever an address
is added the ib_core driver is notified and calls the device driver's
add_gid function which in turn update the device.
To support this in pvrdma device we need to hook into the create_bind
and destroy_bind HW commands triggered by pvrdma driver in guest.
Whenever a changed is made to the pvrdma device's GID table a special
QMP messages is sent to be processed by libvirt to update the address of
the backend Ethernet device.
Signed-off-by: Yuval Shaia <yuval.shaia(a)oracle.com>
---
(fixing mail subject from v2 to v3, rest is the same)
Hi,
Corresponding qemu commit was merged to master as part of the following
patch-set:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg583387.html
Appreciate if this patch can be reviewed and merged as well.
Thanks,
Yuval
v1 -> v2:
* Address all comments from Michal Privoznik
v2 -> v3:
* Remove static initialization in processRdmaGidStatusChangedEvent
---
src/qemu/qemu_domain.c | 3 +++
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 44 ++++++++++++++++++++++++++++++
src/qemu/qemu_monitor.c | 27 +++++++++++++++++++
src/qemu/qemu_monitor.h | 27 +++++++++++++++++++
src/qemu/qemu_monitor_json.c | 36 +++++++++++++++++++++++++
src/qemu/qemu_process.c | 52 ++++++++++++++++++++++++++++++++++++
7 files changed, 190 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ba3fff607a..8da54c7ee9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -13479,6 +13479,9 @@ qemuProcessEventFree(struct qemuProcessEvent *event)
case QEMU_PROCESS_EVENT_GUESTPANIC:
qemuMonitorEventPanicInfoFree(event->data);
break;
+ case QEMU_PROCESS_EVENT_RDMA_GID_STATUS_CHANGED:
+ qemuMonitorEventRdmaGidStatusFree(event->data);
+ break;
case QEMU_PROCESS_EVENT_WATCHDOG:
case QEMU_PROCESS_EVENT_DEVICE_DELETED:
case QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED:
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 80bd4bde91..64bceb9a98 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -487,6 +487,7 @@ typedef enum {
QEMU_PROCESS_EVENT_BLOCK_JOB,
QEMU_PROCESS_EVENT_MONITOR_EOF,
QEMU_PROCESS_EVENT_PR_DISCONNECT,
+ QEMU_PROCESS_EVENT_RDMA_GID_STATUS_CHANGED,
QEMU_PROCESS_EVENT_LAST
} qemuProcessEventType;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a52e2495d5..5c6ab3c0ea 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4788,6 +4788,47 @@ processPRDisconnectEvent(virDomainObjPtr vm)
}
+static void
+processRdmaGidStatusChangedEvent(virDomainObjPtr vm,
+ qemuMonitorRdmaGidStatusChangedPrivatePtr info)
+{
+ unsigned int prefix_len;
+ virSocketAddr addr;
+ int rc;
+
+ if (!virDomainObjIsActive(vm))
+ return;
+
+ VIR_DEBUG("netdev=%s,gid_status=%d,subnet_prefix=0x%llx,interface_id=0x%llx",
+ info->netdev, info->gid_status, info->subnet_prefix,
+ info->interface_id);
+
+ if (info->subnet_prefix) {
+ prefix_len = 64;
+ uint32_t ipv6[4];
+ memcpy(&ipv6[0], &info->subnet_prefix, sizeof(info->subnet_prefix));
+ memcpy(&ipv6[2], &info->interface_id, sizeof(info->interface_id));
+ virSocketAddrSetIPv6AddrNetOrder(&addr, ipv6);
+ } else {
+ prefix_len = 24;
+ virSocketAddrSetIPv4AddrNetOrder(&addr, info->interface_id >> 32);
+ }
+
+ if (info->gid_status) {
+ VIR_DEBUG("Adding %s to %s", virSocketAddrFormat(&addr), info->netdev);
+ rc = virNetDevIPAddrAdd(info->netdev, &addr, NULL, prefix_len);
+ } else {
+ VIR_DEBUG("Removing %s from %s", virSocketAddrFormat(&addr),
+ info->netdev);
+ rc = virNetDevIPAddrDel(info->netdev, &addr, prefix_len);
+ }
+
+ if (rc < 0)
+ VIR_WARN("Fail to update address %s to %s", virSocketAddrFormat(&addr),
+ info->netdev);
+}
+
+
static void qemuProcessEventHandler(void *data, void *opaque)
{
struct qemuProcessEvent *processEvent = data;
@@ -4828,6 +4869,9 @@ static void qemuProcessEventHandler(void *data, void *opaque)
case QEMU_PROCESS_EVENT_PR_DISCONNECT:
processPRDisconnectEvent(vm);
break;
+ case QEMU_PROCESS_EVENT_RDMA_GID_STATUS_CHANGED:
+ processRdmaGidStatusChangedEvent(vm, processEvent->data);
+ break;
case QEMU_PROCESS_EVENT_LAST:
break;
}
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 7f7013e115..4bf71dbf8c 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1686,6 +1686,22 @@ qemuMonitorEmitPRManagerStatusChanged(qemuMonitorPtr mon,
}
+int
+qemuMonitorEmitRdmaGidStatusChanged(qemuMonitorPtr mon, const char *netdev,
+ bool gid_status, uint64_t subnet_prefix,
+ uint64_t interface_id)
+{
+ int ret = -1;
+ VIR_DEBUG("netdev=%s,gid_status=%d,subnet_prefix=0x%lx,interface_id=0x%lx",
+ netdev, gid_status, subnet_prefix, interface_id);
+
+ QEMU_MONITOR_CALLBACK(mon, ret, domainRdmaGidStatusChanged, mon->vm, netdev,
+ gid_status, subnet_prefix, interface_id);
+
+ return ret;
+}
+
+
int
qemuMonitorSetCapabilities(qemuMonitorPtr mon)
{
@@ -4298,6 +4314,17 @@ qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicInfoPtr info)
}
+void
+qemuMonitorEventRdmaGidStatusFree(qemuMonitorRdmaGidStatusChangedPrivatePtr info)
+{
+ if (!info)
+ return;
+
+ VIR_FREE(info->netdev);
+ VIR_FREE(info);
+}
+
+
int
qemuMonitorSetWatchdogAction(qemuMonitorPtr mon,
const char *action)
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 48b142a4f4..b639a0a9d2 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -109,8 +109,22 @@ struct _qemuMonitorEventPanicInfo {
} data;
};
+
+typedef struct _qemuMonitorRdmaGidStatusChangedPrivate qemuMonitorRdmaGidStatusChangedPrivate;
+typedef qemuMonitorRdmaGidStatusChangedPrivate *qemuMonitorRdmaGidStatusChangedPrivatePtr;
+struct _qemuMonitorRdmaGidStatusChangedPrivate {
+ virObject parent;
+
+ char *netdev;
+ bool gid_status;
+ unsigned long long subnet_prefix;
+ unsigned long long interface_id;
+};
+
+
char *qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfoPtr info);
void qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicInfoPtr info);
+void qemuMonitorEventRdmaGidStatusFree(qemuMonitorRdmaGidStatusChangedPrivatePtr info);
typedef void (*qemuMonitorDestroyCallback)(qemuMonitorPtr mon,
virDomainObjPtr vm,
@@ -281,6 +295,14 @@ typedef int (*qemuMonitorDomainPRManagerStatusChangedCallback)(qemuMonitorPtr mo
bool connected,
void *opaque);
+typedef int (*qemuMonitorDomainRdmaGidStatusChangedCallback)(qemuMonitorPtr mon,
+ virDomainObjPtr vm,
+ const char *netdev,
+ bool gid_status,
+ uint64_t subnet_prefix,
+ uint64_t interface_id,
+ void *opaque);
+
typedef struct _qemuMonitorCallbacks qemuMonitorCallbacks;
typedef qemuMonitorCallbacks *qemuMonitorCallbacksPtr;
struct _qemuMonitorCallbacks {
@@ -314,6 +336,7 @@ struct _qemuMonitorCallbacks {
qemuMonitorDomainBlockThresholdCallback domainBlockThreshold;
qemuMonitorDomainDumpCompletedCallback domainDumpCompleted;
qemuMonitorDomainPRManagerStatusChangedCallback domainPRManagerStatusChanged;
+ qemuMonitorDomainRdmaGidStatusChangedCallback domainRdmaGidStatusChanged;
};
char *qemuMonitorEscapeArg(const char *in);
@@ -448,6 +471,10 @@ int qemuMonitorEmitPRManagerStatusChanged(qemuMonitorPtr mon,
const char *prManager,
bool connected);
+int qemuMonitorEmitRdmaGidStatusChanged(qemuMonitorPtr mon, const char *netdev,
+ bool gid_status, uint64_t subnet_prefix,
+ uint64_t interface_id);
+
int qemuMonitorStartCPUs(qemuMonitorPtr mon);
int qemuMonitorStopCPUs(qemuMonitorPtr mon);
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 3de298c9e2..8df9b426ba 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -91,6 +91,7 @@ static void qemuMonitorJSONHandleAcpiOstInfo(qemuMonitorPtr mon, virJSONValuePtr
static void qemuMonitorJSONHandleBlockThreshold(qemuMonitorPtr mon, virJSONValuePtr data);
static void qemuMonitorJSONHandleDumpCompleted(qemuMonitorPtr mon, virJSONValuePtr data);
static void qemuMonitorJSONHandlePRManagerStatusChanged(qemuMonitorPtr mon, virJSONValuePtr data);
+static void qemuMonitorJSONHandleRdmaGidStatusChanged(qemuMonitorPtr mon, virJSONValuePtr data);
typedef struct {
const char *type;
@@ -114,6 +115,7 @@ static qemuEventHandler eventHandlers[] = {
{ "NIC_RX_FILTER_CHANGED", qemuMonitorJSONHandleNicRxFilterChanged, },
{ "POWERDOWN", qemuMonitorJSONHandlePowerdown, },
{ "PR_MANAGER_STATUS_CHANGED", qemuMonitorJSONHandlePRManagerStatusChanged, },
+ { "RDMA_GID_STATUS_CHANGED", qemuMonitorJSONHandleRdmaGidStatusChanged, },
{ "RESET", qemuMonitorJSONHandleReset, },
{ "RESUME", qemuMonitorJSONHandleResume, },
{ "RTC_CHANGE", qemuMonitorJSONHandleRTCChange, },
@@ -1351,6 +1353,40 @@ static void qemuMonitorJSONHandlePRManagerStatusChanged(qemuMonitorPtr mon,
}
+static void qemuMonitorJSONHandleRdmaGidStatusChanged(qemuMonitorPtr mon,
+ virJSONValuePtr data)
+{
+ const char *netdev;
+ bool gid_status;
+ unsigned long long subnet_prefix, interface_id;
+
+ if (!(netdev = virJSONValueObjectGetString(data, "netdev"))) {
+ VIR_WARN("missing netdev in GID_STATUS_CHANGED event");
+ return;
+ }
+
+ if (virJSONValueObjectGetBoolean(data, "gid-status", &gid_status)) {
+ VIR_WARN("missing gid-status in GID_STATUS_CHANGED event");
+ return;
+ }
+
+ if (virJSONValueObjectGetNumberUlong(data, "subnet-prefix",
+ &subnet_prefix)) {
+ VIR_WARN("missing subnet-prefix in GID_STATUS_CHANGED event");
+ return;
+ }
+
+ if (virJSONValueObjectGetNumberUlong(data, "interface-id",
+ &interface_id)) {
+ VIR_WARN("missing interface-id in GID_STATUS_CHANGED event");
+ return;
+ }
+
+ qemuMonitorEmitRdmaGidStatusChanged(mon, netdev, gid_status, subnet_prefix,
+ interface_id);
+}
+
+
int
qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon,
const char *cmd_str,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 9cf971808c..6cf0ace5cf 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1703,6 +1703,57 @@ qemuProcessHandlePRManagerStatusChanged(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
}
+static int
+qemuProcessHandleRdmaGidStatusChanged(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
+ virDomainObjPtr vm, const char *netdev,
+ bool gid_status, uint64_t subnet_prefix,
+ uint64_t interface_id, void *opaque)
+{
+ virQEMUDriverPtr driver = opaque;
+ struct qemuProcessEvent *processEvent = NULL;
+ qemuMonitorRdmaGidStatusChangedPrivatePtr rdmaGitStatusChangedPriv = NULL;
+ int ret = -1;
+
+ virObjectLock(vm);
+
+ VIR_DEBUG("netdev=%s,gid_status=%d,subnet_prefix=0x%lx,interface_id=0x%lx",
+ netdev, gid_status, subnet_prefix, interface_id);
+
+ if (VIR_ALLOC(rdmaGitStatusChangedPriv) < 0)
+ goto out_unlock;
+
+ if (VIR_STRDUP(rdmaGitStatusChangedPriv->netdev, netdev) < 0)
+ goto out_free;
+
+ rdmaGitStatusChangedPriv->gid_status = gid_status;
+ rdmaGitStatusChangedPriv->subnet_prefix = subnet_prefix;
+ rdmaGitStatusChangedPriv->interface_id = interface_id;
+
+ if (VIR_ALLOC(processEvent) < 0)
+ goto out_free;
+
+ processEvent->eventType = QEMU_PROCESS_EVENT_RDMA_GID_STATUS_CHANGED;
+ processEvent->vm = virObjectRef(vm);
+ processEvent->data = rdmaGitStatusChangedPriv;
+
+ if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) {
+ qemuProcessEventFree(processEvent);
+ virObjectUnref(vm);
+ goto out_free;
+ }
+
+ ret = 0;
+ goto out_unlock;
+
+ out_free:
+ qemuMonitorEventRdmaGidStatusFree(rdmaGitStatusChangedPriv);
+
+ out_unlock:
+ virObjectUnlock(vm);
+ return ret;
+}
+
+
static qemuMonitorCallbacks monitorCallbacks = {
.eofNotify = qemuProcessHandleMonitorEOF,
.errorNotify = qemuProcessHandleMonitorError,
@@ -1732,6 +1783,7 @@ static qemuMonitorCallbacks monitorCallbacks = {
.domainBlockThreshold = qemuProcessHandleBlockThreshold,
.domainDumpCompleted = qemuProcessHandleDumpCompleted,
.domainPRManagerStatusChanged = qemuProcessHandlePRManagerStatusChanged,
+ .domainRdmaGidStatusChanged = qemuProcessHandleRdmaGidStatusChanged,
};
static void
--
2.17.2
5 years, 9 months
[libvirt] [PATCH 0/3] Rebase LXC network definition to support version 3.0
by Julio Faracco
The series propose a new way to define NICs inside LXC native. It is
needed because LXC version 3.X uses indexes to define NICs and the
current algorithm is not able to support them. At least, if you consider
settings defined using a random logic.
Julio Faracco (3):
lxc: refactoring LXC network definition with a sparse array.
tests: Change legacy network configs to version 3.0 with indexes.
tests: Include a random network testcase to test indexes.
src/lxc/lxc_native.c | 191 ++++++++++++------
.../lxcconf2xml-ethernet-v3.config | 16 +-
.../lxcconf2xml-fstab-v3.config | 10 +-
.../lxcconf2xml-macvlannetwork-v3.config | 10 +-
.../lxcconf2xml-miscnetwork-v3.config | 38 ++--
.../lxcconf2xml-physnetwork-v3.config | 14 +-
.../lxcconf2xml-randomnetwork-v3.config | 21 ++
.../lxcconf2xml-randomnetwork.xml | 45 +++++
.../lxcconf2xml-simple-v3.config | 18 +-
.../lxcconf2xml-vlannetwork-v3.config | 10 +-
tests/lxcconf2xmltest.c | 1 +
11 files changed, 249 insertions(+), 125 deletions(-)
create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-randomnetwork-v3.config
create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-randomnetwork.xml
--
2.19.1
5 years, 9 months
[libvirt] [jenkins-ci PATCH 0/2] Stop building Go projects on CentOS 7
by Andrea Bolognani
Found while creating a new CentOS 7 guest from scratch using
lcitool. See the commit messages for more details.
Andrea Bolognani (2):
Stop building Go projects on CentOS 7
guests: Don't prepare CentOS 7 for Go projects
guests/host_vars/libvirt-centos-7/main.yml | 2 --
guests/playbooks/build/projects/libvirt-go-xml.yml | 13 ++++++++++++-
guests/playbooks/build/projects/libvirt-go.yml | 13 ++++++++++++-
projects/libvirt-go-xml.yaml | 9 ++++++++-
projects/libvirt-go.yaml | 9 ++++++++-
5 files changed, 40 insertions(+), 6 deletions(-)
--
2.19.2
5 years, 9 months
[libvirt] [PATCH] lxc: allow empty path in URI for historical compatibility
by Daniel P. Berrangé
The use of 'lxc://' was mistakenly broken in:
commit 4c8574c85c554e68de0d8bf9b85727954a5bea91
Author: Daniel P. Berrangé <berrange(a)redhat.com>
Date: Wed Mar 28 12:49:29 2018 +0100
driver: ensure NULL URI isn't passed to drivers with whitelisted URIs
Allow it again for historical compatibility.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/lxc/lxc_driver.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index de045c80bb..df15a0da50 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -140,7 +140,8 @@ static virDrvOpenStatus lxcConnectOpen(virConnectPtr conn,
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
/* If path isn't '/' then they typoed, tell them correct path */
- if (STRNEQ(conn->uri->path, "/") &&
+ if (STRNEQ(conn->uri->path, "") &&
+ STRNEQ(conn->uri->path, "/") &&
STRNEQ(conn->uri->path, "/system")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected LXC URI path '%s', try lxc:///system"),
--
2.19.2
5 years, 9 months
[libvirt] [PATCH RFC] qemu: caps: invalidate kvm capable qemu binaries on every restart
by Nikolay Shirokovskiy
If qemu binary exposes kvm then caps depends heavily on host state.
We are already check explicitly some host features - kernel version,
microcode version, nested flag state. This won't nesserily help if somebody
change CPU on host. Let's instead invalidate such caps on every daemon
restart. This makes kernel version and microcode version check
excessive but nested flag is still need to be checked.
Cache invalidating on restart is archived by keeping list of
binaries that whose caps cache was validated at least once.
If binary in not yet validated and supports kvm then we need to
invalidate it's caps cache.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
If the patch will be accepted then I'll send a patch which removes mentioned
excessive checks also.
src/qemu/qemu_capabilities.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 51bf97b..649aba2 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3264,6 +3264,7 @@ struct _virQEMUCapsCachePriv {
virArch hostArch;
unsigned int microcodeVersion;
char *kernelVersion;
+ virHashTablePtr validated;
/* cache whether /dev/kvm is usable as runUid:runGuid */
virTristateBool kvmUsable;
@@ -3280,6 +3281,7 @@ virQEMUCapsCachePrivFree(void *privData)
VIR_FREE(priv->libDir);
VIR_FREE(priv->kernelVersion);
+ virHashFree(priv->validated);
VIR_FREE(priv);
}
@@ -3952,10 +3954,19 @@ virQEMUCapsIsValid(void *data,
bool kvmUsable;
struct stat sb;
bool kvmSupportsNesting;
+ bool validated = true;
if (!qemuCaps->binary)
return true;
+ if (!virHashLookup(priv->validated, qemuCaps->binary)) {
+ validated = false;
+
+ /* If we fail to remember this binary is validated it is not problem,
+ * it will be validated again next time once again */
+ virHashAddEntry(priv->validated, qemuCaps->binary, (void*)1);
+ }
+
if (qemuCaps->libvirtCtime != virGetSelfLastChanged() ||
qemuCaps->libvirtVersion != LIBVIR_VERSION_NUMBER) {
VIR_DEBUG("Outdated capabilities for '%s': libvirt changed "
@@ -4011,6 +4022,12 @@ virQEMUCapsIsValid(void *data,
}
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) {
+ if (!validated) {
+ VIR_DEBUG("Capabilities for QEMU that supports KVM need to be "
+ "updated after daemon restart");
+ return false;
+ }
+
if (priv->microcodeVersion != qemuCaps->microcodeVersion) {
VIR_DEBUG("Outdated capabilities for '%s': microcode version "
"changed (%u vs %u)",
@@ -4809,6 +4826,9 @@ virQEMUCapsCacheNew(const char *libDir,
if (VIR_STRDUP(priv->libDir, libDir) < 0)
goto error;
+ if (!(priv->validated = virHashCreate(1, NULL)))
+ goto error;
+
priv->hostArch = virArchFromHost();
priv->runUid = runUid;
--
1.8.3.1
5 years, 10 months
[libvirt] [PATCH 0/3] Allow adding mountOpts to the storage pool mount command
by John Ferlan
Modify the generation of the command line to allow usage of a
new XML pool source directory "mount_opts" in order to allow (for
instance) starting an NFS pool with specific mount options.
John Ferlan (3):
storage: Add mount options attribute for pool source dir element
storage: Add mountOpts to the storage pool mount command line
virsh: Add source-mount-opts for pool commands
docs/formatstorage.html.in | 8 ++++++++
docs/schemas/storagepool.rng | 5 +++++
src/conf/storage_conf.c | 12 +++++++++--
src/conf/storage_conf.h | 3 +++
src/storage/storage_util.c | 4 ++++
.../pool-netfs-mountopts.argv | 1 +
tests/storagepoolxml2argvtest.c | 1 +
.../pool-netfs-mountopts.xml | 20 +++++++++++++++++++
.../pool-netfs-mountopts.xml | 20 +++++++++++++++++++
tests/storagepoolxml2xmltest.c | 1 +
tools/virsh-pool.c | 15 +++++++++++---
tools/virsh.pod | 5 +++++
12 files changed, 90 insertions(+), 5 deletions(-)
create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-mountopts.argv
create mode 100644 tests/storagepoolxml2xmlin/pool-netfs-mountopts.xml
create mode 100644 tests/storagepoolxml2xmlout/pool-netfs-mountopts.xml
--
2.17.2
5 years, 10 months
[libvirt] configuration support to allow devices into cgroup devices devices.list inside libvirt_lxc container
by Mohan R
Hi,
I was having trouble with losetup inside libvirt_lxc container. Then I
found that <mknod state="on"> will provide CAP_MKNOD capability.
Even after enabling CAP_MKNOD in my container, I was not able to do
'losetup' because cgroup's device.list for my container dont have 'rwm'
flags for loop devices ('b 7:* rwm' in
/sys/fs/cgroup/devices/machine.slice/machine-
lxc*.scope/user/*/c1.session/devices.list)
Currently I have to manually do echo "b 7:* rwm" into
/sys/fs/cgroup/devices/machine.slice/machine-lxc*.scope/devices.allow
file before I login into the container in order to use loop devices. It
will be useful if we have a way to do this through domain xml rather
than manually doing it like what I'm doing now.
I looked into rng files, but I'm not able to find a way to define 'b
7:* rwm' in xml. I just want to check with the devs if this is possible
already. Otherwise I'll file one improvement bug.
I think lxc already have a way to do this through
lxc.cgroup.devices.allow
Thanks,
Mohan R
5 years, 10 months
[libvirt] configuration support to allow devices into cgroup devices device.list inside libvirt_lxc container
by Mohan R
Hi,
I was having trouble with losetup inside libvirt_lxc container. Then I
found that <mknod state="on"> will provide CAP_MKNOD capability.
Even after enabling CAP_MKNOD in my container, I was not able to do
'losetup' because cgroup's device.list for my container dont have 'rwm'
flags for loop devices ('b 7:* rwm' in
/sys/fs/cgroup/devices/machine.slice/machine-
lxc*.scope/user/*/c1.session/devices.list)
Currently I have to manually do echo "b 7:* rwm" into
/sys/fs/cgroup/devices/machine.slice/machine-lxc*.scope/device.allow
file before I login into the container in order to use loop devices. It
will be useful if we have a way to do this through domain xml rather
than manually doing it like what I'm doing now.
I looked into rng files, but I'm not able to find a way to define 'b
7:* rwm' in xml. I just want to check with the devs if this is possible
already. Otherwise I'll file one improvement bug.
I think lxc already have a way to do this through
lxc.cgroup.devices.allow
Thanks,
Mohan R
5 years, 10 months