[PATCH] vsh: Pass correct values for command line completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit id 'dcfdf341' passes 'opts_need_arg' and 'opts_seen' to
vshCmddefGetData, but that seems to be incorrect as those values
are not initialized properly (something at least one compiler found).
Instead the static 'const_opts_need_arg' and 'const_opts_seen' values
should be passed.

By passing unitialized values leads to not finding possible options
for simpler commands (domfsfreeze for example), where if you're in
a virsh shell using command line completion - you'll get a list of
files in your current directory instead of two options --domain and
--mountpoint (as would happen with this patch applied.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 tools/vsh.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/vsh.c b/tools/vsh.c
index 9558dad..17199ae 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -2788,7 +2788,8 @@ vshReadlineParse(const char *text, int state)
                 /* No -- option provided and some other token given
                  * Try to find the default option.
                  */
-                if (!(opt = vshCmddefGetData(cmd, &opts_need_arg, &opts_seen))
+                if (!(opt = vshCmddefGetData(cmd, &const_opts_need_arg,
+                                             &const_opts_seen))
                     || opt->type == VSH_OT_BOOL)
                     goto error;
                 opt_exists = true;
-- 
2.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux