- 13 1月, 2020 1 次提交
-
-
由 Peter Krempa 提交于
Historically there are two places where we format authentication and encryption for a disk. The logich which formats it for backing files was flawed though and didn't format it at all. This worked if the image became a backing file through the means of a snapshot but not directly. Force formatting of the source and encryption for any non-disk case to fix the issue. This caused problems in many places as we use the formatter to copy the definition. Effectively any copy lost the secret definition. https://bugzilla.redhat.com/show_bug.cgi?id=1789310 https://bugzilla.redhat.com/show_bug.cgi?id=1788898Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
- 08 1月, 2020 2 次提交
-
-
由 Ján Tomko 提交于
Add an object to hold the private data and call the allocation function if it's present in xmlopt. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Ján Tomko 提交于
This will be needed in the future for allocating private data. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 07 1月, 2020 3 次提交
-
-
由 Daniel Henrique Barboza 提交于
Remove unneeded, easy to remove goto labels (cleanup|error|done|...). Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
These functions are meant to replace verbose check for the old style of specifying UEFI with a simple function call. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The g_date_time_new_from_iso8601() function was introduced as a replacement for strptime in commit 810613a6 Author: Daniel P. Berrangé <berrange@redhat.com> Date: Mon Dec 23 15:37:26 2019 +0000 src: replace strptime()/timegm()/mktime() with GDateTime APIs set Unfortunately g_date_time_new_from_iso8601 isn't available until glib 2.56, and backporting it requires alot of code copying and poking at private glib structs. This reverts domain_conf.c back to its original parsing logic prior to 810613a6, but using g_date_time_new() instead of gmtime(). The other files are then adapted to follow a similar approach. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 03 1月, 2020 1 次提交
-
-
由 Daniel P. Berrangé 提交于
All places where we use strptime/timegm()/mktime() are handling conversion of dates in a format compatible with ISO 8601, so we can use the GDateTime APIs to simplify code. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 19 12月, 2019 1 次提交
-
-
由 Daniel Henrique Barboza 提交于
This patch introduces a new PCI hostdev address type called 'unassigned'. This new type gives users the option to add PCI hostdevs to the domain XML in an 'unassigned' state, meaning that the device exists in the domain, is managed by Libvirt like any regular PCI hostdev, but the guest does not have access to it. This adds extra options for managing PCI device binding inside Libvirt, for example, making all the managed PCI hostdevs declared in the domain XML to be detached from the host and bind to the chosen driver and, at the same time, allowing just a subset of these devices to be usable by the guest. Next patch will use this new address type in the QEMU driver to avoid adding unassigned devices to the QEMU launch command line. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 17 12月, 2019 2 次提交
-
-
由 Michal Privoznik 提交于
This function will return true if any of disks (or their backing chain) for given domain contains an NVMe disk. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> ACKed-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Michal Privoznik 提交于
To simplify implementation, some restrictions are added. For instance, an NVMe disk can't go to any bus but virtio and has to be type of 'disk' and can't have startupPolicy set. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
- 13 12月, 2019 1 次提交
-
-
由 Huaqiang 提交于
Following domain configuration changes create two memory bandwidth monitors: one is monitoring the bandwidth consumed by vCPU 0, another is for vCPU 5. ``` <cputune> <memorytune vcpus='0-4'> <node id='0' bandwidth='20'/> <node id='1' bandwidth='30'/> + <monitor vcpus='0'/> </memorytune> + <memorytune vcpus='5'> + <monitor vcpus='5'/> + </memorytune> </cputune> ``` Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NHuaqiang <huaqiang.wang@intel.com>
-
- 10 12月, 2019 1 次提交
-
-
由 Peter Krempa 提交于
A backup job may consist of many backup sub-blockjobs. Add the new blockjob type and add all type converter strings. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 09 12月, 2019 19 次提交
-
-
由 Daniel P. Berrangé 提交于
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
This parameter is now unused and can be removed entirely. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
None of the impls of this callback require the virCapsPtr param. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
None of the impls of this callback require the virCapsPtr param. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
No impl of this callback requires the virCapsPtr anymore. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The only user of this callback did not require the virCapsPtr parameter. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The QEMU impl of the callback can directly use the QEMU capabilities cache to resolve the emulator binary name, allowing virCapsPtr to be dropped. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The virCapsPtr param is not used by any of the virt drivers providing this callback. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Instead of using the virCapsPtr to get the default security model, pass this in via the parser config. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Currently the disk and chardev seclabels are validated immediately at the time their data is parsed. This forces the parser to fill in the top level secmodel at time of parsing which is an undesirable thing. This validation conceptually should be done in the post-parse phase instead. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Instead of using the virCapsPtr information, pass the driver specific netprefix in the domain parser struct. This eliminates one more use of virCapsPtr from the XML parsing/formatting code. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The XML parser currently calls virCapabilitiesDomainDataLookup during parsing to find the domain capabilities matching the triple (virt type, os type, arch) This is, however, bogus with the QEMU driver as it assumes that there is an emulator known to the default driver capabilities that matches this triple. It is entirely possible for the driver to be parsing an XML file with a custom emulator path specified pointing to a binary that doesn't exist in the default driver capabilities. This will, for example be the case on a RHEL host which only installs the host native emulator to /usr/bin. The user can have built a custom QEMU for non-native arches into $HOME and wish to use that. Aside from validation, this call is also used to fill in a machine type for the guest if not otherwise specified. Again, this data may be incorrect for the QEMU driver because it is not taking account of the emulator binary that is referenced. To start fixing this, move the validation to the post-parse callbacks where more intelligent driver specific logic can be applied. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
When parsing the guest XML we must fill in the default guest arch if it is not already present because later parts of the parsing process need this information. If no arch is specified we lookup the first guest in the capabilities data matching the os type and virt type. In most cases this will result in picking the host architecture but there are some exceptions... - The test driver is hardcoded to always use i686 arch - The VMWare/ESX drivers will always place i686 guests ahead of x86_64 guests in capabilities, so effectively they always use i686 - The QEMU driver can potentially return any arch at all depending on what combination of QEMU binaries are installed. The domain XML hardware configurations are inherently architecture specific in many places. As a result whomever/whatever created the domain XML will have had a particular architecture in mind when specifying the config. In pretty much any sensible case this arch will have been the native host architecture. i686 on x86_64 is the only sensible divergance because both these archs are compatible from a domaain XML config POV. IOW, although the QEMU driver can pick an almost arbitrary arch as its default, in the real world no application or user is likely to be relying on this default arch being anything other than native. With all this in mind, it is reasonable to change the XML parser to allow the default architecture to be passed via the domain XML options struct. If no info is explicitly given then it is safe & sane to pick the host native architecture as the default for the guest. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Moving their instance parameter to be the first one, and give consistent ordering of other parameters across all functions. Ensure that the xml options are passed into both functions in prep for future work. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Our normal practice is for the object type to be the name prefix, and the object instance be the first parameter passed in. Rename these to virDomainObjSave and virDomainDefSave moving their primary parameter to be the first one. Ensure that the xml options are passed into both functions in prep for future work. Finally enforce checking of the return type and mark all parameters as non-NULL. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Jidong Xia 提交于
With this patch users can cold unplug some sound devices. use "virsh detach-device vm sound.xml --config" command. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NJidong Xia <xiajidong@cmss.chinamobile.com>
-
- 04 12月, 2019 1 次提交
-
-
由 Han Han 提交于
Introduced in c8007fdc, it should use 'greater than max' instead of 'equal or greater than max' for the condition of checking invalid scsi unit. Signed-off-by: NHan Han <hhan@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 26 11月, 2019 6 次提交
-
-
由 Laine Stump 提交于
In the past the network driver was (mistakenly) being called for all interfaces, not just those of type='network', and so it had a chance to validate all interface configs after the actual type of the interface was known. But since the network driver has been more completely/properly separated from qemu, the network driver isn't called during the startup of any interfaces except those with type='network', so this validation no longer takes place for, e.g. <interface type='bridge'> (or direct, etc). This in turn meant that a config could erroneously specify a vlan tag, or bandwidth settings, for a type of interface that didn't support it, and the domain would start without complaint, just silently ignoring those settings. This patch moves those validation checks out of the network driver, and into virDomainActualNetDefValidate() so they will be done for all interfaces, not just type='network'. https://bugzilla.redhat.com/1741121Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Laine Stump 提交于
<interface> devices (virDomainNetDef) are a bit different from other types of devices in that their actual type may come from a network (in the form of a port connection), and that doesn't happen until the domain is started. This means that any validation of an <interface> at parse time needs to be a bit liberal in what it accepts - when type='network', you could think that something is/isn't allowed, but once the domain is started and a port is created by the configured network, the opposite might be true. To solve this problem hypervisor drivers need to do an extra validation step when the domain is being started. I recently (commit 3cff23f7, libvirt 5.7.0) added a function to peform such validation for all interfaces to the QEMU driver - qemuDomainValidateActualNetDef() - but while that function is a good single point to call for the multiple places that need to "start" an interface (domain startup, device hotplug, device update), it can't be called by the other hypervisor drivers, since 1) it's in the QEMU driver, and 2) it contains some checks specific to QEMU. For validation that applies to network devices on *all* hypervisors, we need yet another interface validation function that can be called by any hypervisor driver (not just QEMU) right after its network port has been created during domain startup or hotplug. This patch adds that function - virDomainActualNetDefValidate(), in the conf directory, and calls it in appropriate places in the QEMU, lxc, and libxl drivers. This new function is the place to put all network device validation that 1) is hypervisor agnostic, and 2) can't be done until we know the "actual type" of an interface. There is no framework for validation at domain startup as there is for post-parse validation, but I don't want to create a whole elaborate system that will only be used by one type of device. For that reason, I just made a single function that should be called directly from the hypervisors, when they are initializing interfaces to start a domain, right after conditionally allocating the network port (and regardless of whether or not that was actually needed). In the case of the QEMU driver, qemuDomainValidateActualNetDef() is already called in all the appropriate places, so we can just call the new function from there. In the case of the other hypervisors, we search for virDomainNetAllocateActualDevice() (which is the hypervisor-agnostic function that calls virNetworkPortCreateXML()), and add the call to our new function right after that. The new function itself could be plunked down into many places in the code, but we already have 3 validation functions for network devices in 2 different places (not counting any basic validation done in virDomainNetDefParseXML() itself): 1) post-parse hypervisor-agnostic (virDomainNetDefValidate() - domain_conf.c:6145) 2) post-parse hypervisor-specific (qemuDomainDeviceDefValidateNetwork() - qemu_domain.c:5498) 3) domain-start hypervisor-specific (qemuDomainValidateActualNetDef() - qemu_domain.c:5390) I placed (3) right next to (2) when I added it, specifically to avoid spreading validation all over the code. For the same reason, I decided to put this new function right next to (1) - this way if someone needs to add validation specific to qemu, they go to one location, and if they need to add validation applying to everyone, they go to the other. It looks a bit strange to have a public function in between a bunch of statics, but I think it's better than the alternative of further fragmentation. (I'm open to other ideas though, of course.) Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Laine Stump 提交于
These all just return a scalar value, so there's no daisy-chained fallout from changing them, and they can easily be combined in a single patch. Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Laine Stump 提交于
This also isn't required (due to the vportprofile being stored in the NetDef as a pointer rather than being directly contained), but it seemed dishonest to not mark it as const (and thus permit users to modify its contents) Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Laine Stump 提交于
In this case, the virNetDevBandwidthPtr that is returned is not to a region within the virDomainNetDef arg, but points elsewhere (the NetDef has the pointer, not the entire object), so technically it's not necessary to make the return value a const, but it's a bit disingenuous to *not* do it. Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Laine Stump 提交于
This is needed if we want to call the function when the virDomainNetDef* we have is a const. Since virDomainNetGetActualVlan returns a pointer to memory that is within the virDomainNetDefPtr arg, the returned pointer must also be made const. This leads to a cascade of other virNetDevVlanPtr's that must be changed to "const virNetDevVlan *". Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
- 16 11月, 2019 2 次提交
-
-
由 Jonathon Jongsma 提交于
Ensure that both x and y are non-zero when resolution is specified for a video device. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com>
-
由 Jonathon Jongsma 提交于
Since this function is now only called when an 'acceleration' element is present in the xml, any failure to parse the element will be considered an error. Previously, we detected some types of errors, but we would only log an error (virReportError()), but still return a partially-specified accel object to the caller. This patch returns NULL for all parsing errors and reports that error back up to the caller. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com>
-