- 15 11月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
Rename the virVirtualPortProfileParams struct to be virNetDevVPortProfile, and rename the APIs to match this prefix. * src/util/network.c, src/util/network.h: Rename port profile APIs * src/conf/domain_conf.c, src/conf/domain_conf.h, src/conf/network_conf.c, src/conf/network_conf.h, src/network/bridge_driver.c, src/qemu/qemu_hotplug.c, src/util/macvtap.c, src/util/macvtap.h: Update for renamed APIs/structs
-
- 10 11月, 2011 2 次提交
-
-
由 Daniel P. Berrange 提交于
Rename virBandwidth to virNetDevBandwidth, and virRate to virNetDevBandwidthRate. * src/util/network.c, src/util/network.h: Rename bandwidth structs and APIs * src/conf/domain_conf.c, src/conf/domain_conf.h, src/conf/network_conf.c, src/conf/network_conf.h, src/lxc/lxc_driver.c, src/network/bridge_driver.c, src/qemu/qemu_command.c, src/util/macvtap.c, src/util/macvtap.h, tools/virsh.c: Update for API changes.
-
由 Daniel P. Berrange 提交于
The socket address APIs in src/util/network.h either take the form virSocketAddrXXX, virSocketXXX or virSocketXXXAddr. Sanitize this so everything is virSocketAddrXXXX, and ensure that the virSocketAddr parameter is always the first one. * src/util/network.c, src/util/network.h: Santize socket address API naming * src/conf/domain_conf.c, src/conf/network_conf.c, src/conf/nwfilter_conf.c, src/network/bridge_driver.c, src/nwfilter/nwfilter_ebiptables_driver.c, src/nwfilter/nwfilter_learnipaddr.c, src/qemu/qemu_command.c, src/rpc/virnetsocket.c, src/util/dnsmasq.c, src/util/iptables.c, src/util/virnetdev.c, src/vbox/vbox_tmpl.c: Update for API renaming
-
- 28 10月, 2011 1 次提交
-
-
由 Jiri Denemark 提交于
-
- 21 10月, 2011 1 次提交
-
-
由 Eric Blake 提交于
More simplifications possible due to auto-indent. Also, <bandwidth> within <actual> was only using 6 instead of 8 spaces. * src/util/network.h (virVirtualPortProfileFormat) (virBandwidthDefFormat): Alter signature. * src/util/network.c (virVirtualPortProfileFormat) (virBandwidthDefFormat): Alter indentation. (virBandwidthChildDefFormat): Tweak to make use easier. * src/conf/network_conf.c (virPortGroupDefFormat) (virNetworkDefFormat): Adjust callers. * src/conf/domain_conf.c (virDomainNetDefFormat): Likewise. (virDomainActualNetDefFormat): Likewise, and fix bandwidth indentation.
-
- 14 9月, 2011 1 次提交
-
-
由 Peter Krempa 提交于
Commit 498d7833 cleans up some of virtual file names for parsing strings in memory. This patch cleans up (hopefuly) the rest forgotten by the first patch. This patch also changes all of the previously modified "filenames" to valid URI's replacing spaces for underscores. Changes to v1: - Replace all spaces for underscores, so that the strings form valid URI's - Replace spaces in places changed by commit 498d7833
-
- 12 8月, 2011 1 次提交
-
-
由 Laine Stump 提交于
While the first encountered dns host record is being parsed, it's possible for virNetworkDef::hosts to point to memory that has been allocated, but virNetworkDef::nhosts to still be 0. If there is a failure during that time, virNetworkDef::hosts will be leaked. Although this isn't currently the case for virNetworkDef::txtrecords, it could become that way through future re-factoring, and it hurts nothing to restructure the freeing of txtrecord data to match that of hosts data.
-
- 01 8月, 2011 1 次提交
-
-
由 Matthias Bolte 提交于
Reported by Alex Jia.
-
- 27 7月, 2011 1 次提交
-
-
由 Michal Privoznik 提交于
Every DomainNetDef has a bandwidth, as does every portgroup. Whenever a DomainNetDef of type NETWORK is about to be used, a call is made to networkAllocateActualDevice(). This function chooses the "best" bandwidth object and places it in the DomainActualNetDef. From that point on, whenever some code needs to use the bandwidth data for the interface, it's retrieved with virDomainNetGetActualBandwidth(), which will always return the "best" info as determined in the previous step.
-
- 25 7月, 2011 2 次提交
-
-
由 Michal Privoznik 提交于
-
由 Michal Privoznik 提交于
These functions parse given XML node and return pointer to the output. Unknown elements are silently ignored. Attributes must be integer and must fit in unsigned long long. Free function frees elements of virBandwidth structure.
-
- 22 7月, 2011 2 次提交
-
-
由 Laine Stump 提交于
The network XML is updated in the following ways: 1) The <forward> element can now contain a list of forward interfaces: <forward .... > <interface dev='eth10'/> <interface dev='eth11'/> <interface dev='eth12'/> <interface dev='eth13'/> </forward> The first of these takes the place of the dev attribute that is normally in <forward> - when defining a network you can specify either one, and on output both will be present. If you specify both on input, they must match. 2) In addition to forward modes of 'nat' and 'route', these new modes are supported: private, passthrough, vepa - when this network is referenced by a domain's interface, it will have the same effect as if the interface had been defined as type='direct', e.g.: <interface type='direct'> <source mode='${mode}' dev='${dev}> ... </interface> where ${mode} is one of the three new modes, and ${dev} is an interface selected from the list given in <forward>. bridge - if a <forward> dev (or multiple devs) is defined, and forward mode is 'bridge' this is just like the modes 'private', 'passthrough', and 'vepa' above. If there is no forward dev specified but a bridge name is given (e.g. "<bridge name='br0'/>"), then guest interfaces using this network will use libvirt's "host bridge" mode, equivalent to this: <interface type='bridge'> <source bridge='${bridge-name}'/> ... </interface> 3) A network can have multiple <portgroup> elements, which may be selected by the guest interface definition (by adding "portgroup='${name}'" in the <source> element along with the network name). Currently a portgroup can only contain a virtportprofile, but the intent is that other configuration items may be put there int the future (e.g. bandwidth config). When building a guest's interface, if the <interface> XML itself has no virtportprofile, and if the requested network has a portgroup with a name matching the name given in the <interface> (or if one of the network's portgroups is marked with the "default='yes'" attribute), the virtportprofile from that portgroup will be used by the interface. 4) A network can have a virtportprofile defined at the top level, which will be used by a guest interface when connecting in one of the 'direct' modes if the guest interface XML itself hasn't specified any virtportprofile, and if there are also no matching portgroups on the network.
-
由 Eric Blake 提交于
In preparation for a future patch adding new virFile APIs. * src/util/files.h, src/util/files.c: Move... * src/util/virfile.h, src/util/virfile.c: ...here, and rename functions to virFile prefix. Macro names are intentionally left alone. * *.c: All '#include "files.h"' uses changed. * src/Makefile.am (UTIL_SOURCES): Reflect rename. * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise. * src/libvirt_private.syms: Likewise. * docs/hacking.html.in: Likewise. * HACKING: Regenerate.
-
- 06 7月, 2011 1 次提交
-
-
由 Matthias Bolte 提交于
Some callers expected virFileMakePath to set errno, some expected it to return an errno value. Unify this to return 0 on success and -1 on error. Set errno to report detailed error information. Also optimize virFileMakePath if stat fails with an errno different from ENOENT.
-
- 29 6月, 2011 1 次提交
-
-
由 Osier Yang 提交于
-
- 25 6月, 2011 2 次提交
-
-
由 Michal Novotny 提交于
This commit introduces names definition for the DNS hosts file using the following syntax: <dns> <host ip="192.168.1.1"> <name>alias1</name> <name>alias2</name> </host> </dns> Some of the improvements and fixes were done by Laine Stump so I'm putting him into the SOB clause again ;-) Signed-off-by: NMichal Novotny <minovotn@redhat.com> Signed-off-by: NLaine Stump <laine@laine.org>
-
由 Michal Novotny 提交于
This commit introduces the <dns> element and <txt> record for the virtual DNS network. The DNS TXT record can be defined using following syntax in the network XML file: <dns> <txt name="example" value="example value" /> </dns> Also, the Relax-NG scheme has been altered to allow the texts without spaces only for the name element and some nitpicks about memory free'ing have been fixed by Laine so therefore I'm adding Laine to the SOB clause ;-) Signed-off-by: NMichal Novotny <minovotn@redhat.com> Signed-off-by: NLaine Stump <laine@laine.org>
-
- 13 5月, 2011 1 次提交
-
-
由 Cole Robinson 提交于
And update callers to actually respect the error
-
- 06 5月, 2011 2 次提交
-
-
由 Michal Privoznik 提交于
Users often edit XML file stored in configuration directory thinking of modifying a domain/network/pool/etc. Thus it is wise to let them know they are using the wrong way and give them hint.
-
由 Eric Blake 提交于
We already have virAsprintf, so picking a similar name helps for seeing a similar purpose. Furthermore, the prefix V before printf generally implies 'va_list', even though this variant was '...', and the old name got in the way of adding a new va_list version. global rename performed with: $ git grep -l virBufferVSprintf \ | xargs -L1 sed -i 's/virBufferVSprintf/virBufferAsprintf/g' then revert the changes in ChangeLog-old.
-
- 17 4月, 2011 1 次提交
-
-
由 Matthias Bolte 提交于
And from all related macros and functions.
-
- 18 2月, 2011 1 次提交
-
-
由 Laine Stump 提交于
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=609463 The problem was that, since a bridge always acquires the MAC address of the connected interface with the numerically lowest MAC, as guests are started and stopped, it was possible for the MAC address to change over time, and this change in the network was being detected by Windows 7 (it sees the MAC of the default route change), so on each reboot it would bring up a dialog box asking about this "new network". The solution is to create a dummy tap interface with a MAC guaranteed to be lower than any guest interface's MAC, and attach that tap to the bridge as soon as it's created. Since all guest MAC addresses start with 0xFE, we can just generate a MAC with the standard "0x52, 0x54, 0" prefix, and it's guaranteed to always win (physical interfaces are never connected to these bridges, so we don't need to worry about competing numerically with them). Note that the dummy tap is never set to IFF_UP state - that's not necessary in order for the bridge to take its MAC, and not setting it to UP eliminates the clutter of having an (eg) "virbr0-nic" displayed in the output of the ifconfig command. I chose to not auto-generate the MAC address in the network XML parser, as there are likely to be consumers of that API that don't need or want to have a MAC address associated with the bridge. Instead, in bridge_driver.c when the network is being defined, if there is no MAC, one is generated. To account for virtual network configs that already exist when upgrading from an older version of libvirt, I've added a %post script to the specfile that searches for all network definitions in both the config directory (/etc/libvirt/qemu/networks) and the state directory (/var/lib/libvirt/network) that are missing a mac address, generates a random address, and adds it to the config (and a matching address to the state file, if there is one). docs/formatnetwork.html.in: document <mac address.../> docs/schemas/network.rng: add nac address to schema libvirt.spec.in: %post script to update existing networks src/conf/network_conf.[ch]: parse and format <mac address.../> src/libvirt_private.syms: export a couple private symbols we need src/network/bridge_driver.c: auto-generate mac address when needed, create dummy interface if mac address is present. tests/networkxml2xmlin/isolated-network.xml tests/networkxml2xmlin/routed-network.xml tests/networkxml2xmlout/isolated-network.xml tests/networkxml2xmlout/routed-network.xml: add mac address to some tests
-
- 11 1月, 2011 1 次提交
-
-
由 Eric Blake 提交于
* src/conf/network_conf.c (virNetworkDefParseXML): Release ipNodes.
-
- 06 1月, 2011 1 次提交
-
-
由 Laine Stump 提交于
This is partially in response to https://bugzilla.redhat.com/show_bug.cgi?id=653300 The crash in that report was coincidentally fixed when we switched from using inet_pton() to using virSocketParseAddr(), but the absence of an ip address in a dhcp static host definition was still silently ignored (and that entry discarded from the saved XML). This patch turns that into a logged failure; likewise if the entry has neither a mac address nor a name attribute (the entry is useless without at least one of those, plus an ip address). Since the network name is now pulled into this function in order for those error logs to be more informative, the other error messages in the function have also been changed to take advantage.
-
- 24 12月, 2010 3 次提交
-
-
由 Laine Stump 提交于
This commit adds support for IPv6 parsing and formatting to the virtual network XML parser, including moving around data definitions to allow for multiple <ip> elements on a single network, but only changes the consumers of this API to accommodate for the changes in API/structure, not to add any actual IPv6 functionality. That will come in a later patch - this patch attempts to maintain the same final functionality in both drivers that use the network XML parser - vbox and "bridge" (the Linux bridge-based driver used by the qemu hypervisor driver). * src/libvirt_private.syms: Add new private API functions. * src/conf/network_conf.[ch]: Change C data structure and parsing/formatting. * src/network/bridge_driver.c: Update to use new parser/formatter. * src/vbox/vbox_tmpl.c: update to use new parser/formatter * docs/schemas/network.rng: changes to the schema - * there can now be more than one <ip> element. * ip address is now an ip-addr (ipv4 or ipv6) rather than ipv4-addr * new optional "prefix" attribute that can be used in place of "netmask" * new optional "family" attribute - "ipv4" or "ipv6" (will default to ipv4) * define data types for the above * tests/networkxml2xml(in|out)/nat-network.xml: add multiple <ip> elements (including IPv6) to a single network definition to verify they are being correctly parsed and formatted.
-
由 Laine Stump 提交于
When a netmask isn't specified for an IPv4 address, one can be implied based on what network class range the address is in. The virNetworkDefPrefix function does this for us, so netmask isn't required.
-
由 Laine Stump 提交于
Later patches will add the possibility to define a network's netmask as a prefix (0-32, or 0-128 in the case of IPv6). To make it easier to deal with definition of both kinds (prefix or netmask), add two new functions: virNetworkDefNetmask: return a copy of the netmask into a virSocketAddr. If no netmask was specified in the XML, create a default netmask based on the network class of the virNetworkDef's IP address. virNetworkDefPrefix: return the netmask as numeric prefix (or the default prefix for the network class of the virNetworkDef's IP address, if no netmask was specified in the XML)
-
- 25 11月, 2010 2 次提交
-
-
由 Eric Blake 提交于
* src/conf/network_conf.c (virNetworkDHCPRangeDefParseXML): Free xml strings when no longer referenced.
-
由 Eric Blake 提交于
Making this change makes it easier to spot the memory leaks that will be fixed in the next patch. * cfg.mk (sc_prohibit_xmlGetProp): New rule. * .x-sc_prohibit_xmlGetProp: New exception. * Makefile.am (EXTRA_DIST): Ship exception file. * tools/virsh.c (cmdDetachInterface, cmdDetachDisk): Adjust offenders. * src/conf/storage_conf.c (virStoragePoolDefParseSource): Likewise. * src/conf/network_conf.c (virNetworkDHCPRangeDefParseXML) (virNetworkIPParseXML): Likewise.
-
- 26 10月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
The network address was being set to 192.168.122.0 instead of 192.168.122.0/24. Fix this by removing the unneccessary 'network' field from virNetworkDef and just pass the network address and netmask into the iptables APIs directly. * src/conf/network_conf.h, src/conf/network_conf.c: Remove the 'network' field from virNEtworkDef. * src/network/bridge_driver.c: Update for iptables API changes * src/util/iptables.c, src/util/iptables.h: Require the network address + netmask pair to be passed in
-
- 22 10月, 2010 5 次提交
-
-
由 Daniel P. Berrange 提交于
The boot server IP address is optional, so it needs to be checked before attempting to parse it. * src/conf/network_conf.c: Don't parse NULL ip address for boot server
-
由 Daniel P. Berrange 提交于
Instead of storing the IP address string in virNetwork related structs, store the parsed virSocketAddr. This will make it easier to add IPv6 support in the future, by letting driver code directly check what address family is present * src/conf/network_conf.c, src/conf/network_conf.h, src/network/bridge_driver.c: Convert to use virSocketAddr in virNetwork, instead of char *. * src/util/bridge.c, src/util/bridge.h, src/util/dnsmasq.c, src/util/dnsmasq.h, src/util/iptables.c, src/util/iptables.h: Convert to take a virSocketAddr instead of char * for any IP address parameters * src/util/network.h: Add macros to determine if an address is set, and what address family is set.
-
由 Daniel P. Berrange 提交于
The inet_pton and inet_ntop functions are obsolete, replaced by getaddrinfo+getnameinfo with the AI_NUMERICHOST flag set. These can be accessed via the virSocket APIs. The bridge.c code had methods for fetching the IP address of a bridge which used inet_ntop. Aside from the use of inet_ntop these methods are broken, because a NIC can have multiple addresses and this only returns one address. Since the methods are never used, just remove them. * src/conf/network_conf.c, src/nwfilter/nwfilter_learnipaddr.c: Replace inet_pton and inet_ntop with virSocket APIs * src/util/bridge.c, src/util/bridge.h: Remove unused methods which called inet_ntop.
-
由 Daniel P. Berrange 提交于
The virSocketParse method was not doing any error reporting which meant the true cause of the problem was lost. Remove all error reporting from callers, and push it into virSocketParse * src/util/network.c: Add error reporting to virSocketParse * src/conf/domain_conf.c, src/conf/network_conf.c, src/network/bridge_driver.c: Remove error reporting in callers of virSocketParse
-
由 Daniel P. Berrange 提交于
The virSocketParseAddr function was accepting any AF_* constant and using that to set the ai_flags field in struct addrinfo. This is invalid, since address families must go in the ai_family field of the struct. * src/util/network.c: Fix handling of address family * src/conf/network_conf.c, src/network/bridge_driver.c: Pass AF_UNSPEC instead of relying on it being 0.
-
- 19 10月, 2010 1 次提交
-
-
由 Stefan Berger 提交于
Since bugs due to double-closed file descriptors are difficult to track down in a multi-threaded system, I am introducing the VIR_CLOSE(fd) macro to help avoid mistakes here. There are lots of places where close() is being used. In this patch I am only cleaning up usage of close() in src/conf where the problems were. I also dare to declare close() as being deprecated in libvirt code base (HACKING).
-
- 02 9月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* src/conf/network_conf.c (virNetworkAllocateBridge): Avoid limited buffer from snprintf.
-
- 08 6月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
The network driver is not doing correct checking for duplicate UUID/name values. This introduces a new method virNetworkObjIsDuplicate, based on the previously written virDomainObjIsDuplicate. * src/conf/network_conf.c, src/conf/network_conf.c, src/libvirt_private.syms: Add virNetworkObjIsDuplicate, * src/network/bridge_driver.c: Call virNetworkObjIsDuplicate for checking uniqueness of uuid/names
-
- 18 5月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
* cfg.mk (useless_free_options): Add many vir*Free* function names, and then remove the useless if-before-free tests exposed by running make syntax-check. * src/conf/interface_conf.c (virInterfaceDefFree): Remove useless "if". (virInterfaceAssignDef): Likewise. * src/conf/network_conf.c (virNetworkAssignDef): Likewise. * src/conf/storage_conf.c (virStoragePoolObjAssignDef): Likewise. * src/node_device/node_device_hal.c (dev_create): Likewise. * src/security/virt-aa-helper.c (vahDeinit): Likewise. * src/test/test_driver.c (testNodeDeviceCreateXML): Likewise. * src/util/conf.c (virConfSetValue): Likewise.
-
- 23 3月, 2010 1 次提交
-
-
由 Jiri Denemark 提交于
-