- 17 1月, 2020 2 次提交
-
-
由 Daniel P. Berrangé 提交于
gmtime_r/localtime_r are mostly used in combination with strftime to format timestamps in libvirt. This can all be replaced with GDateTime resulting in simpler code that is also more portable. There is some boundary condition problem in parsing POSIX timezone offsets in GLib which tickles our test suite. The test suite is hacked to avoid the problem. The upsteam GLib bug report is https://gitlab.gnome.org/GNOME/glib/issues/1999Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The GNULIB termios module ensures termios.h exists (but is none the less empty) when building for Windows. We already exclude usage of the functions that would exist in a real termios.h, so having an empty termios.h is not especially useful. It is simpler to just put all use of termios.h related functions behind a "#ifndef WIN32" conditional. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 03 1月, 2020 2 次提交
-
-
由 Daniel P. Berrangé 提交于
commandhelper.c is not converted since this is a standalone program only run on UNIX, so can rely on getcwd(). Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
g_get_real_time() returns the time since epoch in microseconds. It uses gettimeofday() internally while libvirt used clock_gettime because it is declared async signal safe. In practice gettimeofday is also async signal safe *provided* the timezone parameter is NULL. This is indeed the case in g_get_real_time(). Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 20 12月, 2019 2 次提交
-
-
由 Fabiano Fidêncio 提交于
virGetUserCacheDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Fabiano Fidêncio 提交于
Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 12 12月, 2019 2 次提交
-
-
由 Ján Tomko 提交于
Remove the usage where sanity of the length argument is verified by other conditions not matching the previous patches. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
We abort on allocation errors now so there is no need to have a function for it. Replace the only use by return -1, chosen by fair dice roll. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 10 12月, 2019 2 次提交
-
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
- 19 11月, 2019 1 次提交
-
-
由 Ján Tomko 提交于
This flag is not implied by g_mkstemp_full, only by g_mkstemp. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reported-by: NBjoern Walk <bwalk@linux.ibm.com> Fixes: 4ac47730Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
- 15 11月, 2019 2 次提交
-
-
由 Pavel Hrdina 提交于
Glib implementation follows the ISO C99 standard so it's safe to replace the gnulib implementation. Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Ján Tomko 提交于
With g_mkstemp_full, there is no need to distinguish between mkostemp and mkostemps (no suffix vs. a suffix of a fixed length), because the GLib function looks for the XXXXXX pattern everywhere in the string. Use S_IRUSR | S_IWUSR for the permissions and do not pass O_RDWR in flags since it's implied. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
- 13 11月, 2019 1 次提交
-
-
由 Daniel Henrique Barboza 提交于
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 12 11月, 2019 2 次提交
-
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 25 10月, 2019 3 次提交
-
-
由 Peter Krempa 提交于
The function now does not return an error so we can drop it fully. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
The function now does not return an error so we can drop it fully. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Drop the dead code by using glib's allocator. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 24 10月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
In few places we have the following code pattern: int ret; ... /* @ret is not accessed here */ ret = f(...); return ret; This pattern can be written less verbose: ... return f(...); This patch was generated with following coccinelle spatch: @@ type T; constant C; expression f; identifier ret; @@ -T ret = C; ... when != ret -ret = f; -return ret; +return f; Afterwards I needed to fix a few places, e.g. comment in virDomainNetIPParseXML() was removed too because coccinelle thinks it refers to @ret while in fact it doesn't. Also in few places it replaced @ret declaration with a few spaces instead of removing the line. But nothing terribly wrong. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 21 10月, 2019 2 次提交
-
-
由 Ján Tomko 提交于
Replace all occurrences of if (VIR_STRDUP(a, b) < 0) /* effectively dead code */ with: a = g_strdup(b); Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
My commit removed the last use in the version for platforms without readline. Fixes: c937c1d2Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 20 10月, 2019 4 次提交
-
-
由 Ján Tomko 提交于
Now that we use g_strdup everywhere, delete vshStrdup. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Remove all the uses of vshStrdup in favor of GLib's g_strdup. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Remove the use of vshStrdup. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Split the parameters to make changes more readable. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 16 10月, 2019 1 次提交
-
-
由 Ján Tomko 提交于
Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 10月, 2019 1 次提交
-
-
由 Ján Tomko 提交于
Use G_GNUC_UNUSED from GLib instead of ATTRIBUTE_UNUSED. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 07 10月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
We're using gnulib to get ffs, ffsl, rotl32, count_one_bits, and count_leading_zeros. Except for rotl32 they can all be replaced with gcc/clangs builtins. rotl32 is a one-line trivial function. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 07 8月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Now that 100% of libvirt code is forbidden in a SUID environment, we no longer need to worry about whether env variables are trustworthy or not. The virt-login-shell setuid program, which does not link to any libvirt code, will purge all environment variables, except $TERM, before invoking the virt-login-shell-helper program which uses libvirt. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 25 7月, 2019 1 次提交
-
-
由 Ján Tomko 提交于
We don't need domain_conf or libvirt-{qemu,lxc} in these generic files. Signed-off-by: NJán Tomko <jtomko@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
- 12 4月, 2019 1 次提交
-
-
由 Andrea Bolognani 提交于
This code is needed to use readline older than 4.1, but all our target platforms ship with at least 6.0 these days so we can safely get rid of it. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 25 3月, 2019 3 次提交
-
-
由 Eric Blake 提交于
Since test:///default resets state on every connection, writing a test that covers a sequence of commands must be done from a single session. But if the test wants to exercise particular failure modes as well as successes, it can be nice to leave witnesses in the stderr stream immediately before and after the spot where the expected error should be, to ensure the rest of the script is not causing errors. Do this by adding an --err option. Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Eric Blake 提交于
As the previous commit mentioned, argv mode (such as when you feed virsh via stdin with <<\EOF instead of via a single shell argument) didn't permit comments. Do this by treating any command name token that starts with # as a comment which silently eats all remaining arguments to the next newline or semicolon. Note that batch mode recognizes unquoted # at the start of any word as a command as part of the tokenizer, while this patch only treats # at the start of the command word as a comment (any other # remaining by the time vshCommandParse() is processing things was already quoted during the tokenzier, and as such was probably intended as the actual argument to the command word earlier in the line). Now I can do something like: $ virsh -c test:///default <<EOF # setup snapshot-create-as test s1 snapshot-create-as test s2 # check snapshot-list test --name EOF Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Eric Blake 提交于
Continuing from what I did in commit 4817dec0, now I want to write a sequence that is self-documenting. So I need comments :) Now I can do something like: $ virsh -c test:///default ' # setup snapshot-create-as test s1 snapshot-create-as test s2 # check snapshot-list test --name ' Note that this does NOT accept comments in argv mode, another patch will tackle that. (If I'm not careful, I might turn virsh into a full-fledged 'sh' replacement? Here's hoping I don't go that far...) Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 12 3月, 2019 2 次提交
-
-
由 Peter Krempa 提交于
It's meant for testing, not for production builds. Also we have a helper for reporting OOM errors. Introduced by 23e0bf1cSigned-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Eric Blake 提交于
In local testing, I accidentally introduced a self-test failure, and spent way too much time debugging it. Make sure the testsuite log includes some hint as to why command option validation failed. Lone exception: allocation failure is unlikely during self-test, and if it happens, we are better off asserting (vsh.c can do this, even if libvirt.so cannot). Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
- 27 2月, 2019 2 次提交
-
-
由 Eric Blake 提交于
The previous patch made it possible to split multiple commands by adding newline, but not to split a long single command. The sequence backslash-newline was being used as if it were a quoted newline character, rather than completely elided the way the shell does. Again, add more tests, although this time it seems more like I am suffering from a leaning-toothpick syndrome with all the \. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
I wanted to do a demonstration with virsh batch mode, which takes multiple commands all packed into a single argument: $ virsh -c test:///default 'echo a; echo b;' a b but that produced a really long line, so I tried to make it more legible: $ virsh -c test:///default ' echo a; echo b; ' error: unknown command: ' ' Let's be more like the shell, and treat unquoted newline as a command separator just as we do for semicolon. In fact, with that, I can even now mix styles: $ virsh -c test:///default ' echo a; echo b echo c ' a b c Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 03 1月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
In 60046283 we've tried to remove Author(s): lines from comments at the beginning of our source files. Well, in some files while we removed the "Author" line we did not remove the actual list of authors. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-