- 23 3月, 2017 3 次提交
-
-
由 Laine Stump 提交于
This function provides the bridge/bond device that the given network device is attached to. The return value is 0 or -1, and the master device is a char** argument to the function - this is needed in order to allow for a "success" return from a device that has no master.
-
由 Laine Stump 提交于
The only reason that the ethtool features weren't being retrieved in an unprivileged libvirtd was because they required ioctl(), and the ioctl was using an AF_PACKET socket, which requires root. Now that we are using AF_UNIX for ioctl(), this restriction can be removed.
-
由 Laine Stump 提交于
The exact family of the socket created for the fd used by ioctl(7) doesn't matter, it just needs to be a socket and not a file. But for some reason when macvtap support was added, it used AF_PACKET/SOCK_DGRAM sockets for its ioctls; we later used the same AF_PACKET/SOCK_DGRAM socket for new ioctls we added, and eventually modified the other pre-existing ioctl sockets (for creating/deleting bridges) to also use AF_PACKET/SOCK_DGRAM (that code originally used AF_UNIX/SOCK_STREAM). The problem with using AF_PACKET (intended for sending/receiving "raw" packets, i.e. packets that can be some protocol other than TCP or UDP) is that it requires root privileges. This meant that none of the ioctls in virnetdev.c or virnetdevip.c would work when running libvirtd unprivileged. This packet solves that problem by changing the family to AF_UNIX when creating the socket used for any ioctl().
-
- 22 3月, 2017 4 次提交
-
-
由 Cédric Bosdonnat 提交于
When enabling IPv6 on all interfaces, we may get the host Router Advertisement routes discarded. To avoid this, the user needs to set accept_ra to 2 for the interfaces with such routes. See https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt on this topic. To avoid user mistakenly losing routes on their hosts, check accept_ra values before enabling IPv6 forwarding. If a RA route is detected, but neither the corresponding device nor global accept_ra is set to 2, the network will fail to start.
-
由 Cédric Bosdonnat 提交于
Add a function getting the name of a network interface out of its index.
-
由 Cédric Bosdonnat 提交于
virNetlinkCommand() processes only one response message, while some netlink commands, like route dumping, need to process several. Add virNetlinkDumpCommand() as a virNetlinkCommand() sister.
-
由 Cédric Bosdonnat 提交于
Allow to reuse as much as possible from virNetlinkCommand(). This comment prepares for the introduction of virNetlinkDumpCommand() only differing by how it handles the responses.
-
- 16 3月, 2017 2 次提交
-
-
由 Michal Privoznik 提交于
While connecting to qemu monitor, the first thing we do is wait for it to show up. However, we are doing it with some timeout to avoid indefinite waits (e.g. when qemu doesn't create the monitor socket at all). After beaa447a we are using exponential back off timeout meaning, after the first connection attempt we wait 1ms, then 2ms, then 4 and so on. This allows us to bring down wait time for small domains where qemu initializes quickly. However, on the other end of this scale are some domains with huge amounts of guest memory. Now imagine that we've gotten up to wait time of 15 seconds. The next one is going to be 30 seconds, and the one after that whole minute. Well, okay - with current code we are not going to wait longer than 30 seconds in total, but this is going to change in the next commit. The exponential back off is usable only for first few iterations. Then it needs to be caped (one second was chosen as the limit) and switch to constant wait time. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 John Ferlan 提交于
The function is actually in virutil.c, but prototyped in virfile.h. This patch fixes that by renaming the function to virWaitForDevices, adding the prototype in virutil.h and libvirt_private.syms, and then changing the callers to use the new name. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 08 3月, 2017 11 次提交
-
-
由 Nitesh Konkar 提交于
This patch adds support and documentation for the emulation_faults perf event. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 Nitesh Konkar 提交于
This patch adds support and documentation for the alignment_faults perf event. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 Nitesh Konkar 提交于
This patch adds support and documentation for the page_faults_maj perf event. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 Nitesh Konkar 提交于
This patch adds support and documentation for the page_faults_min perf event. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 Nitesh Konkar 提交于
This patch adds support and documentation for the cpu_migrations perf event. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 Nitesh Konkar 提交于
This patch adds support and documentation for the context_switches perf event. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 Nitesh Konkar 提交于
This patch adds support and documentation for the page_faults perf event. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 Nitesh Konkar 提交于
This patch adds support and documentation for the task_clock perf event. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 Nitesh Konkar 提交于
This patch adds support and documentation for the cpu_clock perf event. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 John Ferlan 提交于
Found by Coverity. Because there's an "if ((cur = strstr(base, "revision")) != NULL) {" followed by a "base = cur" coverity notes that 'base' could then be NULL causing the return to the top of the "while ((tmp_base = strstr(base, "processor")) != NULL) {" to have strstr deref a NULL 'base' pointer because the setting of base at the bottom of the loop is unconditional. Alter the code to set "base = cur" after processing each key. That will "ensure" that base doesn't get set to NULL if both "cpu" and "revision" do no follow a "processor". While a /proc/cpuinfo file that has a "processor" key but with neither a "cpu" nor a "revision" doesn't seem feasible, the code is written as if it could happen, so we have to account for it. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Calls to virFileReadAll after a VIR_ALLOC that return NULL all show a memory leak since 'ret' isn't virSysinfoDefFree'd and normal path "return ret" doesn't free outbuf. Reported by Coverity Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 07 3月, 2017 3 次提交
-
-
由 Peter Krempa 提交于
virSysinfoSetup should be used only in tests so it can be moved to the new header file rather than using an extern declaration.
-
由 Peter Krempa 提交于
Whole implementations along with helper totalling screens of code were conditionally compiled. That made the code totally unreadable and untestable. Rename functions to have the architecture in the name so that all can be compiled at the same time and introduce header to allow testing them all.
-
由 Laine Stump 提交于
Proposed formal coding conventions encourage defining typedefs for vir[Blah] and vir[Blah]Ptr separately from the associated struct named _vir[Blah]: typedef struct _virBlah virBlah; typedef virBlah *virBlahPtr; struct _virBlah { ... }; At some point in the past, I had submitted several patches using a more compact style that I prefer, and they were accepted: typedef struct _virBlah { ... } virBlah, *virBlahPtr; Since these are by far a minority among all struct definitions, this patch changes all those definitions to reflect the style prefered by the proposal so that there is 100% consistency.
-
- 06 3月, 2017 2 次提交
-
-
由 Ján Tomko 提交于
After the system has been booted, it should not change. Cache the return value of virSystemdHasMachined. Allow starting and terminating machines with just one DBus call, instead of three, reducing the chance of the call timing out. Also introduce a small function for resetting the cache to be used in tests.
-
由 Ján Tomko 提交于
Both virSystemdTerminateMachine and virSystemdCreateMachine propagate the error to tell between a non-systemd system and a hard error. In virSystemdGetMachineNameByPID both are treated the same, but an error is ignored by the callers. Split out the checks into a separate function.
-
- 24 2月, 2017 3 次提交
-
-
由 Erik Skultety 提交于
Arguably though, function returning only on success is a very interesting, although quite impractical concept. Also, the errno isn't and shouldn't be preserved in this case, since the errno can be directly fed to the virReportSystemError. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Pavel Hrdina 提交于
This will eventually replace virQEMUBuildBufferEscapeComma, however it's not possible right now. Some parts of the code that uses the old function needs to be refactored. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 23 2月, 2017 1 次提交
-
-
由 Daniel P. Berrange 提交于
GCC 7 gets upset by if (!tmp && (size * count)) warning util/viralloc.c: In function 'virReallocN': util/viralloc.c:246:23: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] if (!tmp && (size * count)) { ~~~~~~^~~~~~~~ Keep it happy by adding != 0 to the right hand expression so it realizes we really are wanting to treat the result of the arithmetic expression as a boolean Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 22 2月, 2017 2 次提交
-
-
由 Tomáš Golembiovský 提交于
The 'raw' block driver in Qemu is not directly interesting from libvirt's perspective, but it can be layered above some other block drivers and this may be interesting for the user. The patch adds support for the 'raw' block driver. The driver is treated simply as a pass-through and child driver in JSON is queried to get the necessary information. Signed-off-by: NTomáš Golembiovský <tgolembi@redhat.com>
-
由 Tomáš Golembiovský 提交于
Split virStorageSourceParseBackingJSON into two functions so that the core can be reused by other functions. The new function called virStorageSourceParseBackingJSONInternal accepts virJSONValuePtr. Signed-off-by: NTomáš Golembiovský <tgolembi@redhat.com>
-
- 20 2月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
The utils code should stay separated from other code (except for very well justified cases). Unfortunately commit 272769be made it trivial to break the separation (and not get slapped by the syntax-check rule) by adding -I src/conf to the CFLAGS for utils. Remove this shortcut and except the two offenders from the syntax check so that the codebase can be kept separated.
-
- 19 2月, 2017 3 次提交
-
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 John Ferlan 提交于
Create a virscsihost.c and place the functions there. That removes the last #ifdef __linux__ from virutil.c. Take the opporunity to also change the function names and in one case the parameters slightly
-
由 John Ferlan 提交于
Rather than have them mixed in with the virutil apis, create a separate virvhba.c module and move the vHBA related calls into there. Soon there will be more added. Also modify the names of the functions and some arguments to be more indicative of what is really happening. Adjust the callers respectively. While I was changing fchosttest, rather than the non-descriptive names test1...test6, rename them to match what the test is doing.
-
- 17 2月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
Before 9c17d665 (v1.3.2 - I know, right?) it was possible to have the following interface configuration: <interface type='ethernet'/> <script path=''/> </interface> This resulted in -netdev tap,script=,.. Fortunately, qemu helped us to get away with this as it just ignored the empty script path. However, after the commit mentioned above it's libvirtd who is executing the script. Unfortunately without special case-ing empty script path. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 16 2月, 2017 1 次提交
-
-
由 Nitesh Konkar 提交于
Currently disk names do not follow the (regex) /^[fhv]d[a-z]+[0-9]*$/ completely and hence one can assign disk names like vd2 etc. This patch ensures that the disk names follow the regex mentioned. This patch also adds a testcase. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
- 14 2月, 2017 1 次提交
-
-
由 Ján Tomko 提交于
To make sure bit 'b' fits into the bitmap, we need to allocate b+1 bits, since we number from 0. Adjust the bitmap test to set a bit at a multiple of 16. That way the test fails without this fix, because the VIR_REALLOC call clears the newly added memory even if the original pointer has not changed.
-
- 11 2月, 2017 2 次提交
-
-
由 Nitesh Konkar 提交于
Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 Erik Skultety 提交于
So rather than comparing 2 paths (strings) as they are, which can very easily lead to unnecessary errors (e.g. in storage driver) that the paths are not the same when in fact they'd be e.g. just symlinks to the same location, we should put our best effort into resolving any symlinks and canonicalizing the path and only then compare the 2 paths for equality. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-