- 27 8月, 2019 1 次提交
-
-
由 Jim Fehlig 提交于
After the legacy xen driver was removed the libxl driver became the only consumer of xenconfig. Move the few files in xenconfig to the libxl driver and remove the directory. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 08 8月, 2019 2 次提交
-
-
由 Daniel P. Berrangé 提交于
The AM_CPPFLAGS setting includes the gnulib headers, which means we can get some replacement functions defined. Since virt-login-shell and the NSS module intentionally don't link to gnulib, these replacement functions causes link failures. This was seen cross-compiling on Debian for example: virt-login-shell.o: In function `main': /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:81: undefined reference to `rpl_strerror' /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:66: undefined reference to `rpl_strerror' /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:75: undefined reference to `rpl_strerror' The only way to avoid these replacement gnulib headers is to drop the -Ignulib/lib flags. We do still want to use gnulib for configmake.h and intprops.h, but those can be included via their full path. We must also stop using internal.h, since that expects -Ignulib/lib to be on the include path in order to resolve the verify.h header. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Eric Blake 提交于
Requires adjustments to use verify_expr() which replaces verify_true(), and to disable the new syntax check 'sc_prohibit_gnu_make_extensions' since we require GNU make. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 07 8月, 2019 7 次提交
-
-
由 Daniel P. Berrangé 提交于
The .leases file is currently loaded using the virLease class, which in turn uses the virJSON parsing code. This pulls in a heap of libvirt code (logging, hash tables, etc) which we do not wish to depend on. This uses the yajl parser code directly, so the only dep is yajl and plain libc functions. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The .macs file is currently loaded using the virMacMap class, which in turn uses the virJSON parsing code. This pulls in a heap of libvirt code (logging, hash tables, objects, etc) which we do not wish to depend on. This uses the yajl parser code directly, so the only dep is yajl and plain libc functions. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Build a list of mac addresses immediately, so that later code searching for leases can be simplified and avoid needing to use the virMacMap object. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Use the plain libc APIs to avoid a dependancy on the main libvirt code from the nss module. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Use the plain libc APIs to avoid a dependancy on the main libvirt code from the nss module. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 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>
-
由 Daniel P. Berrangé 提交于
The virt-login-shell binary is a setuid program that takes no arguments. When invoked it looks at the invoking uid, resolves it to a username, and finds an LXC guest with the same name. It then starts the guest and runs the shell in side the namespaces of the container. Given this set of tasks the virt-login-shell binary needs to connect to libvirtd, make various other libvirt API calls. This is a problem for setuid binaries as various libraries that libvirt.so links to are not safe. For example, they have constructor functions which execute an unknown amount of code that can be influenced by env variables. For this reason virt-login-shell doesn't use libvirt.so, but instead links to a custom, cut down, set of source files sufficient to be a local client only. This introduces a problem for integrating glib2 into libvirt though, as once integrated, there would be no way to build virt-login-shell without an external dependancy on glib2 and this is definitely not setuid safe. To resolve this problem, we split the virt-login-shell binary into two parts. The first part is setuid and does almost nothing. It simply records the original uid+gid, and then invokes the virt-login-shell-helper binary. Crucially when it does this it completes scrubs all environment variables. It is thus safe for virt-login-shell-helper to link to the normal libvirt.so. Any things that constructor functions do cannot be influenced by user control env vars or cli args. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 21 6月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Libvirtd has long had integration with avahi for advertising libvirtd using mDNS when TCP/TLS listening is enabled. For a long time the virt-manager application had support for auto-detecting libvirtds on the local network using mDNS, but this was removed last year commit fc8f8d5d7e3ba80a0771df19cf20e84a05ed2422 Author: Cole Robinson <crobinso@redhat.com> Date: Sat Oct 6 20:55:31 2018 -0400 connect: Drop avahi support Libvirtd can advertise itself over avahi. The feature is disabled by default though and in practice I hear of no one actually using it and frankly I don't think it's all that useful The 'Open Connection' wizard has a disproportionate amount of code devoted to this feature, but I don't think it's useful or worth maintaining, so let's drop it I've never heard of any other applications having support for using mDNS to detect libvirtd instances. Though it is theoretically possible something exists out there, it is clearly going to be a niche use case in the virt ecosystem as a whole. By removing avahi integration we can cut down the dependency chain for the basic libvirtd install and reduce our code maint burden. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 20 6月, 2019 1 次提交
-
-
由 Peter Krempa 提交于
In some cases we report a low level error message which does not have enough information to see what the problem is. To allow improving on this add an API which will prefix the error message with another error message string which can be used to describe where the error comes from. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 18 6月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
It's fairly easy (especially for new contributors) to not spot the 'cppi not installed' line in the syntax-check output. Add a banner that is shown at the end of syntax-check output if no cppi was found. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> ACKed-by: NAndrea Bolognani <abologna@redhat.com>
-
- 03 6月, 2019 1 次提交
-
-
由 Andrea Bolognani 提交于
All other examples are organized using the either the format/ or the format/category/ hierarchy already, and grouping all C programs together removes the last remaining outliers. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 09 5月, 2019 1 次提交
-
-
由 Eric Blake 提交于
This brings about a couple of benefits: - use of VIR_AUTOUNREF() simplifies several callers - Fixes a todo about virDomainMomentObjList not being polymorphic enough Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
- 12 4月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
Drop the checking for _LAST optionally on the first line, previous patch removed all those instances Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 03 4月, 2019 3 次提交
-
-
由 Daniel P. Berrangé 提交于
The use of d_type is non-portable and leads to surprises when the OS does not fill in any value except DT_UNKNOWN. Blacklist its usage except in files which inherantly don't require portability (cgroups). Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Quite a few of the tests have a need to mock the stat() / lstat() functions and they are taking somewhat different & inconsistent approaches none of which are actually fully correct. This is shown by fact that 'make check' fails on 32-bit hosts. Investigation revealed that the code was calling into the native C library impl, not getting intercepted by our mocks. The POSIX stat() function might resolve to any number of different symbols in the C library. The may be an additional stat64() function exposed by the headers too. On 64-bit hosts the stat & stat64 functions are identical, always refering to the 64-bit ABI. On 32-bit hosts they refer to the 32-bit & 64-bit ABIs respectively. Libvirt uses _FILE_OFFSET_BITS=64 on 32-bit hosts, which causes the C library to transparently rewrite stat() calls to be stat64() calls. Libvirt will never see the 32-bit ABI from the traditional stat() call. We cannot assume this rewriting is done using a macro. It might be, but on GLibC it is done with a magic __asm__ statement to apply the rewrite at link time instead of at preprocessing. In GLibC there may be two additional functions exposed by the headers, __xstat() and __xstat64(). When these exist, stat() and stat64() are transparently rewritten to call __xstat() and __xstat64() respectively. The former symbols will not actally exist in the library at all, only the header. The leading "__" indicates the symbols are a private impl detail of the C library that applications should not care about. Unfortunately, because we are trying to mock replace the C library, we need to know about this internal impl detail. With all this in mind the list of functions we have to mock will depend on several factors - If _FILE_OFFSET_BITS is set, then we are on a 32-bit host, and we only need to mock stat64 and __xstat64. The other stat / __xstat functions exist, but we'll never call them so they can be ignored for mocking. - If _FILE_OFFSET_BITS is not set, then we are on a 64-bit host and we should mock stat, stat64, __xstat & __xstat64. Either may be called by app code. - If __xstat & __xstat64 exist, then stat & stat64 will not exist as symbols in the library, so the latter should not be mocked. The same all applies to lstat() These rules are complex enough that we don't want to duplicate them across every mock file, so this centralizes all the logic in a helper file virmockstathelper.c that should be #included when needed. The code merely need to provide a filename rewriting callback called virMockStatRedirect(). Optionally VIR_MOCK_STAT_HOOK can be defined as a macro if further processing is needed inline. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Andrea Bolognani 提交于
Our ChangeLog is generated by basically redirecting the output of 'git log' into it so, as can be expected, it has only gotten bigger as development has progressed. As of today, its size has reached pretty much comical levels: $ du -sk ChangeLog 11328 ChangeLog All of that for information *literally nobody* cares about: end users and distro maintainers have proper release notes lovingly compiled for them, while developers peruse the history either by calling 'git log' directly or through their favorite $EDITOR's git integration. Replacing the generated ChangeLog with a short message pointing interested parties to the git repository does not only reduce the size of the unpacked sources from 259904 KiB to 248576 KiB (~4% saving): from a quick test on my laptop, doing so reduces the size of the *compressed* release archive from 15140 KiB to 12364 KiB (~18% saving) and also takes the time needed to run 'make distcheck' down from 4:44 to 4:21 (~8% saving). Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 18 3月, 2019 1 次提交
-
-
由 Nikolay Shirokovskiy 提交于
Vim treats *.h files as cpp ones with respect to syntax highlighting. Thus "class" in _virNodeDevCapPCIDev highlighted mistakenly. This can be fixed by filetype detection code tunables but it is more convinient to skip this tuning by every project member. Let's just use "klass" as field name instead of _class or class and add syntax rule. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 04 3月, 2019 1 次提交
-
-
由 Peter Krempa 提交于
The syntax-check should also check the new ones. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 25 2月, 2019 1 次提交
-
-
由 Marc Hartmayer 提交于
Replace virDomainChrSourceDefFree with virObjectUnref. Signed-off-by: NMarc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 12 2月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
Move the majority of the packet-libvirt.h content into packet-libvirt.c and expose only register functions which are the only ones that are not static. The rationale behind is that packet-libvirt.h will be included from packet.c and therefore the header file needs to be as clean as possible. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 31 1月, 2019 1 次提交
-
-
由 Peter Krempa 提交于
Security labeling of disks consists of labeling of the disk image itself and it's backing chain. Modify virSecurityManager[Set|Restore]ImageLabel to take a boolean flag that will label the full chain rather than the top image itself. This allows to delete/unify some parts of the code and will also simplify callers in some cases. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 09 1月, 2019 2 次提交
-
-
由 Eric Blake 提交于
mingw lacks localtime_r(); we were getting it from gnulib. But since commit acf522e8 stopped linking examples against gnulib, we are getting a build failure. Keep the examples standalone, and work around mingw by using the non-reentrant localtime() (safe since our examples are single-threaded), and add a necessary exemption to our syntax check. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Andrea Bolognani 提交于
The check was concerning itself with whitespace where it didn't need to, and used some confusing escaping for one of its regular expressions - which GNU sed was fine with, but FreeBSD's sed didn't like one bit. Switch to extended regular expressions (which, incidentally, were already in use in the same rule when calling grep) and remove all whitespace handling. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 08 1月, 2019 2 次提交
-
-
由 Eric Blake 提交于
Similar to the gnulib changes we just incorporated into maint.mk, it's time to use '$(VC_LIST) | xargs program' instead of 'program $$($(VC_LIST))', in order to bypass the problem of hitting argv limits due to our large set of files. Drop several uses of $$files as a temporary variable when we can instead directly use xargs. While at it, fix a typo in the prohibit_windows_special_chars error message. Note that 'grep $pattern $(generate list)' has be be rewritten as 'generate list | xargs grep $pattern /dev/null' - this is because for a list that is just long enough, and without /dev/null, xargs could make a worst-case split of 'grep $pattern all but one; grep $pattern last' which has different output (grep includes the filename when there was more than one file, but omits it for a single file), while our conversion gives 'grep $pattern /dev/null all but one; grep $pattern /dev/null last'. We are less concerned about the empty list case (why would we run the syntax check if we didn't have at least one file?), but grepping /dev/null happens to produce no output and thus nicely also solves that problem without relying on the GNU extension of 'xargs -r'. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Eric Blake 提交于
We already used $(GREP) in some places, but might as well use it everywhere during syntax check, in line with similar recent gnulib changes. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 04 1月, 2019 1 次提交
-
-
由 Eric Blake 提交于
Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 19 12月, 2018 1 次提交
-
-
由 Michal Privoznik 提交于
This test checks if security label remembering works correctly. It uses qemuSecurity* APIs to do that. And some mocking (even though it's not real mocking as we are used to from other tests like virpcitest). So far, only DAC driver is tested. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 14 12月, 2018 3 次提交
-
-
由 Daniel P. Berrangé 提交于
A missing $(AM_V_GEN) meant the raw command was printed by mistake. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
This introduces a syntax-check script that validates header files use a common layout: /* ...copyright header... */ <one blank line> #ifndef SYMBOL # define SYMBOL ....content.... #endif /* SYMBOL */ For any file ending priv.h, before the #ifndef, we will require a guard to prevent bogus imports: #ifndef SYMBOL_ALLOW # error .... #endif /* SYMBOL_ALLOW */ <one blank line> The many mistakes this script identifies are then fixed. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
In many files there are header comments that contain an Author: statement, supposedly reflecting who originally wrote the code. In a large collaborative project like libvirt, any non-trivial file will have been modified by a large number of different contributors. IOW, the Author: comments are quickly out of date, omitting people who have made significant contribitions. In some places Author: lines have been added despite the person merely being responsible for creating the file by moving existing code out of another file. IOW, the Author: lines give an incorrect record of authorship. With this all in mind, the comments are useless as a means to identify who to talk to about code in a particular file. Contributors will always be better off using 'git log' and 'git blame' if they need to find the author of a particular bit of code. This commit thus deletes all Author: comments from the source and adds a rule to prevent them reappearing. The Copyright headers are similarly misleading and inaccurate, however, we cannot delete these as they have legal meaning, despite being largely inaccurate. In addition only the copyright holder is permitted to change their respective copyright statement. Reviewed-by: NErik Skultety <eskultet@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 16 11月, 2018 1 次提交
-
-
由 Michal Privoznik 提交于
This reverts commit 3e26b476. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 15 11月, 2018 1 次提交
-
-
由 Yi Min Zhao 提交于
Add zPCI definitions in preparation of extending the PCI address with parameters uid (user-defined identifier) and fid (PCI function identifier). Signed-off-by: NYi Min Zhao <zyimin@linux.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: NStefan Zimmermann <stzi@linux.ibm.com> Reviewed-by: NBjoern Walk <bwalk@linux.ibm.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
- 19 10月, 2018 1 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1640465 Weirdly enough, there can be symlinks in the path we are trying to fix. If it is the case our clever algorithm that finds matches against mount table won't work. Canonicalize path at the beginning then. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 18 9月, 2018 1 次提交
-
-
由 Michal Privoznik 提交于
Now that we know what metadata lock manager user wishes to use we can load it when initializing security driver. This is achieved by adding new argument to virSecurityManagerNewDriver() and subsequently to all functions that end up calling it. The cfg.mk change is needed in order to allow lock_manager.h inclusion in security driver without 'syntax-check' complaining. This is safe thing to do as locking APIs will always exist (it's only backend implementation that changes). However, instead of allowing the include for all other drivers (like cpu, network, and so on) allow it only for security driver. This will still trigger the error if including from other drivers. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 12 9月, 2018 1 次提交
-
-
由 Shi Lei 提交于
Signed-off-by: NShi Lei <shi_lei@massclouds.com>
-
- 14 7月, 2018 1 次提交
-
-
由 Sukrit Bhatnagar 提交于
A variable, which is never assigned a value in the function, might get passed into the cleanup function which may or may not raise any errors. To maintain the correct usage, the variable must be initialized, either with a value or with NULL. This syntax-check rule takes care of that. Signed-off-by: NSukrit Bhatnagar <skrtbhtngr@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 04 5月, 2018 1 次提交
-
-
由 Andrea Bolognani 提交于
We want to make sure our wrapper is used instead in order to keep the test suite working. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-