mirror of
https://github.com/libvirt/libvirt.git
synced 2026-07-31 16:48:21 -05:00
vsh: cmdComplete: Don't exit when connecting to the daemon fails
Invoke the 'connHandler' without checking return value. 'virsh complete' can provide useful completions even when the daemon connection is broken. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
+5
-2
@@ -3584,8 +3584,11 @@ cmdComplete(vshControl *ctl, const vshCmd *cmd)
|
||||
ctl->stderr_closed = true;
|
||||
}
|
||||
|
||||
if (!(hooks && hooks->connHandler && hooks->connHandler(ctl)))
|
||||
return false;
|
||||
/* Attempt connecting so that we can also do completions based on e.g.
|
||||
* object names work. Failure to connect is not fatal because we want
|
||||
* at least argument completion */
|
||||
if (hooks && hooks->connHandler)
|
||||
ignore_value(hooks->connHandler(ctl));
|
||||
|
||||
vshReadlineInit(ctl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user