- 27 6月, 2016 3 次提交
-
-
由 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 6 次提交
-
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
This new listen type is currently supported only by spice graphics. It's introduced to make it easier and clearer specify to not listen anywhere in order to start a guest with OpenGL support. The old way to do this was set spice graphics autoport='no' and don't specify any ports. The new way is to use <listen type='none'/>. In order to be able to migrate to old libvirt the migratable XML will be generated without the listen element and with autoport='no'. Also the old configuration will be automatically converted to the this listen type. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1335832Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
VNC graphics already supports sockets but only via 'socket' attribute. This patch coverts that attribute into listen type 'socket'. For backward compatibility we need to handle listen type 'socket' and 'socket' attribute properly to support old XMLs and new XMLs. If both are provided they have to match, if only one of them is provided we need to be able to parse that configuration too. To not break migration back to old libvirt if the socket is provided by user we need to generate migratable XML without the listen element and use only 'socket' attribute. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Even though it's auto-generated it's based on qemu.conf option and listen type address already uses "fromConfig" to carry this information. Following commits will convert the socket to listen element so this rename is required because there will be also an option to get socket auto-generated independently on the qemu.conf option. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 08 6月, 2016 1 次提交
-
-
由 Ján Tomko 提交于
Move qemuDomainGetBlkioParametersAssignFromDef into domain_conf and export it, to allow reuse in the LXC driver.
-
- 07 6月, 2016 6 次提交
-
-
由 Peter Krempa 提交于
Now with the proper domain config validation infrastructure the check can be moved to a place that doesn't make domains vanish.
-
由 Peter Krempa 提交于
Since it will not be called from outside of conf we can unexport it too if we move it to the appropriate place. Test suite change is necessary since the error will be reported sooner now.
-
由 Peter Krempa 提交于
Similarly to the domain definition validator add a device validator. The change to the prototype of the domain validator is necessary as virDomainDeviceInfoIterateInternal requires a non-const pointer.
-
由 Peter Krempa 提交于
It's passed to all places along with the structure.
-
由 Peter Krempa 提交于
Until now we weren't able to add checks that would reject configuration once accepted by the parser. This patch adds a new callback and infrastructure to add such checks. In this patch all the places where rejecting a now-invalid configuration wouldn't be a good idea are marked with a new parser flag.
-
由 Peter Krempa 提交于
Make it obvious that the flag is controlling RNG schema validation.
-
- 06 6月, 2016 2 次提交
-
-
由 Ján Tomko 提交于
Remove the live attribute and mark the definition as transient whether the domain is runing or not. There were only two callers left calling with live=false: * testDomainStartState, where the domain already is active because we assigned vm->def->id just a few lines above the call * virDomainObjGetPersistentDef, which now only calls virDomainObjSetDefTransient for an active domain
-
由 Ján Tomko 提交于
Calling virDomainObjSetDefTransient with live=false is a no-op on an inactive domain. Only call it on an active domain, since this is the only place using the live bool.
-
- 03 6月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
There's this problem on the recent gcc-6.1: In file included from conf/domain_conf.c:37:0: conf/domain_conf.c: In function 'virDomainChrPreAlloc': conf/domain_conf.c:14109:35: error: potential null pointer dereference [-Werror=null-dereference] return VIR_REALLOC_N(*arrPtr, *cntPtr + 1); ^~ ./util/viralloc.h:158:73: note: in definition of macro 'VIR_REALLOC_N' # define VIR_REALLOC_N(ptr, count) virReallocN(&(ptr), sizeof(*(ptr)), (count), \ ^~~~~ conf/domain_conf.c: In function 'virDomainChrRemove': conf/domain_conf.c:14133:21: error: potential null pointer dereference [-Werror=null-dereference] for (i = 0; i < *cntPtr; i++) { ^~~~~~~ GCC basically fails to see, that the virDomainChrGetDomainPtrsInternal will never actually return NULL because it's never called over a domain char device with _LAST type. But to make it shut up, lets turn this function into returning an integer and check in the callers if a zero value value was returned. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 02 6月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
Okay, I admit that our code here is complex. It's not easy to spot that NULL deref can't really happen here. So it's no wonder that a dumb compiler fails to see all the connections and produces the following errors: CC conf/libvirt_conf_la-domain_conf.lo conf/domain_conf.c: In function 'virDomainDefFormatInternal': conf/domain_conf.c:22162:22: error: potential null pointer dereference [-Werror=null-dereference] if (sched->policy == i) ~~~~~^~~~~~~~ <snip/> cc1: all warnings being treated as errors Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 26 5月, 2016 2 次提交
-
-
由 Laine Stump 提交于
Hand-entering indexes for 20 PCI controllers is not as tedious as manually determining and entering their PCI addresses, but it's still annoying, and the algorithm for determining the proper index is incredibly simple (in all cases except one) - just pick the lowest unused index. The one exception is USB2 controllers because multiple controllers in the same group have the same index. For these we look to see if 1) the most recently added USB controller is also a USB2 controller, and 2) the group *that* controller belongs to doesn't yet have a controller of the exact model we're just now adding - if both are true, the new controller gets the same index, but in all other cases we just assign the lowest unused index. With this patch in place and combined with the automatic PCI address assignment, we can define a PCIe switch with several ports like this: <controller type='pci' model='pcie-root-port'/> <controller type='pci' model='pcie-switch-upstream-port'/> <controller type='pci' model='pcie-switch-downstream-port'/> <controller type='pci' model='pcie-switch-downstream-port'/> <controller type='pci' model='pcie-switch-downstream-port'/> <controller type='pci' model='pcie-switch-downstream-port'/> <controller type='pci' model='pcie-switch-downstream-port'/> ... These will each get a unique index, and PCI addresses that connect them together appropriately with no pesky numbers required.
-
由 Laine Stump 提交于
Make virDomainControllerFindUnusedIndex() a global function so that it can be used outside domain_conf.c (as well as higher up in domain_conf.c itself)/ Also make its DomainDef arg a const* so that functions which only have a const* to the domain can use it.
-
- 25 5月, 2016 2 次提交
-
-
由 Ján Tomko 提交于
Add a new element to <domain> XML: <os> <acpi> <table type="slic">/path/to/acpi/table/file</table> </acpi> </os> To supply a path to a SLIC (Software Licensing) ACPI table blob. https://bugzilla.redhat.com/show_bug.cgi?id=1327537
-
由 Peter Krempa 提交于
cgroup functions set and get the longer type so use it everywhere
-