mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-10-16 23:33:52 +03:00
virsh: Pass vshControl to all vshCommandOpt*() calls
This will allow us to use vshError() to report errors from inside vshCommandOpt*(), instead of replicating the same logic and error messages all over the place. We also have more context inside the vshCommandOpt*() functions, for example the actual value used on the command line, which means we can produce more detailed error messages. vshCommandOptBool() is the exception here, because it's explicitly designed not to report any error.
This commit is contained in:
committed by
John Ferlan
parent
5eaca29fbb
commit
be6ff4da95
@@ -843,7 +843,7 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd)
|
||||
/* use "no-stp" because we want "stp" to default true */
|
||||
stp = !vshCommandOptBool(cmd, "no-stp");
|
||||
|
||||
if (vshCommandOptUInt(cmd, "delay", &delay) < 0) {
|
||||
if (vshCommandOptUInt(ctl, cmd, "delay", &delay) < 0) {
|
||||
vshError(ctl,
|
||||
_("Numeric value for <%s> option is malformed or out of range"),
|
||||
"delay");
|
||||
|
Reference in New Issue
Block a user