- 08 8月, 2019 5 次提交
-
-
由 Daniel P. Berrangé 提交于
Use the correct enum constant when validating vlan usage. This fixes a merge error in commit 6cb0ec48 Author: Daniel P. Berrangé <berrange@redhat.com> Date: Mon Sep 3 17:34:22 2018 +0100 network: convert networkAllocateActualDevice to virNetworkPortDef Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 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>
-
由 Eric Blake 提交于
This reverts commit 8a8e8656. The patch was premature, as it still fails to build on mingw at least in the environment used by https://travis-ci.org/libvirt/libvirt/jobs/569132417Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Commit fed58d83 was a hack to fix a mingw build failure due to header inclusion order resulting in a clash over the use of DATADIR, repeating a trick made several other times in the past. Better is to revert that, and instead use pragmas to avoid the clash in the first place, regardless of header ordering, solving it for everyone. Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 07 8月, 2019 32 次提交
-
-
由 Daniel P. Berrangé 提交于
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Now that the code does not refer to any libvirt headers, except internal.h macros, it does not need to link to any libvirt code, nor gnulib either. The only thing it needs is yajl. 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 socket 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é 提交于
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é 提交于
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é 提交于
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. Thus we only need one API for env passthrough in virCommand. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Now that none of the libvirt.so code will ever run in a setuid context, we can remove the virIsSUID() method. The global initializer function can just inline the check itself. The new inlined check is slightly stronger as it also looks for a setgid situation. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The virt-login-shell setuid program is now a tiny piece of code that only uses standard libc functions, and santizes the execution environment before invoking the real virt-login-shell-helper. The latter is thus able to use the normal libvirt.so build, allowing us to delete the special cut down setuid library build. 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>
-
由 Daniel P. Berrangé 提交于
We'll shortly be renaming the binary to virt-login-shell-helper and introducing a new tool as virt-login-shell. Renaming the source file first gives a much more usefull diff for the next commit. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The public API entry points will call virDispatchError which will print to stderr by default. We then jump to a cleanup path which calls virDispatchError again. We tried to stop the entry points printing to stderr, but incorrectly called virSetErrorFunc. It needs a real function that is a no-op, not a NULL function. Once we fix virSetErrorFunc, then we need to use fprintf in the cleanup path instead of virDispatchError. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
If the 'allowed_users' config setting in virt-login-shell.conf does not exist, we dereference a NULL pointer resulting in a crash. We should check for this case and thus ensure the user is denied access gracefully. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 John Ferlan 提交于
Commit d2899a64 added a new exit path, but didn't free @fakerootdir. Let's just use VIR_AUTOFREE instead to make life easier. Found by Coverity Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 John Ferlan 提交于
If virQEMUDriverGetCapabilities returns NULL, then a subsequent deref of @caps would cause an error, so we just return failure. Found by Coverity Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel P. Berrangé 提交于
The previous bump to 4.4 was done in: commit 24241c23 Author: Daniel P. Berrange <berrange@redhat.com> Date: Wed Jul 5 10:35:32 2017 +0100 Require use of GCC 4.4 or CLang compilers with 4.4 picked due to RHEL-6. Since we dropped RHEL-6, the next oldest distro is RHEL-7 (4.8.5), and thus we pick 4.8 as the new min. Reviewed-by: NAndrea Bolognani <abologna@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Ilias Stamatis 提交于
Signed-off-by: NIlias Stamatis <stamatis.iliass@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Ilias Stamatis 提交于
Until now, testDomainGetTime would always return the same fixed values everytime it was called. By using domain-private data we can make this API return the values previously set with testDomainSetTime, or use the same old fixed values in case testDomainSetTime hasn't been called at all. Signed-off-by: NIlias Stamatis <stamatis.iliass@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
Typo introduced by commit d73f3f58. https://bugzilla.redhat.com/show_bug.cgi?id=1738483Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Ilias Stamatis 提交于
The qemu and vz implementations don't emit any signals when this API is called, so we can do the same here for now and succeed by doing nothing. Signed-off-by: NIlias Stamatis <stamatis.iliass@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Cole Robinson 提交于
The qemu driver already does some <rng> model validation, based on qemuCaps. However, the logic for exposing <rng> model values in domcaps is basically identical. This drops the qemuCaps checking and compares against the domCaps data directly. This approach makes it basically impossible to add a new <rng> model to the qemu driver without extending domcaps. The validation can also be shared with other drivers eventually. Reviewed-by: NReviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
Fill in virDomainCaps at Validate time and use it to call virDomainCapsDeviceDefValidate Reviewed-by: NReviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
This is an entrypoint to validate a virDomainDeviceDef against values filled into virDomainCaps. Currently it's just a stub Reviewed-by: NReviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
qemuCaps is tied to a binary on disk. domCaps is tied to a combo of binary+machine+arch+virttype values. For the qemu driver this almost entirely translates to a permutation of qemuCaps though Upcoming patches want to use the domCaps data store at XML validate time, but we need to cache the data so we aren't repeatedly regenerating it. Add a domCapsCache hash table to qemuCaps. This ensures that the domCaps cache is blown away whenever qemuCaps needs to be regenerated. Similarly when qemuCaps is invalidated, the next call to virQEMUCapsCacheLookup will unref qemuCaps and free our cache as well. Adjust virQEMUDriverGetDomainCapabilities to search the cache and add to it if we don't find a hit. Signed-off-by: NCole Robinson <crobinso@redhat.com> Reviewed-by: NReviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Cole Robinson 提交于
For now it's just a helper for building a qemu virDomainCapsPtr, used in qemuConnectGetDomainCapabilities Reviewed-by: NReviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
The model logic is taken from qemuDomainRNGDefValidate Reviewed-by: NReviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
This adds device <rng> reporting. Example output: <rng supported='yes'> <enum name='model'> <value>virtio</value> <value>virtio-transitional</value> <value>virtio-non-transitional</value> </enum> <enum name='backendModel'> <value>random</value> <value>egd</value> </enum> </rng> Reviewed-by: NReviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 06 8月, 2019 3 次提交
-
-
由 Michal Privoznik 提交于
This way it is obvious when adding a new resource control type that stats helper func needs to be updated too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
If the host doesn't have resctrl then the monitor is going to be NULL and we must avoid dereferencing it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
The capabilities object must be unrefed when no longer needed. Use VIR_AUTOUNREF() for that. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-