- 07 7月, 2016 2 次提交
-
-
由 Peter Krempa 提交于
Few arguments of the function are not necessary any more which leads to some cleanups. The 'uri' argument had a stray ATTRIBUTE_UNUSED.
-
由 Peter Krempa 提交于
-
- 02 7月, 2016 4 次提交
-
-
由 Laine Stump 提交于
This is place as a sub-element of <source>, where other aspects of the host-side connection to the network device are located (network or bridge name, udp listen port, etc). It's a bit odd that the interface we're configuring with this info is itself named in <target dev='x'/>, but that ship sailed long ago: <interface type='ethernet'> <mac address='00:16:3e:0f:ef:8a'/> <source> <ip address='192.168.122.12' family='ipv4' prefix='24' peer='192.168.122.1'/> <ip address='192.168.122.13' family='ipv4' prefix='24'/> <route family='ipv4' address='0.0.0.0' gateway='192.168.122.1'/> <route family='ipv4' address='192.168.124.0' prefix='24' gateway='192.168.124.1'/> </source> </interface> In practice, this will likely only be useful for type='ethernet', so its presence in any other type of interface is currently forbidden in the generic device Validate function (but it's been put into the general population of virDomainNetDef rather than the ethernet-specific union member so that 1) we can more easily add the capability to other types if needed, and 2) we can retain the info when set to an invalid interface type all the way through to validation and report a proper error, rather than just ignoring it (which is currently what happens for many other type-specific settings). (NB: The already-existing configuration of IP info for the guest-side of interfaces is in subelements directly under <interface>, and the name of the guest-side interface (when configurable) is in <guest dev='x'/>). (This patch had been pushed earlier in commit fe6a7789, but was reverted in commit d6584565 because it had been accidentally pushed during the freeze for release 2.0.0)
-
由 Vasiliy Tolstov 提交于
The peer attribute is used to set the property of the same name in the interface IP info: <interface type='ethernet'> ... <ip family='ipv4' address='192.168.122.5' prefix='32' peer='192.168.122.6'/> ... </interface> Note that this element is used to set the IP information on the *guest* side interface, not the host side interface - that will be supported in an upcoming patch. (This patch now has quite a history: it was originally pushed in commit 690969af, which was subsequently reverted in commit 1d14b13f, then reworked and pushed (along with a lot of other related/supporting patches) in commit 93135abf; however *that* commit had been accidentally pushed during dev. freeze for release 2.0.0, so it was again reverted in commit f6acf039). Signed-off-by: NVasiliy Tolstov <v.tolstov@selfip.ru> Signed-off-by: NLaine Stump <laine@laine.org>
-
由 John Ferlan 提交于
For a luks device, allow the configuration of a specific cipher to be used for encrypting the volume. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Laine Stump 提交于
This is a generic version of virDomainDefMetadataSanitize() - the same functionality is now needed for network metadata.
-
- 01 7月, 2016 1 次提交
-
-
由 Ján Tomko 提交于
A helper that will execute a callback on every USB device in the domain definition. With an ability to skip USB hubs, since we will want to treat them differently in some cases.
-
- 30 6月, 2016 2 次提交
-
-
由 Peter Krempa 提交于
virTypedParameterAssign steals the string rather than copying it into the typed parameter and thus freeing it leads to a crash when attempting to serialize the results. This was introduced in commit 9f50f6e2 and later made an universal helper in 32e6339c. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1351473
-
由 Peter Krempa 提交于
Some code paths already assume that it is allocated since it was always allocated by virDomainPerfDefParseXML. Make it member of virDomainDef directly so that we don't have to allocate it all the time. This fixes crash when attempting to connect to an existing process via virDomainQemuAttach since we would not allocate it in that code path. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1350688
-
- 27 6月, 2016 14 次提交
-
-
由 Laine Stump 提交于
This is place as a sub-element of <source>, where other aspects of the host-side connection to the network device are located (network or bridge name, udp listen port, etc). It's a bit odd that the interface we're configuring with this info is itself named in <target dev='x'/>, but that ship sailed long ago: <interface type='ethernet'> <mac address='00:16:3e:0f:ef:8a'/> <source> <ip address='192.168.122.12' family='ipv4' prefix='24' peer='192.168.122.1'/> <ip address='192.168.122.13' family='ipv4' prefix='24'/> <route family='ipv4' address='0.0.0.0' gateway='192.168.122.1'/> <route family='ipv4' address='192.168.124.0' prefix='24' gateway='192.168.124.1'/> </source> </interface> In practice, this will likely only be useful for type='ethernet', so its presence in any other type of interface is currently forbidden in the generic device Validate function (but it's been put into the general population of virDomainNetDef rather than the ethernet-specific union member so that 1) we can more easily add the capability to other types, and 2) we can retain the info when set to an invalid interface type all the way through to validation and report a proper error, rather than just ignoring it (which is currently what happens for many other type-specific settings). (NB: The already-existing configuration of IP info for the guest-side of interfaces is in subelements directly under <interface>, and the name of the guest-side interface (when configurable) is in <guest dev='x'/>).
-
由 Vasiliy Tolstov 提交于
The peer attribute is used to set the property of the same name in the interface IP info: <interface type='ethernet'> ... <ip family='ipv4' address='192.168.122.5' prefix='32' peer='192.168.122.6'/> ... </interface> Note that this element is used to set the IP information on the *guest* side interface, not the host side interface - that will be supported in an upcoming patch. (This is an updated *re*-commit of commit 690969af, which was subsequently reverted in commit 1d14b13f). Signed-off-by: NVasiliy Tolstov <v.tolstov@selfip.ru> Signed-off-by: NLaine Stump <laine@laine.org>
-
由 Laine Stump 提交于
virDomainNetIPInfoParseXML() and virDomainNetIPInfoFormat() are no longer "unused", so we can now remove the "ATTRIBUTE_UNUSED" from their definitions, since virDomainNetIPInfoFormat() is now the only caller of virDomainNetIPsFormat() and virDomainNetRoutesFormat(), those two functions can simply be subsumed into virDomainNetIPInfoFormat().
-
由 Laine Stump 提交于
All the same information was already there, just in slightly different places in the virDomainNetDef.
-
由 Laine Stump 提交于
a.k.a. <hostdev mode='capabilities' type='net'>. This replaces the existing nips, ips, nroutes, and routes with a single virNetDevIPInfo, and simplifies the code by calling that object's parse/format/clear functions instead of open coding.
-
由 Laine Stump 提交于
There are currently two places in the domain where this combination is used, and there is about to be another. This patch puts them together for brevity and uniformity. As with the newly-renamed virNetDevIPAddr and virNetDevIPRoute objects, the new virNetDevIPInfo object will need to be accessed by a utility function that calls low level Netlink functions (so we don't want it to be in the conf directory) and will be called from multiple hypervisor drivers (so it can't be in any hypervisor directory); the most appropriate place is thus once again the util directory. The parse and format functions are in conf/domain_conf.c because only the domain XML (i.e. *not* the network XML) has this exact combination of IP addresses plus routes. Note that virDomainNetIPInfoFormat() will end up being the only caller to virDomainNetRoutesFormat() and virDomainNetIPsFormat(), so it will just subsume those functions in a later patch, but we can't do that until they are no longer called. (It would have been nice to include the interface name within the virNetDevIPInfo object (with a slight name change), but that can't be done cleanly, because in each case the interface name is provided in a different place in the XML relative to the routes and IP addresses, so putting it in this object would actually make the code more confused rather than simpler).
-
由 Laine Stump 提交于
These functions all need to be called from a utility function that must be located in the util directory, so we move them all into util/virnetdevip.[ch] now that it exists. Function and struct names were appropriately changed for the new location, but all code is unchanged aside from motion and renaming.
-
由 Laine Stump 提交于
When support for <interface type='ethernet'> was added in commit 9a4b705f back in 2010, it erroneously looked at <source dev='blah'/> for a user-specified guest-side interface name. This was never documented though. (that attribute already existed at the time in the data.ethernet union member of virDomainNetDef, but apparently had no practical use - it was only used as a storage place for a NetDef's bridge name during qemuDomainXMLToNative(), but even then that was never used for anything). When support for similar guest-side device naming was added to the lxc driver several years later, it was put in a new subelement <guest dev='blah'/>. In the intervening years, since there was no validation that ethernet.dev was NULL in the other drivers that didn't actually use it, innocent souls who were adding other features assuming they needed to account for non-NULL ethernet.dev when really they didn't, so little bits of the usual pointless cargo-cult code showed up. This patch not only switches the openvz driver to use the documented <guest dev='blah'/> notation for naming the guest-side device (just in case anyone is still using the openvz driver), and logs an error if anyone tries to set <source dev='blah'/> for a type='ethernet' interface, it also removes the cargo-cult uses of ethernet.dev and <source dev='blah'/>, and eliminates if from the RNG and from virDomainNetDef. NB: I decided on this course of action after mentioning the inconsistency here: https://www.redhat.com/archives/libvir-list/2016-May/msg02038.html and getting encouragement do eliminate it in a later IRC discussion with danpb.
-
由 Laine Stump 提交于
We need to clear these out without freeing the object completely.
-
由 Laine Stump 提交于
Rearrange this function to be better organized and more correct: * the error codes were changed from the incorrect INVALID_ARG to XML_ERROR * prefix still isn't required, but if present it must be valid or an error will be logged. * don't emit a debug log just because prefix is missing - this is valid. * group everything related to setting prefix in one place rather than scattered through the function.
-
由 Laine Stump 提交于
I'm tired of mistyping this all the time, so let's do it the same all the time (similar to how we changed all "Pci" to "PCI" awhile back). (NB: I've left alone some things in the esx and vbox drivers because I'm unable to compile them and they weren't obviously *not* a part of some API. I also didn't change a couple of variables named, e.g. "somethingIptables", because they were derived from the name of the "iptables" command)
-
由 Laine Stump 提交于
These had been declared in conf/device_conf.h, but then used in util/virnetdev.c, meaning that we had to #include conf/device_conf.h in virnetdev.c (which we have for a long time said shouldn't be done. This caused a bigger problem when I tried to #include util/virnetdev.h in a file in src/conf (which is allowed) - for some reason the "device_conf.h: File not found" error. The solution is to move the data types and functions used in util sources from conf to util. Some names were adjusted during the move ("virInterface" --> "virNetDevIf", and "VIR_INTERFACE" --> "VIR_NETDEV_IF")
- 24 6月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Disallowing them broke a use case of testing multipath configurations for storage. Originally this was added as it was impossible to use certain /dev/disk-by... links but the disks worked properly. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1349895
-
- 23 6月, 2016 3 次提交
-
-
由 Cole Robinson 提交于
This code was attempting to handle some implicit <console> XML formatting for manually assembled DomainDef, since previously the console<->serial compat copying was only done at XML parse time. Nowadays it's done via virDomainDefPostParse -> virDomainDefAddConsoleCompat, which all manual DomainDef builders already call, so we can drop this workaround.
-
由 Ján Tomko 提交于
We are done if the string ends and move to another nesting level if we find a dot.
-
由 Ján Tomko 提交于
Make rewriting it easier.
-
- 21 6月, 2016 1 次提交
-
-
由 Laine Stump 提交于
In the case of chassisNr (used to set chassis_nr of a pci-bridge controller), 0 is reserved for / used by the pci[e]-root bus. In the base of busNr, a value of 0 would mean that the root bus had no places available to plug in new buses, including the pxb itself (the documentation I wrote for pxb even noted the limit of busNr as 1.254). NB: oddly, the "chassis" attribute, which is used for pcie-root-port and pcie-switch-downstream-port *can* be set to 0, since it's the combination of {chassis, slot} that needs to be unique, not chassis by itself (and slot 0 of pcie-root is reserved, while pcie-*-port can use *only* slot 0). This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1342962
-
- 20 6月, 2016 3 次提交
-
-
由 Peter Krempa 提交于
Use 'cleanup' since it's also used on success.
-
由 Peter Krempa 提交于
When loading status XMLs with following graphics definition: <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'> <listen type='address' address='127.0.0.1' fromConfig='1'/> <image compression='off'/> </graphics> libvirtd would leak a few bytes: 10 bytes in 1 blocks are definitely lost in loss record 71 of 1,127 at 0x4C2C000: malloc (vg_replace_malloc.c:299) by 0x6789298: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4) by 0x552AB0A: virXMLPropString (virxml.c:479) by 0x5539536: virDomainGraphicsListensParseXML (domain_conf.c:11171) by 0x553DD5E: virDomainGraphicsDefParseXMLSpice (domain_conf.c:11414) by 0x553DD5E: virDomainGraphicsDefParseXML (domain_conf.c:11749) by 0x5566061: virDomainDefParseXML (domain_conf.c:16939) by 0x556953F: virDomainObjParseXML (domain_conf.c:17348) by 0x556953F: virDomainObjParseNode (domain_conf.c:17513) by 0x5569902: virDomainObjParseFile (domain_conf.c:17532) by 0x5571E02: virDomainObjListLoadStatus (virdomainobjlist.c:514) by 0x5571E02: virDomainObjListLoadAllConfigs (virdomainobjlist.c:596) by 0x26E0BDC8: qemuStateInitialize (qemu_driver.c:911) by 0x55B1FDB: virStateInitialize (libvirt.c:770) by 0x122039: daemonRunStateInit (libvirtd.c:960)
-
由 Ján Tomko 提交于
Most the callers pass 0 in one form or another, including vircapstest which used VIR_ARCH_NONE.
-
- 18 6月, 2016 3 次提交
-
-
由 Michal Privoznik 提交于
This is going to be important later when we received DEVICE_DELETED event on the qemu monitor. If we do, virDomainDefFindDevice() is called to find the device for given device alias in the virDomainDef tree. When we enable removal for redirdevs we need to include them in the lookup process too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
Basically, there are just two functions introduced here: virDomainRedirdevDefFind which looks up given redirdev in domain definition, and virDomainRedirdevDefRemove which removes the device at given index in the array of devices. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
There's currently just one limitation: redirdevs that want to go on USB bus require a USB controller, surprisingly. At the same time, since I'm using virDomainDefHasUSB() in this new validator function, it has to be moved a few lines up and also its header needed to be changed a bit: it is now taking a const pointer to domain def since it's not changing anything in there. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 17 6月, 2016 3 次提交
-
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
While we need to know the difference between the total memory stored in <memory> and the actual size not included in the possible memory modules we can't pre-calculate it reliably. This is due to the fact that libvirt's XML is copied via formatting and parsing the XML and the initial memory size can be reliably calculated only when certain conditions are met due to backwards compatibility. This patch removes the storage of 'initial_memory' and fixes the helpers to recalculate the initial memory size all the time from the total memory size. This conversion is possible when we also make sure that memory hotplug accounts properly for the update of the total memory size and thus the helpers for inserting and removing memory devices need to be tweaked too. This fixes a bug where a cold-plug and cold-remove of a memory device would increase the size reported in <memory> in the XML by the size of the memory device. This would happen as the persistent definition is copied before attaching the device and this would lead to the loss of data in 'initial_memory'. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1344892
-
由 Peter Krempa 提交于
The parser was totaly broken. Fix it by rewriting it. Add tests so that it doesn't happen. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1346723
-
- 14 6月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
This option allows or disallows detection of zero-writes if it is set to "on" or "off", respectively. It can be also set to "unmap" in which case it will try discarding that part of image based on the value of the "discard" option. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 11 6月, 2016 1 次提交
-
-
由 Pavel Hrdina 提交于
../../src/conf/domain_conf.c:10949: error: declaration of 'socket' shadows a global declaration [-Wshadow] ../../src/conf/domain_conf.c:24373: error: declaration of 'listen' shadows a global declaration [-Wshadow] Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 09 6月, 2016 1 次提交
-
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-