- 24 3月, 2017 6 次提交
-
-
由 Laine Stump 提交于
...and cleanup the callers to report it when it *is* an error. In many cases It's useful for virPCIGetNetName() to not log an error and simply return a NULL pointer when the given device isn't bound to a net driver (e.g. we're looking at a VF that is permanently bound to vfio-pci). The existing code would silently return an error in this case, which could eventually lead to the dreaded "An error occurred but the cause is unknown" log message. This patch changes virPCIGetNetName() to still return success if the device simply isn't bound to a net driver, and adjusts all the callers that require a non-null netname to check for that condition and log an error when it happens.
-
由 Laine Stump 提交于
Previously the MAC address text was required to be terminated with a NULL. After this, it can be terminated with a space or any control character.
-
由 Laine Stump 提交于
vf in virNetDevMacVLanDeleteWithVPortProfile() is initialized to -1 and never set. It's not set for a good reason - because it doesn't make sense during macvtap device setup to refer to a VF device as "PF:VF#". This patch replaces the two uses of "vf" with "-1", and removes the local variable, so that it's more clear we are always calling the utility functions with vf set to -1.
-
由 Laine Stump 提交于
This will make an upcoming functional change more straightforward.
-
由 Laine Stump 提交于
This function is only called in two places, and the ifindex, nltarget_kernel, and getPidFunc args are never used (and never will be). ifindex - we always know the name of the device, and never know the ifindex - if we really did need the ifindex we would have to get it from the name using virNetDevGetIndex(). In practice, we just send -1 to virNetDevSetVfConfig(), which doesn't bother to learn the real ifindex (you only need a name *or* an ifindex for the netlink command to succeed, not both). nltarget_kernel - messages to set the config of an SRIOV VF will always go to netlink in the kernel, not to another user process, so this arg is always true (there are other uses of netlink messages where the message might need to go to another user process, but never in the case of RTM_SETLINK for SRIOV). getPidFunc - this arg is only used if nltarget_kernel is false, and it never is. None of this has any functional effect, it just makes it easier to follow what's happening when virNetDevSetVfConfig() is called.
-
由 Laine Stump 提交于
virNetDevParseVfConfig() assumed that both the MAC address and VLAN tag pointers were valid, so even if you only wanted one or the other, you would need a variable to hold the returned value for both. This patch checks each for a NULL pointer before filling it in.
-
- 23 3月, 2017 19 次提交
-
-
由 Roman Bogorodskiy 提交于
Decorate unused arguments of the virNetDevGetMaster() stub with ATTRIBUTE_UNUSED to fix build on systems where this stub is used.
-
由 John Ferlan 提交于
Since the source code checks 'ifname' for NULL before using, the prototype doesn't need the NONNULL
-
由 John Ferlan 提交于
The source code will check for NULL arguments for 'macvtap_macaddr' and 'vmuuid', so no need for the NONNULL in the prototypes. Following the stack for both arguments to virNetDevVPortProfileOpSetLink also shows called functions would handle a NULL value. Additionally, modified the prototype to use the same 'macvtap_macaddr' name as the source code for consistency.
-
由 John Ferlan 提交于
Since the code checks and handles a NULL 'path', no need for the NONNULL
-
由 John Ferlan 提交于
Since the code checks and handles a NULL 'net_bandwidth' parameter, so no need for NONNNULL.
-
由 John Ferlan 提交于
The API checks each parameter for NULL anyway and would error, so need to add NONNULL on prototype.
-
由 John Ferlan 提交于
The code checks and handles a NULL 'migrate', so no need for NONNULL
-
由 John Ferlan 提交于
Since the function handles a NULL 'mgr' condition, no need for the NONNULL
-
由 John Ferlan 提交于
Since the code checks 'mgr == NULL' anyway, no need for the prototype to have the NONNULL arg check. Also add an error message to indicate what the failure is so that there isn't a failed for some reason error. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
The comparison code used STREQ_NULLABLE anyway for both 'drv_name' and 'dom_name', so no need. Add a NULLSTR on the 'dom_name' too. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
The comparison code used STREQ_NULLABLE anyway for both 'drv_name' and 'dom_name', so no need. Add a NULLSTR on the 'dom_name' too. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
The called function uses a STRNEQ_NULLABLE anyway for both 'drv_name' and 'dom_name', so no need. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
The code checks and handles a NULL 'str', so just remove the NONNULL. Update the error message to add the NULLSTR() around 'str' also. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rather than returning an int and a *bitmap pointer, just return and check a NULL bitmap pointer
-
由 John Ferlan 提交于
The 'ifindex' argument is not a pointer, so no need for NONNULL in prototype
-
由 Laine Stump 提交于
This patch splits out the part of virNetDevTapCreateInBridgePort() that would need to be re-done if an existing tap device had to be re-attached to a bridge, and puts it into a separate function. This can be used both when an existing domain interface config is updated to change its connection, and also to re-attach to the "same" bridge when a network has been stopped and restarted. So far it is used for nothing.
-
由 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 9 次提交
-
-
由 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>
-