- 10 12月, 2019 3 次提交
-
-
由 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>
-
由 Pavel Hrdina 提交于
The same way how we have IS_EOL in two files where we actually need it defince IS_BLANK so we can drop usage of c_isblank. Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
- 12 11月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 25 10月, 2019 1 次提交
-
-
由 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>
-
- 21 10月, 2019 1 次提交
-
-
由 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>
-
- 15 10月, 2019 1 次提交
-
-
由 Ján Tomko 提交于
Also define the macro for building with GLib older than 2.60 Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 12 4月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
Standardize on putting the _LAST enum value on the second line of VIR_ENUM_IMPL invocations. Later patches that add string labels to VIR_ENUM_IMPL will push most of these to the second line anyways, so this saves some noise. Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 04 2月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
Missing semicolon at the end of macros can confuse some analyzers (like cppcheck <filename>), and we have a mix of semicolon and non-semicolon usage through the code. Let's standardize on using a semicolon for VIR_ENUM_IMPL calls. Move the verify() statement to the end of the macro and drop the semicolon, so the compiler will require callers to add a semicolon. While we are touching these call sites, standardize on putting the closing parenth on its own line, as discussed here: https://www.redhat.com/archives/libvir-list/2019-January/msg00750.htmlReviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NCole Robinson <crobinso@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>
-
- 24 9月, 2018 1 次提交
-
-
由 Shi Lei 提交于
This patch just fixes misaligned arguments and misaligned conditions of src/util/*.c. Signed-off-by: NShi Lei <shi_lei@massclouds.com>
-
- 20 9月, 2018 2 次提交
-
-
由 Erik Skultety 提交于
All of the ones being removed are pulled in by internal.h. The only exception is sanlock which expects the application to include <stdint.h> before sanlock's headers, because sanlock prototypes use fixed width int, but they don't include stdint.h themselves, so we have to leave that one in place. Signed-off-by: NErik Skultety <eskultet@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Erik Skultety 提交于
It doesn't really make sense for us to have stdlib.h and string.h but not stdio.h in the internal.h header. Signed-off-by: NErik Skultety <eskultet@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 22 2月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Ensure all enum cases are listed in switch statements. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 09 11月, 2017 1 次提交
-
-
由 Jim Fehlig 提交于
There was a recent report of the xen-xl converter not handling config files missing an ending newline https://www.redhat.com/archives/libvir-list/2017-October/msg01353.html Commit 3cc2a9e0 fixed a similar problem when parsing content of a file but missed parsing in-memory content. But AFAICT, the better fix is to properly set the end of the content when initializing the virConfParserCtxt in virConfParse(). This commit reverts the part of 3cc2a9e0 that appends a newline to files missing it, and fixes setting the end of content when initializing virConfParserCtxt. A test is also added to check parsing in-memory content missing an ending newline. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 03 11月, 2017 1 次提交
-
-
由 Andrea Bolognani 提交于
Right-aligning backslashes when defining macros or using complex commands in Makefiles looks cute, but as soon as any changes is required to the code you end up with either distractingly broken alignment or unnecessarily big diffs where most of the changes are just pushing all backslashes a few characters to one side. Generated using $ git grep -El '[[:blank:]][[:blank:]]\\$' | \ grep -E '*\.([chx]|am|mk)$$' | \ while read f; do \ sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \ done Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
-
- 18 10月, 2017 2 次提交
-
-
由 Erik Skultety 提交于
There were a bunch of commentary blocks that were literally useless in terms of describing what the code following them does, since most of them were documenting "the obvious" or it just wouldn't help at all. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
So we have a syntax-check rule to catch all tab indents but it naturally can't catch tab spacing, i.e. as a delimiter. This patch is a result of running 'vim -en +retab +wq' (using tabstop=8 softtabstop=4 shiftwidth=4 expandtab) on each file from a list generated by the following: find . -regextype gnu-awk \ -regex ".*\.(rng|syms|html|s?[ch]|py|pl|php(\.code)?)(\.in)?" \ | xargs git grep -lP "\t" Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 08 8月, 2017 1 次提交
-
-
由 Ján Tomko 提交于
Rewrite virConfReadMem to take a null-terminated string. All the callers were calling strlen on it anyway.
-
- 13 6月, 2017 1 次提交
-
-
由 Marc Hartmayer 提交于
Use ATTRIBUTE_FALLTHROUGH, introduced by commit 5d84f596, instead of comments to indicate that the fall through is an intentional behavior. Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
-
- 15 5月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
virConfAddEntry spams debug logs even for fully commented out lines. Skip such messages to avoid: 2017-05-12 12:35:38.867+0000: 10820: debug : virConfAddEntry:241 : Add entry (null) (nil) 2017-05-12 12:35:38.867+0000: 10820: debug : virConfAddEntry:241 : Add entry (null) (nil) 2017-05-12 12:35:38.867+0000: 10820: debug : virConfAddEntry:241 : Add entry (null) (nil) 2017-05-12 12:35:38.867+0000: 10820: debug : virConfAddEntry:241 : Add entry (null) (nil) 2017-05-12 12:35:38.867+0000: 10820: debug : virConfAddEntry:241 : Add entry (null) (nil) ... This also fixes NULL passed to printf.
-
- 14 4月, 2017 1 次提交
-
-
由 Wim ten Have 提交于
Fix xlconfigtest runs build for --enable-test-oom on Xen XL-2-XML Parse channel-pty Program received signal SIGSEGV, Segmentation fault. #0 0x00007ffff3c2b373 in __strchr_sse2 () from /lib64/libc.so.6 ==> #1 0x00007ffff7875701 in virConfSaveValue (buf=buf@entry=0x7fffffffd8a0, val=val@entry=0x674750) at util/virconf.c:290 #2 0x00007ffff7875668 in virConfSaveValue (buf=buf@entry=0x7fffffffd8a0, val=<optimized out>) at util/virconf.c:306 #3 0x00007ffff78757ef in virConfSaveEntry (buf=buf@entry=0x7fffffffd8a0, cur=cur@entry=0x674780) at util/virconf.c:338 #4 0x00007ffff78783eb in virConfWriteMem (memory=0x665570 "", len=len@entry=0x7fffffffd910, conf=conf@entry=0x65b940) at util/virconf.c:1543 #5 0x000000000040eccb in testCompareParseXML (replaceVars=<optimized out>, xml=<optimized out>, xlcfg=0x662c00 "/home/wtenhave/WORK/libvirt/OOMtesting/libvirt-devel/tests/xlconfigdata/test-channel-pty.cfg") at xlconfigtest.c:108 #6 testCompareHelper (data=<optimized out>) at xlconfigtest.c:205 #7 0x0000000000410b3a in virTestRun (title=title@entry=0x432cc0 "Xen XL-2-XML Parse channel-pty", body=body@entry=0x40e9b0 <testCompareHelper>, data=data@entry=0x7fffffffd9f0) at testutils.c:247 #8 0x000000000040f322 in mymain () at xlconfigtest.c:278 #9 0x0000000000411410 in virTestMain (argc=1, argv=0x7fffffffdba8, func=0x40f660 <mymain>) at testutils.c:992 #10 0x00007ffff3bc0401 in __libc_start_main () from /lib64/libc.so.6 #11 0x000000000040e86a in _start () (gdb) frame 1 #1 0x00007ffff7875701 in virConfSaveValue (buf=buf@entry=0x7fffffffd8a0, val=val@entry=0x674750) at util/virconf.c:290 290 if (strchr(val->str, '\n') != NULL) { (gdb) print *val $1 = {type = VIR_CONF_STRING, next = 0x0, l = 0, str = 0x0, list = 0x0} Signed-off-by: NWim ten Have <wim.ten.have@oracle.com>
-
- 25 11月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
We have couple of functions that operate over NULL terminated lits of strings. However, our naming sucks: virStringJoin virStringFreeList virStringFreeListCount virStringArrayHasString virStringGetFirstWithPrefix We can do better: virStringListJoin virStringListFree virStringListFreeCount virStringListHasString virStringListGetFirstWithPrefix Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 27 7月, 2016 1 次提交
-
-
由 Erik Skultety 提交于
Since commit c4bdff19, the path to the configuration file has been constructed in the following manner: - if no config filename was passed to virConfLoadConfigPath, libvirt.conf was used as default - otherwise the filename was concatenated with "<config_dir>/libvirt/libvirt%s%s.conf" which in admin case resulted in "libvirt-libvirt-admin.conf.conf". Obviously, this non-existent config led to ignoring all user settings in libvirt-admin.conf. This patch requires the config filename to be always provided as an argument with the concatenation being simplified. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1357364Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 19 7月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Since we VIR_ALLOC_N to *values, the VIR_FREE should be done likewise Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 18 7月, 2016 8 次提交
-
-
由 Andrea Bolognani 提交于
Since commit 6381c89f, we're storing long long integers instead of long integers. Rename the corresponding virConfType value accordingly.
-
由 Andrea Bolognani 提交于
We use unsigned long long integers unless we need to store a negative value. Rewrite the condition to make this more obvious.
-
由 Andrea Bolognani 提交于
The parameters for virConfGetValueLLong() were not aligned properly.
-
由 Andrea Bolognani 提交于
The name of the function is not virConfGetValueULongLong().
-
由 Andrea Bolognani 提交于
virConfGetValueLLong() errors out if the value is too big to fit into a long long integer, but claims the supported range to be (0,LLONG_MAX) instead of (LLONG_MIN,LLONG_MAX).
-
由 Andrea Bolognani 提交于
For good measure.
-
由 Andrea Bolognani 提交于
When parsing numeric values, we always store them as unsigned unless they're negative. We can use this fact to simplify the logic by removing a bunch of unnecessary checks.
-
由 Andrea Bolognani 提交于
Commit 6381c89f changed virConfValue to store long long integers instead of long integers; however, the temporary variable used in virConfParseLong() was not updated accordingly, causing trouble for 32-bit machines.
-
- 15 7月, 2016 3 次提交
-
-
由 Daniel P. Berrange 提交于
If size_t is the same size as long long, then we can skip some of the range checks. This avoids triggering some bogus compiler warning messages. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The virConf 'l' field is a 'signed long long', so whenever the 'type' field is VIR_CONF_ULONG, we should explicitly cast 'l' to a 'unsigned long long' before doing range checks. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Michal Privoznik 提交于
This function tries to get a ssize_t value from a config file. But before returning it, it checks whether the value would fit in ssize_t and if not an error is printed out among with the range for the ssize_t type. However, on some platforms SSIZE_MAX may actually be a signed long type: util/virconf.c: In function 'virConfGetValueSSizeT': util/virconf.c:1268:9: error: format '%zd' expects argument of type 'signed size_t', but argument 9 has type 'long int' [-Werror=format=] virReportError(VIR_ERR_INTERNAL_ERROR, ^ $ grep -r SSIZE_MAX /usr/include/ /usr/include/bits/posix1_lim.h:#ifndef SSIZE_MAX /usr/include/bits/posix1_lim.h:# define SSIZE_MAX LONG_MAX Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 12 7月, 2016 2 次提交
-
-
由 Daniel P. Berrange 提交于
Currently many users of virConf APIs are defining the same macros for calling virConfValue() and then doing type checking. To remove this repeated code, add a set of typesafe accessor methods. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
If the config file does not end with a \n, the parser will append one. When re-allocating the array though, it is mistakenly assuming that 'len' is the length including the trailing NUL, but it does not. So we must add 2 to len, when reallocating, not 1. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 22 4月, 2016 1 次提交
-
-
由 Cole Robinson 提交于
$ echo -n 'log_level=1' > ~/.config/libvirt/libvirtd.conf $ libvirtd --timeout=10 2014-10-10 10:30:56.394+0000: 6626: info : libvirt version: 1.1.3.6, package: 1.fc20 (Fedora Project, 2014-09-08-17:50:42, buildvm-05.phx2.fedoraproject.org) 2014-10-10 10:30:56.394+0000: 6626: error : main:1261 : Can't load config file: configuration file syntax error: /home/rjones/.config/libvirt/libvirtd.conf:1: expecting a value: /home/rjones/.config/libvirt/libvirtd.conf Rather than try to fix this in the depths of the parser, just catch the case when a config file doesn't end in a newline, and manually append a newline to the content before parsing https://bugzilla.redhat.com/show_bug.cgi?id=1151409
-
- 30 11月, 2015 1 次提交
-
-
由 Erik Skultety 提交于
virConnectGetConfig and virConnectGetConfigPath were static libvirt methods, merely because there hasn't been any need for having them internally exported yet. Since libvirt-admin also needs to reference its config file, 'xGetConfig' should be exported. Besides moving, this patch also renames the methods accordingly, as they are libvirt config specific.
-