- 04 9月, 2015 1 次提交
-
-
由 Erik Skultety 提交于
As part of the effort to stay consistent, change the vshInit signature from returning int to returning bool. Moreover, remove the unnecessary error label as there is no cleanup that would make use of it.
-
- 03 9月, 2015 1 次提交
-
-
由 Michal Privoznik 提交于
Caller is responsible for freeing the result of virStringJoin() when no longer needed: ==10701== 1 bytes in 1 blocks are definitely lost in loss record 1 of 806 ==10701== at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==10701== by 0xAADB679: strdup (in /lib64/libc-2.20.so) ==10701== by 0x4F18655: virStrdup (virstring.c:726) ==10701== by 0x4F175AF: virStringJoin (virstring.c:165) ==10701== by 0x131D4D: vshReadlineInit (vsh.c:2572) ==10701== by 0x1322DF: vshInit (vsh.c:2736) ==10701== by 0x1347C1: main (virsh.c:907) Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 8月, 2015 1 次提交
-
-
由 Moshe Levi 提交于
This patch removes the static keyword from the vshReadline which was introduced in commit 834c5720. With readline the vshReadline function is not static but when compiling without readline it was defined as static which caused compilation error.
-
- 14 8月, 2015 1 次提交
-
-
由 Erik Skultety 提交于
In order to share as much virsh' logic as possible with upcomming virt-admin client we need to split virsh logic into virsh specific and client generic features. Since majority of virsh methods should be generic enough to be used by other clients, it's much easier to rename virsh specific data to virshX than doing this vice versa. It moved generic virsh commands (including info and opts structures) to generic module vsh.c. Besides renaming methods and structures, this patch also involves introduction of a client specific control structure being referenced as private data in the original control structure, introduction of a new global vsh Initializer, which currently doesn't do much, but there is a potential for added functionality in the future. Lastly it introduced client hooks which are especially necessary during client connecting phase.
-
- 02 6月, 2015 5 次提交
-
-
由 Andrea Bolognani 提交于
-
由 Andrea Bolognani 提交于
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.
-
由 Andrea Bolognani 提交于
This aligns it to the other vshCommandOpt*() functions.
-
由 Andrea Bolognani 提交于
Use vshCommandOptUInt() instead of parsing the value as a signed integer and checking whether it's positive afterwards. Improve comments as well.
-
由 Andrea Bolognani 提交于
I missed this in the first time around, thanks Michal for noticing.
-
- 25 5月, 2015 1 次提交
-
-
由 Pavel Hrdina 提交于
Some virsh commands have a size parameter, which is handled as scaled integer. We don't have any *feature* that would allow to use '-1' as maximum size, so it's safe to reject any negative values for those commands. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1159171Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 15 4月, 2015 1 次提交
-
-
由 Eric Blake 提交于
Commit a0670aef caused a regression in 'virsh event' and 'virsh qemu-monitor-event' - if a user tries to filter the command to a specific domain, an error message is printed: $ virsh event dom --loop error: internal error: virsh qemu-monitor-event: no domain VSH_OT_DATA option and then the command continues as though no domain had been supplied (giving events for ALL domains, instead of the requested one). This is because the code was incorrectly assuming that all "domain" options would be supplied via a mandatory VSH_OT_DATA, even though "domain" is optional for these two commands, so we had changed them to VSH_OT_STRING to quit failing for other reasons (ever since it was decided that VSH_OT_DATA and VSH_OT_STRING should no longer be synonyms). In looking at the situation, though, the code for looking up a domain was making a pointless check for whether the option exists prior to finding the option's string value, as vshCommandOptStringReq does just fine at reporting any errors when looking up a string whether or not the option was present. So this is a case of regression fixing by pure code deletion :) * tools/virsh-domain.c (vshCommandOptDomainBy): Drop useless filter. * tools/virsh-interface.c (vshCommandOptInterfaceBy): Likewise. * tools/virsh-network.c (vshCommandOptNetworkBy): Likewise. * tools/virsh-nwfilter.c (vshCommandOptNWFilterBy): Likewise. * tools/virsh-secret.c (vshCommandOptSecret): Likewise. * tools/virsh.h (vshCmdHasOption): Drop unused function. * tools/virsh.c (vshCmdHasOption): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 02 4月, 2015 1 次提交
-
-
由 Ján Tomko 提交于
After splitting out most of virsh command, some includes are no longer needed. Some files have the libXML includes despite not needing them.
-
- 20 2月, 2015 1 次提交
-
-
由 Martin Kletzander 提交于
When editing a domain with 'virsh edit' and failing validation, the usual message pops up: Failed. Try again? [y,n,f,?]: Turning off validation can be useful, mainly for testing (but other purposes too), so this patch adds support for relaxing definition in virsh-edit and makes 'virsh edit <domain>' more usable. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 12 1月, 2015 1 次提交
-
-
由 Hao Liu 提交于
Commit 6b9964 enforces checking invalid use of VSH_OT_STRING with VSH_OFLAG_REQ. This commit tries to do the same thing to stop using VSH_OT_DATA without VSH_OFLAG_REQ and also fix existing misuse. Signed-off-by: NHao Liu <hliu@redhat.com>
-
- 08 12月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Each command that needs a connection causes a new connection to be made. Reconnecting after a command failed is pointless, mainly when there is no other command to run. Removeing three lines of code takes care of that and keeps virsh working as it should. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 15 11月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 13 11月, 2014 2 次提交
-
-
由 Martin Kletzander 提交于
Recent commit 12bd207e fixed few VSH_OT_STRING options that should've been VSH_OT_DATA. That lead me to this commit that enforces people to check that newly added options have proper type. Thanks to virsh erroring out with error message, this will immediately show up in 'make check' thanks to our virsh-synopsis test. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
Even though vshCmddefOptParse() tried returning -1 if there was an optional option specification that preceded a required one, it failed to check that for boolean type options and options with VSH_OFLAG_REQ_OPT flag set. On the other hand, it makes sense that VSH_OT_ARGV is specified at the end of the option list. Returning -1 enforces the proper ordering thanks to virsh-synopsis test in 'make check'. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 29 10月, 2014 1 次提交
-
-
由 Eric Blake 提交于
C guarantees that static variables are zero-initialized. Some older compilers (and also gcc -fno-zero-initialized-in-bss) create larger binaries if you explicitly zero-initialize a static variable. * tools/virsh-console.c (got_signal): Drop unused variable. * tools/virsh-domain.c: Fix initialization. * tools/virsh.c: Likewise. * tools/virt-host-validate-common.c (virHostMsgWantEscape): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 02 10月, 2014 1 次提交
-
-
由 Guido Günther 提交于
Debian wants to use 'sensible-editor' instead of vi other distros might want to use other defaults. This avoids distro specific patches.
-
- 09 9月, 2014 1 次提交
-
-
由 Eric Blake 提交于
The parser accepts P and E, so the formatter should too. * tools/virsh.c (vshPrettyCapacity): Handle larger units. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 06 9月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Expose the new flag just added to virDomainGetBlockJobInfo. With --raw, the presence or absence of --bytes determines which flag to use in the single API call. Without --raw, the use of --bytes forces an error if the server doesn't support it, otherwise, the code tries to silently fall back to scaling the MiB/s value. My goal is to eventually also support --bytes in bandwidth mode; but that's a bit further down the road (and needs a new API flag added in libvirt.h first). This changes the human output, but the previous patch added raw output precisely so that we can have flexibility with the human output. For this commit, I used qemu-monitor-command to force an unusual bandwidth, but the same will be possible once qemu implements virDomainBlockCopy: Before: Block Copy: [100 %] Bandwidth limit: 2 MiB/s After: Block Copy: [100 %] Bandwidth limit: 1048577 bytes/s (1.000 MiB/s) The cache avoids having to repeatedly checking whether the flag works when talking to an older server, when multiple blockjob commands are issued during a batch session and the user is manually polling for job completion. * tools/virsh.h (_vshControl): Add a cache. * tools/virsh.c (cmdConnect, vshReconnect): Initialize the cache. * tools/virsh-domain.c (opts_block_job): Add --bytes. * tools/virsh.pod (blockjob): Document this. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 28 8月, 2014 1 次提交
-
-
由 Erik Skultety 提交于
resolves https://bugzilla.redhat.com/show_bug.cgi?id=1132305: The error message for an out-of-range argument was confusing: virsh -k 9999999999 error: option --k requires a positive numeric argument After this patch, it is: error: Invalid value for option -k Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 21 8月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
The error message contains one extra dash.
-
- 26 6月, 2014 1 次提交
-
-
由 Jiri Denemark 提交于
Let's just open the file right away and deal with errors. Moreover, there's no reason to forbid logging to, e.g., a pipe. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 12 6月, 2014 4 次提交
-
-
由 Peter Krempa 提交于
To follow the new semantics of the vshCommandOptToU* functions convert this one to reject negative numbers too. To allow using -1 for "maximum" semantics for the vol-*load two bandwidth functions that use this helper introduce vshCommandOptULongLongWrap.
-
由 Peter Krempa 提交于
To follow the new semantics of the vshCommandOptToU* functions convert this one to reject negative numbers too. To allow using -1 for "maximum" semantics for the two bandwidth functions that use this helper introduce vshCommandOptULWrap. Although currently the migrate-setspeed function for the qemu driver will reject -1 as maximum.
-
由 Peter Krempa 提交于
Use virStrToLong_uip instead of virStrToLong_ui to reject negative numbers in the helper. None of the callers expects the wraparound "feature" for negative numbers. Also add a function that allows wrapping of negative numbers as it might be used in the future and be explicit about the new semantics in the function docs.
-
由 Roman Bogorodskiy 提交于
Add 'Bhyve' in hypervisor list reported by 'virsh -V' if it's compiled it.
-
- 25 4月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
Add calls to virFileActivateDirOverride so that the build dir overrides are activated. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 03 4月, 2014 1 次提交
-
-
由 Li Yang 提交于
For now 'virsh quit' action like this: -------------------------------- [root@localhost /]# virsh quit [root@localhost /]# -------------------------------- And 'virsh exit' action: -------------------------------- [root@localhost /]# virsh exit [root@localhost /]# -------------------------------- There is a small difference('/n') between them. According to manual said: quit, exit quit this interactive terminal And in the code they all called cmdQuit func, They should get same actions. Signed-off-by: NLi Yang <liyang.fnst@cn.fujitsu.com>
-
- 25 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
-
- 18 3月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Introducing keepalive similarly to Guannan around 2 years ago. Since we want to introduce keepalive for every connection, it makes sense to wrap the connecting function into new virsh one that can deal keepalive as well. Function vshConnect() is now used for connecting and keepalive added in that function (if possible) helps preventing long waits e.g. while nework goes down during migration. This patch also adds the options for keepalive tuning into virsh and fails connecting only when keepalives are explicitly requested and cannot be set (whether it is due to missing support in connected driver or remote server). If not explicitely requested, a debug message is printed (hence the addition to virsh-optparse test). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1073506 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=822839Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 10 3月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Man page, help output and also parsing is sorted in order to find options smoothly. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 21 2月, 2014 2 次提交
-
-
由 Eric Blake 提交于
I plan to add 'virsh event' to virsh-domain.c and 'virsh net-event' to virsh-network.c; but as they will share quite a bit of common boilerplate, it's better to set that up now in virsh.c. * tools/virsh.h (_vshControl): Add fields. (vshEventStart, vshEventWait, vshEventDone, vshEventCleanup): New prototypes. * tools/virsh.c (vshEventFd, vshEventOldAction, vshEventInt) (vshEventTimeout): New helper variables and functions. (vshEventStart, vshEventWait, vshEventDone, vshEventCleanup): Implement new functions. (vshInit, vshDeinit, main): Manage event timeout. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Several virsh commands ask for a --timeout parameter in seconds, then use it to control interfaces that operate on millisecond limits; I also plan on adding a 'virsh event' command that also does this. Factor this into a common function. * tools/virsh.h (vshCommandOptTimeoutToMs): New prototype. * tools/virsh.c (vshCommandOptTimeoutToMs): New function. * tools/virsh-domain.c (cmdBlockCommit, cmdBlockCopy) (cmdBlockPull, cmdMigrate): Use it. (vshWatchJob): Adjust timeout scale. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 12 12月, 2013 1 次提交
-
-
由 Eric Blake 提交于
Adding output to 'virsh --version=long' makes it easier to tell if a distro built with particular libraries (it doesn't tell you what a remote libvirtd is built with, but is still better than nothing). But we forgot to mention gluster. * tools/virsh.c (vshShowVersion): Add gluster witness. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 19 11月, 2013 1 次提交
-
-
由 Ryota Ozaki 提交于
This patch shuts up the following warning of clang on Mac OS X: virsh.c:2761:22: error: assigning to 'char *' from 'const char [6]' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] rl_readline_name = "virsh"; ^ ~~~~~~~ The warning happens because rl_readline_name on Mac OS X comes from an old readline header that still uses 'char *', while it is 'const char *' in readline 4.2 (April 2001) and newer. Tested on Mac OS X 10.8.5 (clang-500.2.75) and Fedora 19 (gcc 4.8.1). Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 29 10月, 2013 1 次提交
-
-
由 Pavel Raiskup 提交于
Allow adjust the number of commands to remember in the command history. * tools/virsh.c (vshReadlineInit): Read and sanity the VIRSH_HISTSIZE variable. (VIRSH_HISTSIZE_MAX): New constant. * tools/virsh.pod: Document VIRSH_HISTSIZE variable. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 24 10月, 2013 1 次提交
-
-
由 Eric Blake 提交于
We want to treat 'attach-disk --shareable' as an undocumented alias for 'attach-disk --mode=shareable'. By improving our alias handling, we can allow all such --bool -> --opt=value replacements, and guarantee up front that the alias is not mixed with its replacement. * tools/virsh.c (vshCmddefOptParse, vshCmddefGetOption): Add support for expanding bool alias to --opt=value. (opts_echo): Add another alias to test it. * tests/virshtest.c (mymain): Test it. Signed-off-by: NEric Blake <eblake@redhat.com>
-