summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* api: disallow virConnectGetDomainCapabilities on read-only connectionsv1.3.1-maintJán Tomko2019-06-241-0/+1
| | | | | | | | | | | This API can be used to execute arbitrary emulators. Forbid it on read-only connections. Fixes: CVE-2019-10167 Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> (cherry picked from commit 8afa68bac0cf99d1f8aaa6566685c43c22622f26) Signed-off-by: Ján Tomko <jtomko@redhat.com>
* api: disallow virDomainSaveImageGetXMLDesc on read-only connectionsJán Tomko2019-06-243-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The virDomainSaveImageGetXMLDesc API is taking a path parameter, which can point to any path on the system. This file will then be read and parsed by libvirtd running with root privileges. Forbid it on read-only connections. Fixes: CVE-2019-10161 Reported-by: Matthias Gerstner <mgerstner@suse.de> Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> (cherry picked from commit aed6a032cead4386472afb24b16196579e239580) Signed-off-by: Ján Tomko <jtomko@redhat.com> Conflicts: src/libvirt-domain.c src/remote/remote_protocol.x Upstream commit 12a51f372 which introduced the VIR_DOMAIN_SAVE_IMAGE_XML_SECURE alias for VIR_DOMAIN_XML_SECURE is not backported. Just skip the commit since we now disallow the whole API on read-only connections, regardless of the flag. Signed-off-by: Ján Tomko <jtomko@redhat.com>
* maint: fix syntax-check sc_prohibit_int_ijk exclude rulePavel Hrdina2016-10-031-1/+1
| | | | | | | | | | | Fix the regex for excluding files for this syntax-rule. The rule "include/" will not work, because we are matching the whole line like this "^(...|include/|...)$ so we need to use "include/libvirt/libvirt.+". The second issue is that we are using only one '$' but there should be two of those at the end. The last small adjustment is to escape dots '.' so it match only dot. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> (cherry picked from commit a94efa50e253cb59a2925dca2705bce801f46fb1)
* build: accomodate selinux 2.5 header API changeEric Blake2016-10-032-5/+22
| | | | | | | | | | | | | | | | | | | | Yet again, selinux has been adding const-correctness; this change is ABI-compatible, but breaks API, which affects us when we try to override things in our testsuite: ../../tests/securityselinuxhelper.c:307:24: error: conflicting types for 'selabel_open' struct selabel_handle *selabel_open(unsigned int backend, ^~~~~~~~~~~~ In file included from ../../tests/securityselinuxhelper.c:32:0: /usr/include/selinux/label.h:73:24: note: previous declaration of 'selabel_open' was here The problem is a new 'const' prior to the second parameter. Fix it the same way we did in commit 292d3f2d: check for the new const at configure time. Signed-off-by: Eric Blake <eblake@redhat.com> (cherry picked from commit 5ea3a690a28ed1d7ef1253a6e63e236541cceba2)
* build: add GCC 6.0 -Wlogical-op workaroundPavel Hrdina2016-10-035-0/+44
| | | | | | | | | | | | | | | | | | fdstream.c: In function 'virFDStreamWrite': fdstream.c:390:29: error: logical 'or' of equal expressions [-Werror=logical-op] if (errno == EAGAIN || errno == EWOULDBLOCK) { ^~ Fedora rawhide now uses gcc 6.0 and there is a bug with -Wlogical-op producing false warnings. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 Use GCC pragma push/pop and ignore -Wlogical-op for GCC that supports push/pop pragma and also has this bug. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> (cherry picked from commit d713a6b120904c488170e7920c482b2fade70ae1)
* Initialize couple of variables.Michal Privoznik2016-10-035-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While trying to build with -Os couple of compile errors showed up. conf/domain_conf.c: In function 'virDomainChrRemove': conf/domain_conf.c:13666:24: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] virDomainChrDefPtr ret, **arrPtr = NULL; ^ Compiler fails to see that @ret is used only if set in the loop, but whatever, there's no harm in initializing the variable. In vboxAttachDrivesNew and _vboxAttachDrivesOld compiler thinks that @rc may be used uninitialized. Well, not directly, but maybe after some optimization. Yet again, no harm in initializing a variable. In file included from ./util/virthread.h:26:0, from ./datatypes.h:28, from vbox/vbox_tmpl.c:43, from vbox/vbox_V3_1.c:37: vbox/vbox_tmpl.c: In function '_vboxAttachDrivesOld': ./util/virerror.h:181:5: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ ^ In file included from vbox/vbox_V3_1.c:37:0: vbox/vbox_tmpl.c:1041:14: note: 'rc' was declared here nsresult rc; ^ Yet again, one uninitialized variable: qemu/qemu_driver.c: In function 'qemuDomainBlockCommit': qemu/qemu_driver.c:17194:9: error: 'baseSource' may be used uninitialized in this function [-Werror=maybe-uninitialized] qemuDomainPrepareDiskChainElement(driver, vm, baseSource, ^ And another one: storage/storage_backend_logical.c: In function 'virStorageBackendLogicalMatchPoolSource.isra.2': storage/storage_backend_logical.c:618:33: error: 'thisSource' may be used uninitialized in this function [-Werror=maybe-uninitialized] thisSource->devices[j].path)) ^ Signed-off-by: Michal Privoznik <mprivozn@redhat.com> (cherry picked from commit bde6e002b52d110585a0d1618d25878ba177e927)
* util: bitmap: clarify virBitmapLastSetBit() behavior for empty bitmapsMarc Hartmayer2016-10-031-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | Before the variable 'bits' was initialized with 0 (commit 3470cd860d517760b13e26d97b6a842ff72687a1), the following bug was possible. A function call with an empty bitmap leads to undefined behavior. Because if 'bitmap->map_len == 0' 'unusedBits' will be <= 0 and 'sz == 1'. So the non global and non static variable 'bits' would have never been set. Consequently the check 'bits == 0' results in undefined behavior. This patch clarifies the current version of the function by handling the empty bitmap explicitly. Also, for an empty bitmap there is obviously no bit set so we can just return -1 (indicating no bit set) right away. The explicit check for 'bits == 0' after the loop is unnecessary because we only get to this point if no set bit was found. Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> (cherry picked from commit 7cd01a248b3995909adad29a6edbe76d3d16510f)
* Fix building with -OgMartin Kletzander2016-10-033-3/+3
| | | | | | | | | | | When building using -Og, gcc sees that some variables can be used uninitialized It can be debatable whether it is possible with our codeflow, but functions should be self-contained and initializations are always good. The return instead of goto is due to actualType being used in the cleanup. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> (cherry picked from commit 3470cd860d517760b13e26d97b6a842ff72687a1)
* qemu: Only use memory-backend-file with NUMA if neededMartin Kletzander2016-10-032-8/+9
| | | | | | | | | | | | | | | | | | | | | If this reminds you of a commit message from around a year ago, it's 41c2aa729f0af084ede95ee9a06219a2dd5fb5df and yes, we're dealing with "the same thing" again. Or f309db1f4d51009bad0d32e12efc75530b66836b and it's similar. There is a logic in place that if there is no real need for memory-backend-file, qemuBuildMemoryBackendStr() returns 0. However that wasn't the case with hugepage backing. The reason for that was that we abused the 'pagesize' variable for storing that information, but we should rather have a separate one that specifies whether we really need the new object for hugepage backing. And that variable should be set only if this particular NUMA cell needs special treatment WRT hugepages. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1372153 Signed-off-by: Martin Kletzander <mkletzan@redhat.com> (cherry picked from commit 4372a7845acbc6974f6027ef68e7dd3eeb47f425)
* qemu: Let empty default VNC password work as documentedJiri Denemark2016-06-301-7/+7
| | | | | | | | | | | | | | CVE-2016-5008 Setting an empty graphics password is documented as a way to disable VNC/SPICE access, but QEMU does not always behaves like that. VNC would happily accept the empty password. Let's enforce the behavior by setting password expiration to "now". https://bugzilla.redhat.com/show_bug.cgi?id=1180092 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> (cherry picked from commit bb848feec0f3f10e92dd8e5231ae7aa89b5598f3)
* qemu: Don't crash when create fails earlyMartin Kletzander2016-02-031-0/+6
| | | | | | | | | | | | | | | Since commit 714080791778e3dfbd484ccb3953bffd820b8ba9 we are generating socket path later than before -- when starting a domain. That makes one particular inconsistent state of a chardev, which was not possible before, currently valid. However, SELinux security driver forgot to guard the main restoring function by a check for NULL-paths. So make it no-op for NULL paths, as in the DAC driver. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1300532 Signed-off-by: Martin Kletzander <mkletzan@redhat.com> (cherry picked from commit 1794a0103ae4fa91d9c11617e7981471173e27ce) Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
* include: Handle case when builddir == srcdirMichal Privoznik2016-02-021-1/+2
| | | | | | | | | | In my previous commit a70f3b1c779120129 I've tried to fix case when building from VPATH and a file wasn't being installed. However, my fix broke non-VPATH build. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> (cherry picked from commit 0d0e41a71910e0415a924648f44a0b00389a576a) Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* includes: Install libvirt-common.hMichal Privoznik2016-02-011-0/+1
| | | | | | | | | | | | The libvirt-common.h is build time generated file from .in. Obviously, it's generated into builddir and not srcdir. Problem is, the list of header files to install, virinc_HEADERS contains only $(srcdir)/*.h and this misses libvirt-common.h. This problem is pretty obvious when doing a VPATH build. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> (cherry picked from commit a70f3b1c77912012905c6c5be3bf37b05592e80f) Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* virLogManagerDomainReadLogFile: Don't do dummy allocsMichal Privoznik2016-01-181-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Since we pass dummy variables @fdout and @fdoutlen into virNetClientProgramCall() we make it alloc @fdout array (even though it's an array of 0 elements since vitlogd can hardly pass us some FDs at this stage). Nevertheless, it's an allocation not followed by free(): ==29385== 0 bytes in 60 blocks are definitely lost in loss record 2 of 1,009 ==29385== at 0x4C2C070: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==29385== by 0x54B99EF: virAllocN (viralloc.c:191) ==29385== by 0x56821B1: virNetClientProgramCall (virnetclientprogram.c:359) ==29385== by 0x563B304: virLogManagerDomainReadLogFile (log_manager.c:272) ==29385== by 0x217CD613: qemuDomainLogContextRead (qemu_domain.c:2485) ==29385== by 0x217EDC76: qemuProcessReadLog (qemu_process.c:1660) ==29385== by 0x217EDE1D: qemuProcessReportLogError (qemu_process.c:1696) ==29385== by 0x217EE8C1: qemuProcessWaitForMonitor (qemu_process.c:1957) ==29385== by 0x217F6636: qemuProcessLaunch (qemu_process.c:4955) ==29385== by 0x217F71A4: qemuProcessStart (qemu_process.c:5152) ==29385== by 0x21846582: qemuDomainObjStart (qemu_driver.c:7396) ==29385== by 0x218467DE: qemuDomainCreateWithFlags (qemu_driver.c:7450) Signed-off-by: Michal Privoznik <mprivozn@redhat.com> (cherry picked from commit c03fbecc7cd463900d0291034e873f00062a75db) Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* qemuProcessReadLog: Fix memmove argumentsMichal Privoznik2016-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So I can observe this crasher that with freshly started daemon (and virtlogd enabled) I am trying to startup a domain that immediately dies (because it's said to use huge pages but I haven't allocated a single one in the pool). Hardly reproducible with -O0 or under valgrind. But I just got lucky: ==20469== Invalid write of size 8 ==20469== at 0x4C2E99B: memcpy@GLIBC_2.2.5 (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==20469== by 0x217EDD07: qemuProcessReadLog (qemu_process.c:1670) ==20469== by 0x217EDE1D: qemuProcessReportLogError (qemu_process.c:1696) ==20469== by 0x217EE8C1: qemuProcessWaitForMonitor (qemu_process.c:1957) ==20469== by 0x217F6636: qemuProcessLaunch (qemu_process.c:4955) ==20469== by 0x217F71A4: qemuProcessStart (qemu_process.c:5152) ==20469== by 0x21846582: qemuDomainObjStart (qemu_driver.c:7396) ==20469== by 0x218467DE: qemuDomainCreateWithFlags (qemu_driver.c:7450) ==20469== by 0x21846845: qemuDomainCreate (qemu_driver.c:7468) ==20469== by 0x5611CD0: virDomainCreate (libvirt-domain.c:6753) ==20469== by 0x125D9A: remoteDispatchDomainCreate (remote_dispatch.h:3613) ==20469== by 0x125CB7: remoteDispatchDomainCreateHelper (remote_dispatch.h:3589) ==20469== Address 0x27a52ad0 is 0 bytes after a block of size 5,584 alloc'd ==20469== at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==20469== by 0x9B8D1DB: xdr_string (in /lib64/libc-2.21.so) ==20469== by 0x563B39C: xdr_virLogManagerProtocolNonNullString (log_protocol.c:24) ==20469== by 0x563B6B7: xdr_virLogManagerProtocolDomainReadLogFileRet (log_protocol.c:123) ==20469== by 0x164B34: virNetMessageDecodePayload (virnetmessage.c:407) ==20469== by 0x5682360: virNetClientProgramCall (virnetclientprogram.c:379) ==20469== by 0x563B30E: virLogManagerDomainReadLogFile (log_manager.c:272) ==20469== by 0x217CD613: qemuDomainLogContextRead (qemu_domain.c:2485) ==20469== by 0x217EDC76: qemuProcessReadLog (qemu_process.c:1660) ==20469== by 0x217EDE1D: qemuProcessReportLogError (qemu_process.c:1696) ==20469== by 0x217EE8C1: qemuProcessWaitForMonitor (qemu_process.c:1957) ==20469== by 0x217F6636: qemuProcessLaunch (qemu_process.c:4955) This points to memmove() in qemuProcessReadLog(). Imagine we just read the following string from qemu: "abc\n2016-01-18T09:40:44.022744Z qemu-system-x86_64: Error\n" After the first pass of the while() loop in the qemuProcessReadLog() (in which we have taken the false branch in the if) @buf still points to the beginning of the string, @filter_next points to the beginning of the second line. So we start second iteration because there is yet another newline character at the end. In this iteration @eol points to it actually. Now, the control gets inside true branch of if(). Just to remind you: got = 58 filter_next = buf + 5, eol = buf + 58. Therefore skip = 54 which is correct. The message we want to skip is 54 bytes long. However: memmove(filter_next, eol + 1, (got - skip) +1); which is memmove(filter_next, eol + 1, 5) is obviously wrong as there is only one byte we can access, not 5! Signed-off-by: Michal Privoznik <mprivozn@redhat.com> (cherry picked from commit 105b51f42ecd26914186239f36e73ee1e5e990c1) Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* Release of libvirt-1.3.1v1.3.1Daniel Veillard2016-01-1766-375705/+376208
| | | | | * docs/news.html.in libvirt.spec.in: update for release * po/*.po*: regenerated
* security: Do not restore labels on device tree binaryJiri Denemark2016-01-152-8/+0
| | | | | | | | | A device tree binary file specified by /domain/os/dtb element is a read-only resource similar to kernel and initrd files. We shouldn't restore its label when destroying a domain to avoid breaking other domains configure with the same device tree. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* security: Do not restore kernel and initrd labelsJiri Denemark2016-01-152-16/+0
| | | | | | | | | | | | Kernel/initrd files are essentially read-only shareable images and thus should be handled in the same way. We already use the appropriate label for kernel/initrd files when starting a domain, but when a domain gets destroyed we would remove the labels which would make other running domains using the same files very unhappy. https://bugzilla.redhat.com/show_bug.cgi?id=921135 Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* qemu: Print better warning in qemuAgentNotifyEventYaniv Kaul2016-01-151-1/+2
| | | | | | | | | | | We have this function qemuAgentNotifyEvent() which is supposed to be called from thread pool responsible for processing qemu monitor events. The function then should wake up other thread that is waiting for a guest to shutdown or reboot. However, if we have received a different error a warning is printed out. This warning lacks info on which event is expected. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* cgroup: Fix possible bug as a result of code motion for vcpu cgroup setupv1.3.1-rc2John Ferlan2016-01-141-4/+1
| | | | | | | | | | Commit id '90b721e43' moved where the virCgroupAddTask was made until after the check for the vcpupin checks. However, in doing so it missed an option where if the cpumap didn't exist, then the code would continue back to the top of the current vcpu loop. The results was that the virCgroupAddTask wouldn't be called. Signed-off-by: John Ferlan <jferlan@redhat.com>
* Revert "lxc_cgroup: Add check for NULL cgroup before AddTask call"John Ferlan2016-01-141-1/+1
| | | | | | | This reverts commit ae09988eb787df63d3bb298f713a3bbd77275901. Since commit id '71ce4759' has been reverted, this one is no longer necessary.
* Revert "util: cgroups do not implicitly add task to new machine cgroup"John Ferlan2016-01-143-22/+22
| | | | | | | This reverts commit 71ce475967b3523882b0e1a0f649fdbea5abf9d5. Since commit id 'a41c00b47' has been reverted, this no longer is necessary
* Revert "qemu: do not put a task into machine cgroup"John Ferlan2016-01-142-10/+17
| | | | | | | | This reverts commit a41c00b472efaa192d2deae51ab732e65903238f. After much testing and upstream discussion this has been deemed to be the incorrect operation since it means we no longer have any guarantee about which resource controllers the QEMU processes in general are in.
* virt-aa-helper: don't deny writes to readonly mountsCédric Bosdonnat2016-01-141-1/+4
| | | | | | | | | | | There is no need to deny writes on a readonly mount: write still won't be accepted, even if the user remounts the folder as RW in the guest as qemu sets the 9p mount as ro. This deny rule was leading to problems for example with readonly /: The qemu process had to write to a bunch of files in / like logs, sockets, etc. This deny rule was also preventing auditing of these denials, making it harder to debug.
* conf: Initialize 'deflate' for balloon parse XMLJohn Ferlan2016-01-141-1/+1
| | | | | | Commit id '7bf3198df' neglected to initialize deflate leading to a possibility if model allocation/checks fail, then the VIR_FREE(deflate) would be erroneous. Noted by Jan Tomko.
* wireshark: Drop DESTDIR from install pathMichal Privoznik2016-01-141-1/+1
| | | | | | | | | In 50078cfbcbf3c8 I've tried to fix distcheck but accidentally broke rpm build. The problem is that rpm build not only sets DESTDIR but also passes plugindir path. This results in double DESTDIR being in the plugin path, Drop one. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* virsh: Update description of lxc-enter-namespaceGuido Günther2016-01-131-2/+2
| | | | Mention that we run a command in that namespace
* build: fix distdir with wireshark disabledCole Robinson2016-01-131-2/+2
| | | | | | | | Even though the Makefile has WITH_WIRESHARK guards, the _SOURCES variables are still processed when adding bits to the dist archive. plugin.c is a generated file that is only built when wireshark is enabled and it shouldn't be distributed, so use 'nodist'
* qemuProcessCleanupChardevDevice: Don't unlink NULL pathsMichal Privoznik2016-01-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | So, you try to start a domain, but before we even get to the part where chardev part of qemu command line is generated (and possibly missing path to unix sockets is made up) an error occurs which results in calling qemuProcessStop. This will then try to clean up the mess and possibly ends up calling unlink(NULL). ==8085== Thread 3: ==8085== Syscall param unlink(pathname) points to unaddressable byte(s) ==8085== at 0xA85EA57: unlink (in /lib64/libc-2.21.so) ==8085== by 0x213D3C24: qemuProcessCleanupChardevDevice (qemu_process.c:2866) ==8085== by 0x558D6B1: virDomainChrDefForeach (domain_conf.c:22924) ==8085== by 0x213DA9AE: qemuProcessStop (qemu_process.c:5326) ==8085== by 0x213DA2F2: qemuProcessStart (qemu_process.c:5190) ==8085== by 0x2142957F: qemuDomainObjStart (qemu_driver.c:7396) ==8085== by 0x214297DB: qemuDomainCreateWithFlags (qemu_driver.c:7450) ==8085== by 0x21429842: qemuDomainCreate (qemu_driver.c:7468) ==8085== by 0x5611B95: virDomainCreate (libvirt-domain.c:6753) ==8085== by 0x125D9A: remoteDispatchDomainCreate (remote_dispatch.h:3613) ==8085== by 0x125CB7: remoteDispatchDomainCreateHelper (remote_dispatch.h:3589) ==8085== by 0x568BF41: virNetServerProgramDispatchCall (virnetserverprogram.c:437) ==8085== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==8085== Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* xenconfig: check return value of regcompJim Fehlig2016-01-121-1/+11
| | | | | Commit ec63000a missed checking the return value of regcomp(), which coverity promptly identified.
* wireshark: Install into DESTDIRMichal Privoznik2016-01-122-4/+5
| | | | | | Like everything we install, it should be prefixed with DESTDIR. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* Xen: use correct domctl version in domaininfolist unionJim Fehlig2016-01-121-1/+1
| | | | | | | | | Commmit fd2e3c4c used the domctl version 8 structure for version 9 in the xen_getdomaininfolist union, resulting in insufficient buffer size (and subsequent memory corruption) for the GETDOMAININFOLIST ioctl. Signed-off-by: Jim Fehlig <jfehlig@suse.com>
* testutils: Fix coverity warning with REGENERATE_OUTPUTCole Robinson2016-01-121-3/+2
| | | | | - Don't double check for expectName - actual is always non-NULL by this point, so don't check it either
* build: Kill tools/wireshark MakefilesCole Robinson2016-01-125-79/+51
| | | | | Just handle it all in tools/Makefile.am. I verified the generated output looks similar to the pre patch output, but I didn't test it.
* Expand $(wildcard) correctlyMichal Privoznik2016-01-123-6/+6
| | | | | | | | | | So after da176bf6b756 and friend we have switched to $(wildcard some/path/*.xml) instead of enumerating the files explicitly. This is nice, however it makes distcheck build from VPATH fail. The reason is that it's is not obvious to what does the wildcard refer to: srcdir or builddir? Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
* qemu: add support of optional 'autodeflate' attributeDmitry Andreev2016-01-1210-0/+212
| | | | | | | | | | | | | | | Autodeflate can be enabled/disabled for memballon device of model 'virtio'. xml: <devices> <memballoon model='virtio' autodeflate='on'/> </devices> qemu: qemu -device virtio-balloon-pci,...,deflate-on-oom=on Autodeflate cannot be enabled/disabled for running domain.
* qemu: add capability check for memballoon 'deflate-on-oom' featureDmitry Andreev2016-01-1215-72/+896
| | | | | | Add appropriate capability check and new virQEMUCaps flag for the new virtio balloon feature. QEMU commit with the complete feature description: http://git.qemu.org/?p=qemu.git;a=commit;h=e3816255bf4b6377bb405331e2ee0dc14d841b80
* conf: introduce 'autodeflate' attribute for memballoon deviceDmitry Andreev2016-01-124-0/+39
| | | | | | | | | | Excessive memory balloon inflation can cause invocation of OOM-killer, when Linux is under severe memory pressure. QEMU memballoon device has a feature to release some memory at the last moment before some process will be get killed by OOM-killer. Introduce a new optional balloon device attribute 'autodeflate' to enable or disable this feature.
* rpc: socket: Don't repeatedly attempt to launch daemonCole Robinson2016-01-121-2/+7
| | | | | | | | | | On every socket connect(2) attempt we were re-launching session libvirtd, up to 100 times in 5 seconds. This understandably caused some weird load races and intermittent qemu:///session startup failures https://bugzilla.redhat.com/show_bug.cgi?id=1271183
* rpc: socket: Explicitly error if we exceed retry countCole Robinson2016-01-121-1/+2
| | | | | | | | | | | When we autolaunch libvirtd for session URIs, we spin in a retry loop waiting for the daemon to start and the connect(2) to succeed. However if we exceed the retry count, we don't explicitly raise an error, which can yield a slew of different error messages elsewhere in the code. Explicitly raise the last connect(2) failure if we run out of retries.
* rpc: socket: Minor cleanupsCole Robinson2016-01-121-4/+12
| | | | | | | - Add some debugging - Make the loop dependent only on retries - Make it explicit that connect(2) success exits the loop - Invert the error checking logic
* Add missing virxdrdefs.h include to log_protocolRoman Bogorodskiy2016-01-121-0/+1
| | | | | | | | Commit 2b6f6ad introduced the virxdrdefs.h header with common definitions to be included in the protocol files, but logging/log_protocol.x was missed, so add it there as well. Hopefully this fixes build on OS X.
* virsh: Fix alignment in VIRSH_COMMON_OPT_CONFIG definitionAndrea Bolognani2016-01-121-2/+2
|
* rpc: Don't rewrite msg->fds on every read dispatchBen Gray2016-01-121-25/+27
| | | | | | | | | | | | When we are receiving data in smaller chunks it might happen that virNetServerClientDispatchRead() will be called multiple times. And as that happens, if it is a message that also transfer headers, we decode the number of them every single time and, unfortunately, also allocate the memory for them. That causes a leak, in the best scenario. Best viewed with '-w'. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
* virsh: Create macro for common "interface" optionv1.3.1-rc1John Ferlan2016-01-111-25/+12
| | | | | | | | | Rather than continually cut-n-paste the strings into each command, create a common macro to be used generically. Note that not all '{.name = "interface",' entries are replaced, just those that have the common .help string of "interface name or MAC address". Signed-off-by: John Ferlan <jferlan@redhat.com>
* virsh: Create macro for common "network" optionJohn Ferlan2016-01-111-45/+16
| | | | | | | | | Rather than continually cut-n-paste the strings into each command, create a common macro to be used generically. Note that not all '{.name = "network",' entries are replaced, just those that have the common .help string of "network name or uuid". Signed-off-by: John Ferlan <jferlan@redhat.com>
* virsh: Create macros for common "vol" optionsJohn Ferlan2016-01-111-45/+16
| | | | | | | | | | | Rather than continually cut-n-paste the strings into each command, create common macros to be used generically. Replace the more commonly used "vol" option with a macro. This also adjusts 2 commands that didn't have the correct helpstr - 'vol-create-from' and 'vol-clone'. Both are described in the man page as taking vol, path, or key and the code uses the virshCommandOptVol instead of virshCommandOptVolBy. Signed-off-by: John Ferlan <jferlan@redhat.com>
* virsh: Create macro for common "file" optionJohn Ferlan2016-01-119-129/+39
| | | | | | | | | | Rather than continually cut-n-paste the strings into each command, create a common macro to be used generically. The macro will take a single argument _helpstr for the less common help string for each command option. Note that only file options using "OT_DATA" and "OFLAG_REQ" will be replace - others are left as is. Signed-off-by: John Ferlan <jferlan@redhat.com>
* virsh: Create macro for common "current" optionJohn Ferlan2016-01-115-141/+46
| | | | | | | | | | | Rather than continually cut-n-paste the strings into each command, create a common macro to be used generically. The macro will take a single argument _helpstr which for many options in virsh-domain.c is simply "affect current domain". So, create a second macro within that file in order to define the more common use as a revector to the common macro with the common _helpstr. Signed-off-by: John Ferlan <jferlan@redhat.com>
* virsh: Create macro for common "live" optionJohn Ferlan2016-01-115-128/+41
| | | | | | | | | | | Rather than continually cut-n-paste the strings into each command, create a common macro to be used generically. The macro will take a single argument _helpstr which for many options in virsh-domain.c is simply "affect running domain". So, create a second macro within that file in order to define the more common use as a revector to the common macro with the common _helpstr. Signed-off-by: John Ferlan <jferlan@redhat.com>