On 4/19/24 9:49 AM, Marc Hartmayer wrote:
Instead of accessing the global `driver` object pass the `udevEventData` as
parameter to the thread handler and watch callback. This has the advantage that:
1. proper refcounting
2. easier to read and test
Signed-off-by: Marc Hartmayer
---
On 4/19/24 9:49 AM, Marc Hartmayer wrote:
Use this feature in `udevEventDataNew`.
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/src/node_device/node_device_udev.c
On 4/19/24 9:49 AM, Marc Hartmayer wrote:
There is only one case where force is true, therefore let's inline that case.
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 25 +++--
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git
On 4/19/24 9:49 AM, Marc Hartmayer wrote:
When an udev event occurs the mdev active config data requires an update via
mdevctl as the udev does not contain all config data. This update needs to occur
immediate and to be finished before the libvirt nodedev event is issued to keep
the API usage
On 4/19/24 11:04 AM, Marc Hartmayer wrote:
On Fri, Apr 19, 2024 at 04:49 PM +0200, Marc Hartmayer
wrote:
Use a worker pool for processing the events (e.g. udev, mdevctl config changes)
and the initialization instead of a separate initThread and a mdevctl-thread.
This has the large advantage
On 4/19/24 9:49 AM, Marc Hartmayer wrote:
It's better practice for all functions called by the threads to pass the driver
via parameter and not global variables. Easier to test and cleaner.
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_driver.h | 2 +-
On 4/19/24 9:49 AM, Marc Hartmayer wrote:
The documentation of gobject signals reads:
"If you are connecting handlers to signals and using a GObject instance as your
signal handler user data, you should remember to pair calls to
g_signal_connect() with calls to g_signal_handler_disconnect() or
On 4/19/24 9:49 AM, Marc Hartmayer wrote:
Introduce and use the driver functions for the node state shutdown preparation
and wait. As they're also called in the error/cleanup path of
`nodeStateInitialize`, they must be written in a way, that they can safely be
executed even if not everything is
On 4/19/24 9:49 AM, Marc Hartmayer wrote:
Even if `priv->udev_monitor` was never initialized, the mdevctlLock, udevThread
were. Therefore let's match the order of releasing the resources the order of
allocating the resources in `nodeStateInitialize`.
In addition, use `g_steal_pointer` in
On 4/19/24 9:49 AM, Marc Hartmayer wrote:
Everything is released in `udevEventDataDispose` except for the threads, change
this as this makes the code easier to read as it can be simplified a little.
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 14 ++
1
On 4/19/24 9:49 AM, Marc Hartmayer wrote:
Commit a99d876a0f58 ("node_device: Use automatic mutex management") replaced the
locking mechanism and accidentally removed the comment with the reason why the
lock is taken. The reason was to "ensure only a single thread can query mdevctl
at a time",
On Fri, Apr 19, 2024 at 04:49 PM +0200, Marc Hartmayer
wrote:
> Use a worker pool for processing the events (e.g. udev, mdevctl config
> changes)
> and the initialization instead of a separate initThread and a mdevctl-thread.
> This has the large advantage that we can leverage the job API and
Instead of accessing the global `driver` object pass the `udevEventData` as
parameter to the thread handler and watch callback. This has the advantage that:
1. proper refcounting
2. easier to read and test
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 14 +++---
When an udev event occurs the mdev active config data requires an update via
mdevctl as the udev does not contain all config data. This update needs to occur
immediate and to be finished before the libvirt nodedev event is issued to keep
the API usage reliable.
The only case where a direct
Use this feature in `udevEventDataNew`.
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/src/node_device/node_device_udev.c
b/src/node_device/node_device_udev.c
index
It's better practice for all functions called by the threads to pass the driver
via parameter and not global variables. Easier to test and cleaner.
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_driver.h | 2 +-
src/node_device/node_device_driver.c | 6 +--
There is only one case where force is true, therefore let's inline that case.
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 25 +++--
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/src/node_device/node_device_udev.c
Use a worker pool for processing the events (e.g. udev, mdevctl config changes)
and the initialization instead of a separate initThread and a mdevctl-thread.
This has the large advantage that we can leverage the job API and now this
thread pool is responsible to do all the "costly-work" and
The documentation of gobject signals reads:
"If you are connecting handlers to signals and using a GObject instance as your
signal handler user data, you should remember to pair calls to
g_signal_connect() with calls to g_signal_handler_disconnect() or
g_signal_handlers_disconnect_by_func().
Introduce and use the driver functions for the node state shutdown preparation
and wait. As they're also called in the error/cleanup path of
`nodeStateInitialize`, they must be written in a way, that they can safely be
executed even if not everything is initialized.
In the next commit, these
The new names make it easier to understand the purpose of the data.
Reviewed-by: Boris Fiuczynski
Reviewed-by: Jonathon Jongsma
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 48 +++---
1 file changed, 24 insertions(+), 24 deletions(-)
diff
Even if `priv->udev_monitor` was never initialized, the mdevctlLock, udevThread
were. Therefore let's match the order of releasing the resources the order of
allocating the resources in `nodeStateInitialize`.
In addition, use `g_steal_pointer` in `g_list_free_full`.
Signed-off-by: Marc Hartmayer
Commit a99d876a0f58 ("node_device: Use automatic mutex management") replaced the
locking mechanism and accidentally removed the comment with the reason why the
lock is taken. The reason was to "ensure only a single thread can query mdevctl
at a time", but this reason is no longer valid or maybe it
Everything is released in `udevEventDataDispose` except for the threads, change
this as this makes the code easier to read as it can be simplified a little.
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 14 ++
1 file changed, 6 insertions(+), 8 deletions(-)
Since @driver->privateData is modified take the lock.
Reviewed-by: Boris Fiuczynski
Reviewed-by: Jonathon Jongsma
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git
Inline `udevRemoveOneDevice` as it's used only once.
Reviewed-by: Boris Fiuczynski
Reviewed-by: Jonathon Jongsma
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 17 +
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git
Remove the timeout when the udevEventData is disposed, analogous to priv->watch.
Reviewed-by: Boris Fiuczynski
Reviewed-by: Jonathon Jongsma
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git
From: Boris Fiuczynski
When a mdev device is destroyed or stopped the udev remove event
handling needs to reset the active config data of the node object
representing a persisted mdev.
Reviewed-by: Marc Hartmayer
Reviewed-by: Jonathon Jongsma
Signed-off-by: Boris Fiuczynski
---
It is done a little differently everywhere in libvirt, but most common is to
test for != -1.
Reviewed-by: Boris Fiuczynski
Reviewed-by: Jonathon Jongsma
Signed-off-by: Marc Hartmayer
---
src/node_device/node_device_udev.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff
From: Boris Fiuczynski
When an udev add event occurs the mdev active config data requires an
update via mdevctl as the udev does not contain all config data.
This update needs to occur immediately and to be finished before the
libvirt CREATE event is issued to keep the API usage reliable.
After
@def is owned by @obj after adding it the node device object list. As soon as
the @obj lock has been released, another thread could free @obj and therefore
@def. If now someone accesses @def this would lead to a heap-use-after-free and
therefore most likely to a segmentation fault, therefore set
When an udev event occurs for a mediated device (mdev) the mdev config data
requires an update via mdevctl as the udev event does not contain all config
data. This update needs to occur immediately and to be finished before the
libvirt nodedev event is issued to keep the API usage reliable.
From: Boris Fiuczynski
Two situations will trigger an udev add event:
1) the mdev is created when started (transient) or
2) the mdev was defined and is started
In case 1 there is no node object existing and no config data is copied.
In case 2 copying the active config data of an existing node
While QEMU accepts and interprets an empty string in the tls-hostname
field in migration parametes as if it's unset, the same does not apply
for the 'tls-hostname' field when 'blockdev-add'-ing a NBD backend for
non-shared storage migration.
When libvirt sets up migation with TLS in
On Thu, Apr 18, 2024 at 06:29:53PM +0100, Daniel P. Berrangé wrote:
> On Wed, Mar 20, 2024 at 09:10:48AM -0700, Andrea Bolognani wrote:
> > On Wed, Mar 20, 2024 at 10:18:39AM -0400, Stefan Berger wrote:
> > > On 3/20/24 08:23, Peter Krempa wrote:
> > > > Did you consider the case when the
Refactor the existing logic using two nested loops with a jump into the
middle of both with 3 separate places fetching next token to a single
loop using a state machine with one centralized place to fetch next
tokens and add explanation comments.
Signed-off-by: Peter Krempa
---
tools/vsh.c |
As we now have a centralized point to assign values to options move the
debugging logic there.
Signed-off-by: Peter Krempa
---
tools/vsh.c | 31 ---
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/tools/vsh.c b/tools/vsh.c
index 3cd9202a8a..b04b4f5cd0
This check was needed due to the use "unsigned long long" as bitmap
which was refactored recently.
Signed-off-by: Peter Krempa
---
tools/vsh.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/tools/vsh.c b/tools/vsh.c
index 30cbf4c0dc..3cd9202a8a 100644
--- a/tools/vsh.c
+++
Refactor the very old opaque logic (using multiple bitmaps) by
fully-allocating vshCmdOpt for each possible argument and then filling
them as they go rather than allocating them each time after it's parsed.
This simplifies the checkers and removes the need to cross-reference
multiple arrays.
Remove the old helpers which were used previously to pick which field to
complete.
Signed-off-by: Peter Krempa
---
tools/virsh.c | 4 ++--
tools/virt-admin.c | 4 ++--
tools/vsh.c| 20 +++-
tools/vsh.h| 4 +---
4 files changed, 8 insertions(+), 24
Neither of them is used outside of vsh.c. 'vshCmddefSearch' needed to be
rearranged as it was called earlier in vsh.c than it was defined.
Signed-off-by: Peter Krempa
---
tools/vsh.c | 44 ++--
tools/vsh.h | 4
2 files changed, 26 insertions(+), 22
In preparation for internal parser refactor introduce new accessors for
the VSH_OT_ARGV type which will return a NULL-terminated string list or
even a concatenated string for the given argument.
Signed-off-by: Peter Krempa
---
tools/virsh-checkpoint.c | 10 +--
tools/virsh-domain-monitor.c
Currently the code decides which option to complete by looking into the
input string and trying to infer it based on whether we are at the
end position as we truncate the string to complete to the current cursor
position.
That basically means that only the last-parsed option will be up for
Add both single invocations as well as a script containing the same
commands.
Signed-off-by: Peter Krempa
---
tests/virshtest.c | 37 ++
.../completion-arg-full-argv-next.out | 2 +
.../completion-arg-full-argv.out | 2 +
The argument will be used for testing the command/option completer
function.
Signed-off-by: Peter Krempa
---
tools/vsh.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/tools/vsh.c b/tools/vsh.c
index 8719875413..71c0778660 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -3246,6
Shorten the function name as there isn't any vshCommandOptString.
Signed-off-by: Peter Krempa
---
tools/virsh-backup.c | 4 +-
tools/virsh-checkpoint.c | 8 +-
tools/virsh-completer-domain.c | 2 +-
tools/virsh-completer-host.c | 8 +-
tools/virsh-domain-event.c |
While the 'complete' command is meant to be hidden and used only for
the completion script, there's nothing preventing it being used in all
virsh modes.
This poses a problem as the command tries to close 'stdin' to avoid the
possibility that an auth callback would want to read the password.
In
Ensure that virsh is rebuilt if needed.
Signed-off-by: Peter Krempa
---
tests/meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/meson.build b/tests/meson.build
index 3f8f3dee7c..7270840428 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -298,7
This series refactors the commandline parser in order to use easier to
understand/maintain logic.
Peter Krempa (13):
meson: tests: Add 'virsh' as dependency of 'virshtest'
tools: Rename vshCommandOptStringReq to vshCommandOptString
vsh: Fix 'stdin' closing in 'cmdComplete'
vsh: Add a
On 4/17/24 17:17, Cole Robinson wrote:
Commit v10.0.0-265-ge67bca23e4 added a `active_config` and
`defined_config` to nodedev mdev internal XML handling.
`defined_config` can be filled at XML parse time, but `active_config`
must be filled in by nodedev driver. This wasn't implemented for the
Signed-off-by: Michal Privoznik
---
docs/docs.rst | 3 +++
docs/meson.build | 1 +
docs/nss.rst | 7 ++
docs/ssh-proxy.rst | 60 ++
4 files changed, 71 insertions(+)
create mode 100644 docs/ssh-proxy.rst
diff --git a/docs/docs.rst
Signed-off-by: Michal Privoznik
---
NEWS.rst | 5 +
1 file changed, 5 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 852dadf532..3bfd6d6919 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -17,6 +17,11 @@ v10.3.0 (unreleased)
* **New features**
+ * SSH proxy for VM
+
+Libvirt now
This allows users to SSH into a domain with a VSOCK device:
ssh user@qemu/machineName
So far, only QEMU domains are supported AND qemu:///system is
looked for the first for 'machineName' followed by
qemu:///session. I took an inspiration from SystemD's ssh proxy
[1] [2].
To just work out of
Some public objects (like virDomain, virInterface, and so on) are
missing g_autoptr() cleanup functions. Provide missing
declarations. Note, this is only for our internal use - hence
datatypes.h.
Signed-off-by: Michal Privoznik
---
src/datatypes.h | 16
1 file changed, 16
*** BLURB HERE ***
Michal Prívozník (4):
datatypes: Declare g_autoptr cleanup functions for more public objects
tools: Introduce SSH proxy
docs: Document SSH proxy
NEWS: Document SSH proxy feature
NEWS.rst | 5 +
docs/docs.rst
We are getting close to 10.3.0 release of libvirt. To aim for the
release on Thursday 02 May I suggest entering the freeze on Friday
26 Apr and tagging RC2 on Tuesday 30 Apr.
I hope this works for everyone.
Jirka
___
Devel mailing list --
On Thu, Apr 18, 2024 at 05:19 PM -0500, Jonathon Jongsma
wrote:
> On 4/12/24 8:36 AM, Marc Hartmayer wrote:
>> Use a worker pool for processing the udev events and the initialization
>> instead
>> of a separate initThread and a mdevctl-thread. This has the large advantage
>> that
>> we can
On Thu, Apr 18, 2024 at 05:01 PM -0500, Jonathon Jongsma
wrote:
> On 4/12/24 8:36 AM, Marc Hartmayer wrote:
>> Use the proper driver functions for the node state shutdown preparation and
>> wait. In the next patch, these functions will be extended.
>>
>> Signed-off-by: Marc Hartmayer
>> ---
>>
On Thu, Apr 18, 2024 at 01:48 PM -0500, Jonathon Jongsma
wrote:
> On 4/12/24 8:36 AM, Marc Hartmayer wrote:
>> Since @driver->privateData is modified take the lock.
>>
[…snip…]
>>* signal if that event never comes */
>> -scheduleMdevctlUpdate(priv, (event_type ==
>>
On Thu, Apr 18, 2024 at 11:18 AM -0500, Jonathon Jongsma
wrote:
> On 4/12/24 8:36 AM, Marc Hartmayer wrote:
>> Commit a99d876a0f58 ("node_device: Use automatic mutex management") replaced
>> the
>> locking mechanism and accidentally removed the comment with the reason why
>> the
>> lock is
On Thu, Apr 18, 2024 at 10:03 AM -0500, Jonathon Jongsma
wrote:
> On 4/12/24 8:36 AM, Marc Hartmayer wrote:
>> From: Boris Fiuczynski
>>
>> When a mdev device is destroyed or stopped the udev remove event
>> handling needs to reset the active config data of the node object
>> representing a
On Thu, Apr 18, 2024 at 09:47 AM -0500, Jonathon Jongsma
wrote:
> On 4/12/24 8:36 AM, Marc Hartmayer wrote:
>> From: Boris Fiuczynski
>>
>> When an udev add event occurs the mdev active config data requires an
>> update via mdevctl as the udev does not contain all config data.
>> This update
62 matches
Mail list logo