- 26 6月, 2013 1 次提交
-
-
由 Laine Stump 提交于
Although SRIOV network cards support setting a vlan tag on their virtual functions, and although setting this vlan tag via a <vlan> element in a domain's <interface> works, setting a vlan tag for these devices in a <network> definition, or in a network <portgroup> definition is also supposed to work (and the comment that validates <vlan> usage even says that!). However, the check to allow it only checked for an openvswitch network, so attempts to add <vlan> to a network of type='hostdev' would fail.
-
- 24 6月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Insert calls to the ACL checking APIs in all network driver entrypoints. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 21 6月, 2013 1 次提交
-
-
由 Laine Stump 提交于
This fixes the problem reported in: https://bugzilla.redhat.com/show_bug.cgi?id=972690 When checking for a collision of a new libvirt network's subnet with any existing routes, we read all of /proc/net/route into memory, then parse all the entries. The function that we use to read this file requires a "maximum length" parameter, which had previously been set to 64*1024. As each line in /proc/net/route is 128 bytes, this would allow for a maximum of 512 entries in the routing table. This patch increases that number to 128 * 100000, which allows for 100,000 routing table entries. This means that it's possible that 12MB would be allocated, but that would only happen if there really were 100,000 route table entries on the system, it's only held for a very short time. Since there is no method of specifying and unlimited max (and that would create a potential denial of service anyway) hopefully this limit is large enough to accomodate everyone.
-
- 05 6月, 2013 1 次提交
-
-
由 Eric Blake 提交于
Enforce the rule that .h files don't need to (redundantly) include <config.h>. * cfg.mk (sc_prohibit_config_h_in_headers): New rule. (_virsh_includes): Delete; instead, inline a smaller number of exclusions... (exclude_file_name_regexp--sc_require_config_h) (exclude_file_name_regexp--sc_require_config_h_first): ...here. * daemon/libvirtd.h (includes): Fix offenders. * src/driver.h (includes): Likewise. * src/gnutls_1_0_compat.h (includes): Likewise. * src/libxl/libxl_conf.h (includes): Likewise. * src/libxl/libxl_driver.h (includes): Likewise. * src/lxc/lxc_conf.h (includes): Likewise. * src/lxc/lxc_driver.h (includes): Likewise. * src/lxc/lxc_fuse.h (includes): Likewise. * src/network/bridge_driver.h (includes): Likewise. * src/phyp/phyp_driver.h (includes): Likewise. * src/qemu/qemu_conf.h (includes): Likewise. * src/util/virnetlink.h (includes): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 22 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
In order to learn libvirt multiqueue several things must be done: 1) The '/dev/net/tun' device needs to be opened multiple times with IFF_MULTI_QUEUE flag passed to ioctl(fd, TUNSETIFF, &ifr); 2) Similarly, '/dev/vhost-net' must be opened as many times as in 1) in order to keep 1:1 ratio recommended by qemu and kernel folks. 3) The command line construction code needs to switch from 'fd=X' to 'fds=X:Y:...:Z' and from 'vhostfd=X' to 'vhostfds=X:Y:...:Z'. 4) The monitor handling code needs to learn to pass multiple FDs.
-
- 21 5月, 2013 1 次提交
-
-
由 Osier Yang 提交于
-
- 14 5月, 2013 1 次提交
-
-
由 Gene Czarcinski 提交于
network: static route support for <network> This patch adds the <route> subelement of <network> to define a static route. the address and prefix (or netmask) attribute identify the destination network, and the gateway attribute specifies the next hop address (which must be directly reachable from the containing <network>) which is to receive the packets destined for "address/(prefix|netmask)". These attributes are translated into an "ip route add" command that is executed when the network is started. The command used is of the following form: ip route add <address>/<prefix> via <gateway> \ dev <virbr-bridge> proto static metric <metric> Tests are done to validate that the input data are correct. For example, for a static route ip definition, the address must be a network address and not a host address. Additional checks are added to ensure that the specified gateway is directly reachable via this network (i.e. that the gateway IP address is in the same subnet as one of the IP's defined for the network). prefix='0' is supported for both family='ipv4' address='0.0.0.0' netmask='0.0.0.0' or prefix='0', and for family='ipv6' address='::', prefix=0', although care should be taken to not override a desired system default route. Anytime an attempt is made to define a static route which *exactly* duplicates an existing static route (for example, address=::, prefix=0, metric=1), the following error message will be sent to syslog: RTNETLINK answers: File exists This can be overridden by decreasing the metric value for the route that should be preferred, or increasing the metric for the route that shouldn't be preferred (and is thus in place only in anticipation that the preferred route may be removed in the future). Caution should be used when manipulating route metrics, especially for a default route. Note: The use of the command-line interface should be replaced by direct use of libnl so that error conditions can be handled better. But, that is being left as an exercise for another day. Signed-off-by: NGene Czarcinski <gene@czarc.net> Signed-off-by: NLaine Stump <laine@laine.org>
-
- 09 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 03 5月, 2013 3 次提交
-
-
qemu:///session由 Laine Stump 提交于
This should resolve https://bugzilla.redhat.com/show_bug.cgi?id=958907 Recent new addition of code to read/write active network state to the NETWORK_STATE_DIR in the network driver broke startup for qemu:///session. The network driver had several state file paths hardcoded to /var, which could never possibly work in session mode. This patch modifies *all* state files to use a variable string that is set differently according to whether or not we're running privileged. (It turns out that logDir was never used, so it's been completely eliminated.) There are very definitely other problems preventing dnsmasq and radvd from running in non-privileged mode, but it's more consistent to have the directories used by them be determined in the same fashion. NB: I've noted before that the network driver is storing its state (including dnsmasq and radvd state) in /var/lib, while qemu stores its state in /var/run. It would probably have been better if the two matched, but it's been this way for a long time, and changing it would break running installations during an upgrade, so it's best to just leave it as it is.
-
由 Daniel P. Berrange 提交于
The call to virReportError conditionally switched between two format strings, with different numbers of placeholders. This meant the format string with no placeholders was not protected by a "%s". Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Eric Blake 提交于
virAsprintf(&foo, "%s", bar) is wasteful compared to foo = strdup(bar) (or eventually, VIR_STRDUP(foo, bar), but one thing at a time...). Noticed while reviewing Laine's attempt to clean up broken qemu:///session. * cfg.mk (sc_prohibit_asprintf): Enhance rule. * src/esx/esx_storage_backend_vmfs.c (esxStorageBackendVMFSVolumeLookupByKey): Fix offender. * src/network/bridge_driver.c (networkStateInitialize): Likewise. * src/nwfilter/nwfilter_dhcpsnoop.c (virNWFilterSnoopDHCPOpen): Likewise. * src/storage/storage_backend_sheepdog.c (virStorageBackendSheepdogRefreshVol): Likewise. * src/util/vircgroup.c (virCgroupAddTaskStrController): Likewise. * src/util/virdnsmasq.c (addnhostsAdd): Likewise. * src/xen/block_stats.c (xenLinuxDomainDeviceID): Likewise. * src/xen/xen_driver.c (xenUnifiedConnectOpen): Likewise. * tools/virsh.c (vshGetTypedParamValue): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 02 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
The source code base needs to be adapted as well. Some files include virutil.h just for the string related functions (here, the include is substituted to match the new file), some include virutil.h without any need (here, the include is removed), and some require both.
-
- 01 5月, 2013 1 次提交
-
-
由 John Ferlan 提交于
-
- 30 4月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
On the off-chance that creation of persistent configuration file would fail when defining a network that is already started as transient, the code would remove the transient data structure and thus the network. This patch changes the code so that in such case, the network is again marked as transient and left behind.
-
- 27 4月, 2013 2 次提交
-
-
由 Laine Stump 提交于
This isn't strictly speaking a bugfix, but I realized I'd gotten a bit too verbose when I chose the names for VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_*. This shortens them all a bit.
-
由 Laine Stump 提交于
I remembered to document this bit, but somehow forgot to implement it. This adds <driver name='kvm|vfio'/> as a subelement to the <forward> element of a network (this puts it parallel to the match between mode='hostdev' attribute in a network and type='hostdev' in an <interface>). Since it's already documented, only the parser, formatter, backend driver recognition (it just translates/moves the flag into the <interface> at the appropriate time), and a test case were needed. (I used a separate enum for the values both because the original is defined in domain_conf.h, which is unavailable from network_conf.h, and because in the future it's possible that we may want to support other non-hostdev oriented driver names in the network parser; this makes sure that one can be expanded without the other).
-
- 26 4月, 2013 1 次提交
-
-
由 Laine Stump 提交于
There will soon be other items related to pci hostdevs that need to be in the same part of the hostdevsubsys union as the pci address (which is currently a single member called "pci". This patch replaces the single member named pci with a struct named pci that contains a single member named "addr".
-
- 24 4月, 2013 3 次提交
-
-
由 Daniel P. Berrange 提交于
Ensure that all drivers implementing public APIs use a naming convention for their implementation that matches the public API name. eg for the public API virDomainCreate make sure QEMU uses qemuDomainCreate and not qemuDomainStart Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
It will simplify later work if the sub-drivers have dedicated APIs / field names. ie virNetworkDriver should have virDrvNetworkOpen and virDrvNetworkClose methods Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Ensure that the driver struct field names match the public API names. For an API virXXXX we must have a driver struct field xXXXX. ie strip the leading 'vir' and lowercase any leading uppercase letters. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 19 4月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Until now tranisent networks weren't really useful as libvirtd wasn't able to remember them across restarts. This patch adds support for loading status files of transient networks (that already were generated) so that the status isn't lost. This patch chops up virNetworkObjUpdateParseFile and turns it into virNetworkLoadState and a few friends that will help us to load status XMLs and refactors the functions that are loading the configs to use them.
-
- 18 4月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
When turning a started persistent network into a transient one we forgot to remove the autostart flag that is no longer valid at that point.
-
- 17 4月, 2013 1 次提交
-
-
由 Osier Yang 提交于
Detected by a simple Shell script: for i in $(git ls-files -- '*.[ch]'); do awk 'BEGIN { fail=0 } /# *include.*\.h/{ match($0, /["<][^">]*[">]/) arr[substr($0, RSTART+1, RLENGTH-2)]++ } END { for (key in arr) { if (arr[key] > 1) { fail=1 printf("%d %s\n", arr[key], key) } } if (fail == 1) exit 1 }' $i if test $? != 0; then echo "Duplicate header(s) in $i" fi done; A later patch will add the syntax-check to avoid duplicate headers.
-
- 11 3月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
By current implementation, network inbound is required in order to use 'floor' for guaranteeing minimal throughput. This is so, because we want user to tell us the maximal throughput of the network instead of finding out ourselves (and detect bogus values in case of virtual interfaces). However, we are nowadays requiring this only on documentation level. So if user starts a domain with 'floor' set on one its interfaces, we silently ignore the setting. We should error out instead.
-
- 27 2月, 2013 1 次提交
-
-
由 Laine Stump 提交于
This reverts commit 383ebc46. We decided the xml for this feature needed more thought to make sure we are doing it the best way, in particular wrt option values that have multiple items.
-
- 25 2月, 2013 1 次提交
-
-
由 Gene Czarcinski 提交于
Originally, only a host name was used to associate a DHCPv6 request with a specific IPv6 address. Further testing demonstrates that this is an unreliable method and, instead, a client-id or DUID needs to be used. According to DHCPv6 standards, this id can be a duid-LLT, duid-LL, or duid-UUID even though dnsmasq will accept almost any text string. Although validity checking of a specified string makes sure it is hexadecimal notation with bytes separated by colons, there is no rigorous check to make sure it meets the standard. Documentation and schemas have been updated. Signed-off-by: NGene Czarcinski <gene@czarc.net> Signed-off-by: NLaine Stump <laine@laine.org>
-
- 23 2月, 2013 1 次提交
-
-
由 Pieter Hollants 提交于
This patch adds support for a new <option>-Tag in the <dhcp> block of network configs, based on a subset of the fifth proposal by Laine Stump in the mailing list discussion at https://www.redhat.com/archives/libvir-list/2012-November/msg01054.html. Any such defined option will result in a dhcp-option=<number>,"<value>" statement in the generated dnsmasq configuration file. Currently, DHCP options can be specified by number only and there is no whitelisting or blacklisting of option numbers, which should probably be added. Signed-off-by: NPieter Hollants <pieter@hollants.com> Signed-off-by: NLaine Stump <laine@laine.org>
-
- 20 2月, 2013 3 次提交
-
-
由 Natanael Copa 提交于
We pass over the address/port start/end values many times so we put them in structs. Signed-off-by: NNatanael Copa <ncopa@alpinelinux.org> Signed-off-by: NLaine Stump <laine@laine.org>
-
由 Natanael Copa 提交于
Let users set the port range to be used for forward mode NAT: ... <forward mode='nat'> <nat> <port start='1024' end='65535'/> </nat> </forward> ... Signed-off-by: NNatanael Copa <ncopa@alpinelinux.org> Signed-off-by: NLaine Stump <laine@laine.org>
-
由 Natanael Copa 提交于
Support setting which public ip to use for NAT via attribute address in subelement <nat> in <forward>: ... <forward mode='nat'> <address start='1.2.3.4' end='1.2.3.10'/> </forward> ... This will construct an iptables line using: '-j SNAT --to-source <start>-<end>' instead of: '-j MASQUERADE' Signed-off-by: NNatanael Copa <ncopa@alpinelinux.org> Signed-off-by: NLaine Stump <laine@laine.org>
-
- 06 2月, 2013 2 次提交
-
-
由 John Ferlan 提交于
The conditional setting of cmdout in networkBuildDhcpDaemonCommandLine() caused Coverity to complain that 'cmd' could be leaked if !cmdout. Since the function is local and only called with cmdout being passed those checks have been removed.
-
由 Daniel P. Berrange 提交于
Rename all the pciDeviceXXX and pciXXXDevice APIs to have a fixed virPCIDevice name prefix
-
- 22 1月, 2013 1 次提交
-
-
由 John Ferlan 提交于
On error, the 'tapfd' in networkStartNetworkVirtual() is synonymous with 'macTapIfName' and will be closed in the appropriate error path.
-
- 18 1月, 2013 3 次提交
-
-
由 John Ferlan 提交于
The fetch of 'ipdef' in networkRefreshDhcpDaemon() when the loop to fill in ipv4def fails to find an ipv4 address with dhcp defined. The filled in ipdef value was not used. Code was made unnecessary with commit it 2d5cd1.
-
由 Laine Stump 提交于
The bandwidth plug and unplug functions were assuming that an interface's bandwidth setting was always specified directly in the domain's <interface> definition, but that's not necessarily true - it could have been obtained from a <portgroup> definition in the network definition. This patch fixes those functions to use virDomainNetGetActualBandwidth(), which gets the bandwidth pointer from iface->data.network.actual if it exists, otherwise returns iface->bandwidth.
-
由 John Ferlan 提交于
Remove extraneous check for 'netdef' when dereferencing for vlan.nTags. Prior code would already check if netdef was NULL. Coverity complained about a path where the 'vlan' was potentially valid, but a prior checks may not have allocated 'iface->data.network.actual', so like other paths it needs to be allocated on the fly. Move the copying of vlan up earlier in networkAllocateActualDevice, so that actual.type gets properly set. Since the first assignment to vlan is redundant except in the case of jumping immediately to validate from the start of the function, eliminate its initial setting at the top of the function in favor of calling the helper function virDomainNetGetActualVlan() (which doesn't depend on the local vlan pointer being initialized) down at validate: Signed-off-by: NLaine Stump <laine@redhat.com>
-
- 11 1月, 2013 2 次提交
-
-
由 Peter Krempa 提交于
If addition of rules in networkAddIptablesRules() failed the real error was masked by error reported when trying to clean up the remaining rules. With this patch the original error message is saved and set back after the removal is complete.
-
由 Peter Krempa 提交于
Commit 0211fd6e introduced regression where newly defined networks were not made persistent. This patch makes the network persistent on each successful definition.
-
- 21 12月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-