[PATCH 4/7] virsh: Do not try connecting first time without polkit agent

Ján Tomko jtomko at redhat.com
Mon Nov 22 15:39:08 UTC 2021


On a Sunday in 2021, Martin Kletzander wrote:
>Trying to connect once without a polkit agent will generate an error on the
>server side which seems too rough given it only serves the purpose of the client
>(virsh in this case) to figure out that an agent is needed.  Thankfully we can
>just try running the agent.  It does not break anything as we are running it
>with `--fallback`, which makes sure it does not replace an existing agent in
>case there is one already registered.
>
>The second piece of code trying to start the polkit text agent is kept in order
>to _really_ try out starting the agent (and error out when failing to do so)
>just in case the agent was not available the first time it was ran.  Even though
>it should not happen it avoids a very rare race condition and really does not
>add much complexity.
>
>Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1945501
>
>Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
>---
> tools/virsh.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20211122/dfcdbd77/attachment-0001.sig>


More information about the libvir-list mailing list