On 3/8/23 11:49 PM, Laine Stump wrote:
All the necessary explanation is in Path 3/4
We may want to turn on this same behavior for some other external
processes, but right now the one we need it for is passt.
Resolves: https://bugzilla.redhat.com/2172267
I forgot to mention that proper
set useBinarySpecificLabel = true when calling qemuSecurityCommandRun
for the passt process, so that the new process context will include
the binary-specific label that should be used for passt (passt_t)
rather than svirt_t (as would happen if useBinarySpecificLabel was
false). (The MCS part of
Normally when a child process is started by libvirt, the SELinux label
of that process is set to virtd_t (plus an MCS range). In at least one
case (passt) we need for the SELinux label of a child process label to
match the label that the binary would have transitioned to
automatically if it had
The binary to be exec'ed by virExec() is stored in
virCommand::args[0], and is resolved to a full absolute path (stored
in a local of virExec() just prior to execve().
Since we will have another use for the full absolute path, lets make
an API to resolve/retrieve the absolute path, and cache it
Neither of these are modified anywhere in the function, and the
function will soon be called with an arg that actually is a const.
Signed-off-by: Laine Stump
---
src/security/security_selinux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
All the necessary explanation is in Path 3/4
We may want to turn on this same behavior for some other external
processes, but right now the one we need it for is passt.
Resolves: https://bugzilla.redhat.com/2172267
Laine Stump (4):
util: add an API to retrieve the resolved path to a
On Wed, 8 Mar 2023 14:44:28 -0800
Dominik Behr wrote:
> On Wed, Mar 8, 2023 at 12:06 PM Alex Williamson
> wrote:
> >
> > On Wed, 8 Mar 2023 10:45:51 -0800
> > Dominik Behr wrote:
> >
> > > It is the same interface as other ACPI events like AC adapter LID etc
> > > are forwarded to
On Wed, 8 Mar 2023 10:45:51 -0800
Dominik Behr wrote:
> On Wed, Mar 8, 2023 at 9:49 AM Alex Williamson
> wrote:
>
> > Adding libvirt folks. This intentionally designs the interface in a
> > way that requires a privileged intermediary to monitor netlink on the
> > host, associate messages to
[Cc +libvir-list]
On Wed, 8 Mar 2023 12:41:24 +0100
Grzegorz Jaszczyk wrote:
> śr., 8 mar 2023 o 00:42 Alex Williamson
> napisał(a):
> >
> > On Tue, 7 Mar 2023 22:05:53 +
> > Grzegorz Jaszczyk wrote:
> >
> > > From: Dominik Behr
> > >
> > > Hitherto there was no support for
On Wed, Mar 08, 2023 at 09:23:19AM -0800, Andrea Bolognani wrote:
> On Tue, Mar 07, 2023 at 01:28:41PM -0800, Andrea Bolognani wrote:
> > On Tue, Mar 07, 2023 at 07:04:25PM +, Daniel P. Berrangé wrote:
> > > On Tue, Mar 07, 2023 at 08:02:37PM +0100, Andrea Bolognani wrote:
> > > > + # support
On Tue, Mar 07, 2023 at 01:28:41PM -0800, Andrea Bolognani wrote:
> On Tue, Mar 07, 2023 at 07:04:25PM +, Daniel P. Berrangé wrote:
> > On Tue, Mar 07, 2023 at 08:02:37PM +0100, Andrea Bolognani wrote:
> > > + # support for passt network back-end
> > > + /usr/bin/passt Cx -> passt,
> > > +
>
This series something I was hacking on a little while back in an
attempt to make our RPC layer more maintainable. There are many
aspects I'm unhappy about with current code
* When serializing a message we have no clue how big
it will be, but xdrmem_create wants a fixed size,
so we have to
Currently some, but not all, methods have a call to the
xdr_free function, for the 'ret' variable. This is done
on methods where there are complex structs containing
allocated memory. In other cases the structs contain
allocated memory, but the pointer is stolen, so xdr_free
is not called. In
The flake8 check W503 does not want a line break before
binary operator. This is contrary to the style that the
'black' formatting tool wants to use. Defer to 'black'
as it is intended to be an opinionated formatting tool
standardizing python code style, and thus not to be
customized per project.
The visitor API defines an interface for visiting each element
in the XDR protocol spec abstract syntax tree.
Signed-off-by: Daniel P. Berrangé
---
scripts/rpcgen/rpcgen/visitor.py | 156 +++
1 file changed, 156 insertions(+)
create mode 100644
Currently some, but not all, methods have a call to the
xdr_free function, for the 'ret' variable. This is done
on methods where there are complex structs containing
allocated memory. In other cases the structs contain
allocated memory, but the pointer is stolen, so xdr_free
is not called. In
As preparation for eliminating the use of the XDR library,
introduce helpers for (de)serializing XDR types from/to
the virNetMessage object.
In contrast to the XDR APIs, when encoding data our helpers
can dynamically resize the virNetMessage buffer. Our decode
helpers also exhibit delayed error
Test the serialization done by libtirpc, so that when we later
switch to our own code, we can prove wire compatibility.
Signed-off-by: Daniel P. Berrangé
---
build-aux/syntax-check.mk | 11 +-
scripts/rpcgen/tests/demo.x | 1 -
This replaces use of 'rpcgen' with our new python impl of
the RPC code generator. Since the new impl generates code
that matches our style/coding rules, and does not contain
long standing bugs, we no longer need to post-process the
output.
Signed-off-by: Daniel P. Berrangé
---
libvirt.spec.in
This adds a parser capable of handling the XDR protocol files.
The parsing grammar requirements are detailed in
https://www.rfc-editor.org/rfc/rfc4506#section-6.3
Signed-off-by: Daniel P. Berrangé
---
scripts/rpcgen/rpcgen/parser.py | 497
Currently some, but not all, methods have a call to the
xdr_free function, for the 'ret' variable. This is done
on methods where there are complex structs containing
allocated memory. In other cases the structs contain
allocated memory, but the pointer is stolen, so xdr_free
is not called. In
The current RPC code is post-processed to introduce an
intermediate variable, rather than casting directly
to char ** at time of use. This is said to be a workaround
for type-puning warnings that the compiler emitted.
Neither GCC or CLang emit any warnings for the code in
question today, across
This will eliminate the need to call xdr_free to clear
pointers from data structures.
Signed-off-by: Daniel P. Berrangé
---
build-aux/syntax-check.mk | 2 +-
scripts/rpcgen/main.py | 4 +
scripts/rpcgen/rpcgen/generator.py | 64 +--
This implements a C code generator that emits code that is
(almost) identical to the classic 'rpcgen' program. The
key differences are:
- Skip inlining of calls for struct fields
- Skip K style function prototypes in headers
- Use int64_t instead of quad_t for OS portability
- Saner
This introduces classes needed to form an abstract syntax
tree representing the XDR protocol language.
The syntax requirements are detailed in
https://www.rfc-editor.org/rfc/rfc4506#section-6.3
Signed-off-by: Daniel P. Berrangé
---
scripts/rpcgen/rpcgen/ast.py | 270
The new program takes the form
rpcgen [--mode source|header|repr] \
[--header include] \
xdr-file output-file
If '--mode' is not given it parses the XDR file but does not
generate anything, which is useful as a syntax check. The
'source' mode gives the '.c' file content,
This adds a lexer capable of handling the XDR protocol files.
The lexical rquirements are detailed in
https://www.rfc-editor.org/rfc/rfc4506#section-6.2
pytest is introduced as a build dependancy for testing python
code.
Signed-off-by: Daniel P. Berrangé
---
libvirt.spec.in
The 'black' tool is intended to be an opinionated formatting
tool for python code. It is complementary to flake8 which
validates coding bad practices, but (mostly) ignores code
layout issues.
Signed-off-by: Daniel P. Berrangé
---
build-aux/Makefile.in | 1 +
build-aux/meson.build | 5
> -Original Message-
> From: Peter Krempa
> Sent: Monday, 20 February 2023 16:13
> To: Or Ozeri
> Cc: libvir-list@redhat.com; Danny Harnik
> Subject: [EXTERNAL] Re: [PATCH v2 5/6] qemu: Allow setting per-disk
> snapshot name for RBD disks
>
> > diff --git a/src/qemu/qemu_snapshot.c
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2174397
Fixes: 565bcb5d79dddaf1d0d14cffe1f3ae78d76b10a0
Signed-off-by: Pavel Hrdina
---
src/conf/schemas/domainsnapshot.rng | 10 ++
1 file changed, 10 insertions(+)
diff --git a/src/conf/schemas/domainsnapshot.rng
> -Original Message-
> From: Peter Krempa
> Sent: Monday, 20 February 2023 16:00
> To: Or Ozeri
> Cc: libvir-list@redhat.com; Danny Harnik
> Subject: [EXTERNAL] Re: [PATCH v2 3/6] qemu: Add internal support for
> active disk internal snapshots
>
> This modification is done to a
For shutoff VMs we don't have the storage source backing chain
populated so it will fail this check and error out. Move it to
part that is done only when VM is running.
Signed-off-by: Pavel Hrdina
---
src/qemu/qemu_snapshot.c | 24
1 file changed, 12 insertions(+), 12
Pavel Hrdina (3):
qemu_snapshot: properly ignore disks with manual snapshot
qemu_snapshot: fix external snapshot deletion for non-active snapshots
domainsnapshot: add snapshotDeleteInProgress to RNG schema
src/conf/schemas/domainsnapshot.rng | 10 ++
src/qemu/qemu_snapshot.c
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2173142
Signed-off-by: Pavel Hrdina
---
src/qemu/qemu_snapshot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index cfa531edef..7207b5879a 100644
---
The order of pinning priority (at least for emulator thread) was
set by v1.2.15-rc1~58 (for cgroup code). But later, when
automatic placement was implemented into
qemuDomainGetEmulatorPinInfo(), the priority was not honored.
Now that we have this priority code in a separate function, we
can just
Since qemuxml2argvtest is now using virnumamock, there's no need
for qemuxml2argvmock to offer reimplementation of virNuma*()
functions. Also, the comment about CLang and FreeBSD (introduced
in v4.3.0-40-g77ac204d14) is no longer true. Looks like noinline
attribute was the missing culprit.
When building a thread-context object (inside of
qemuBuildThreadContextProps()) we look at given memory-backend-*
object and look for .host-nodes attribute. This works, as long as
we need to just copy the attribute value into another
thread-context attribute. But soon we will need to adjust it.
While it's true that anybody who's interested in getting
.host-nodes attribute value can just use
virJSONValueObjectGetArray() (and that's exactly what
qemuBuildThreadContextProps() is doing, btw), it somebody is
interested in getting the actual virBitmap, they would have to
parse the JSON array.
See 12/14 for explanation and seeing the fix in action.
Michal Prívozník (14):
virnuma: Move virNumaNodesetToCPUset() our of WITH_NUMACTL
virnuma: Introduce virNumaCPUSetToNodeset()
virnumamock: Introduce virNumaGetNodeOfCPU() mock
qemuxml2argvtest: Use virnuma mock
qemuxml2argvdata:
Introduce a mock of virNumaGetNodeOfCPU() because soon we will
need virNumaCPUSetToNodeset() to return predictable results.
Also, fill in missing symlinks in vircaps2xmldata/.
Signed-off-by: Michal Privoznik
---
src/util/virnuma.h| 2 +-
We have couple of qemuxml2argvtest cases where up to 8 NUMA nodes
are assumed. These are used to check whether disjoint ranges of
host-nodes= is generated properly. Without prejudice to the
generality, we can rewrite corresponding XML files to use up to 4
NUMA nodes and still have disjoint ranges.
When a thread-context object is specified on the cmd line, then
QEMU spawns a thread and sets its affinity to the list of NUMA
nodes specified in .node-affinity attribute. And this works just
fine, until the main QEMU thread itself is not restricted.
Because of v5.3.0-rc1~18 we restrict the main
Technically, there's nothing libnuma specific about
virNumaNodesetToCPUset(). It just implements a generic algorithm
over virNumaGetNodeCPUs() (which is then libnuma dependant).
Nevertheless, there's no need to have this function living inside
WITH_NUMACTL block. Any error returned from
While no part of cmd line building process currently depends on a
host NUMA configuration, this will change soon. Use freshly
changed virnumamock from qemuxml2argvtest and make the mock read
NUMA data from vircaps2xmldata which seems to have the most rich
NUMA configuration.
This also means, we
Signed-off-by: Michal Privoznik
---
docs/formatdomain.rst | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index c4077c6868..206875d68e 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -1117,7 +1117,9 @@
So far, we have a function that expands given list of NUMA nodes
into list of CPUs. But soon, we are going to need the inverse -
expand list of CPUs into list of NUMA nodes. Introduce
virNumaCPUSetToNodeset() for that.
Signed-off-by: Michal Privoznik
---
src/libvirt_private.syms | 2 ++
The set of if()-s that determines the preference in cpumask used
for setting things like emulatorpin, vcpupin, etc. is going to be
re-used. Separate it out into a function.
You may think that this changes behaviour, but
qemuProcessPrepareDomainNUMAPlacement() ensures that
priv->autoCpuset is set
Signed-off-by: Michal Privoznik
---
NEWS.rst | 7 +++
1 file changed, 7 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 089ad733f2..29239950c1 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -42,6 +42,13 @@ v9.2.0 (unreleased)
Due to a logic bug introduced in libvirt 9.0.0, VM
So far, the memory-hotplug-dimm-addr.xml test case pins its vCPUs
onto CPUs 0-1 which correspond to NUMA node #0 (per
tests/vircaps2xmldata/linux-basic/system/node/node0). Place vCPUs
onto nodes #1 and #2 too so that DIMM device can
continue using thread-context after future patches. This
On a Wednesday in 2023, Peter Krempa wrote:
The platform check which determines when to apply the fixups mentions
all officially supported build targets (per docs/platforms.rst) thus
it's not really necessary.
Additionally while not explicitly written as supported the check does
not work
On a Wednesday in 2023, Michal Privoznik wrote:
*** BLURB HERE ***
Michal Prívozník (4):
virscsihost: use g_autofree more
virSCSIHostFindByPCI: Decrease scope of some variables
virscsihost: Drop needless labels
virSCSIHostFindByPCI: Fix link detection
src/util/virscsihost.c | 48
On a Wednesday in 2023, Michal Privoznik wrote:
Inside of virSCSIHostFindByPCI() there's a loop which iterates of
entries of "/sys/class/scsi_host" directory trying to identify
all symlinks (which then point to a SCSI device, but that's not
important right now). But the way virFileIsLink() is
The platform check which determines when to apply the fixups mentions
all officially supported build targets (per docs/platforms.rst) thus
it's not really necessary.
Additionally while not explicitly written as supported the check does
not work properly when building with the MinGW toolchain on
Hi,
I know everyone is drowning in work but perhaps someone could review this
patch?
I think this is also a useful feature for others to
configure the reconnect delay while attaching a NBD disk to a running VM.
Thanks!
Christian
On Mon, 27 Feb 2023 at 12:15, Christian Nautze
wrote:
>
After previous cleanups, we're left with a couple of needless
labels, that contain nothing but a return statement. Drop those.
Signed-off-by: Michal Privoznik
---
src/util/virscsihost.c | 16 ++--
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/util/virscsihost.c
Inside of virSCSIHostFindByPCI() there're some variables that are
used from a while() loop exclusively. Bring their declaration
into the loop.
Signed-off-by: Michal Privoznik
---
src/util/virscsihost.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
Remove some obvious uses of VIR_FREE() in favor of automatic
cleanup. This also means, that some variables affected are
brought into the inner most block, so that automatic cleanup is
effective.
Signed-off-by: Michal Privoznik
---
src/util/virscsihost.c | 24 ++--
1 file
Inside of virSCSIHostFindByPCI() there's a loop which iterates of
entries of "/sys/class/scsi_host" directory trying to identify
all symlinks (which then point to a SCSI device, but that's not
important right now). But the way virFileIsLink() is called can
never return a truthful reply - because
*** BLURB HERE ***
Michal Prívozník (4):
virscsihost: use g_autofree more
virSCSIHostFindByPCI: Decrease scope of some variables
virscsihost: Drop needless labels
virSCSIHostFindByPCI: Fix link detection
src/util/virscsihost.c | 48 ++
1 file
59 matches
Mail list logo