- 29 6月, 2020 2 次提交
-
-
由 Michal Privoznik 提交于
In 07659100 a validation code was added to virDomainDeviceInfoFormat() which reports an error if zPCI address entered in was incomplete. But, there are two problems with this approach. The first problem is the placement of the code - it doesn't belong into XML formatter rather than XML validator. The second one is that at the point of formatting XML the post parse callback has run and thus filled in required info. Therefore this check can never do something useful and instead of moving it into validator, it's removed completely. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
由 Michal Privoznik 提交于
To make the code future proof, the rest of the qemuValidateDomainDeviceDefAddress() has to be executed (even though there is nothing there yet) instead of returning directly. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
- 27 6月, 2020 4 次提交
-
-
由 Daniel Henrique Barboza 提交于
Commit 07659100 ("conf: fix zPCI address auto-generation on s390") is doing a check for virZPCIDeviceAddressIsIncomplete() prior to checking if the device has a ZPCI address at all. This results in errors like these when starting libvirt: error : virDomainDeviceInfoFormat:7527 : internal error: Missing uid or fid attribute of zPCI address Fix it by moving virZPCIDeviceAddressIsIncomplete() after the check done by virZPCIDeviceAddressIsPresent(). Fixes: 07659100Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
The ZPCI device validation is specific to qemu. So, let us move the ZPCI uid validation out of domain xml parsing into qemu domain device validation. Signed-off-by: NShalini Chellathurai Saroja <shalini@linux.ibm.com> Reviewed-by: NBjoern Walk <bwalk@linux.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
Let us fix the issues with zPCI address validation and auto-generation on s390. Currently, there are two issues with handling the ZPCI address extension. Firstly, when the uid is to be auto-generated with a specified fid, .i.e.: ... <address type='pci'> <zpci fid='0x0000001f'/> </address> ... we expect uid='0x0001' (or the next available uid for the domain). However, we get a parsing error: $ virsh define zpci.xml error: XML error: Invalid PCI address uid='0x0000', must be > 0x0000 and <= 0xffff Secondly, when the uid is specified explicitly with the invalid numerical value '0x0000', we actually expect the parsing error above. However, the domain is being defined and the uid value is silently changed to a valid value. The first issue is a bug and the second one is undesired behaviour, and both issues are related to how we (in-band) signal invalid values for uid and fid. So let's fix the XML parsing to do validation based on what is actually specified in the XML. The first issue is also related to the current code behaviour, which is, if either uid or fid is specified by the user, it is incorrectly assumed that both uid and fid are specified. This bug is fixed by identifying when the user specified ZPCI address is incomplete and auto-generating the missing ZPCI address. Signed-off-by: NBjoern Walk <bwalk@linux.ibm.com> Signed-off-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: NShalini Chellathurai Saroja <shalini@linux.ibm.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
Signed-off-by: NBjoern Walk <bwalk@linux.ibm.com> Signed-off-by: NShalini Chellathurai Saroja <shalini@linux.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
- 26 6月, 2020 10 次提交
-
-
由 Daniel P. Berrangé 提交于
Refer to the notion of mount propagation instead which describes the actual behaviour more clearly. Reviewed-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The two sides of a PTY can be referred to as primary and secondary TTYs. Reviewed-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
When querying QEMU we have to iterate over two nested sets of CPUs. The terms "main vcpu" and "sub vcpu" are a good representation. Reviewed-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The two sides of a PTY can be referred to as primary and secondary TTYs. Reviewed-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The term "ignored" is a better choice for the filtering performed on devices from udev. Reviewed-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
This new naming matches the terminology used in the error messages that the callers report. Reviewed-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
When listing CPU models, we need to filter the data based on sets of permitted and forbidden CPU models. Reviewed-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The term "access control list" better describes the concept involved. Reviewed-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The term "access control list" better describes the concept involved. Reviewed-by: NPeter Krempa <pkrempa@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Jonathon Jongsma 提交于
Although a ramfb video device is not a PCI device, we don't currently report an error for ramfb device definitions containing a PCI address. However, a guest configured with such a device will fail to start: # virsh start test1 error: Failed to start domain test1 error: internal error: qemu unexpectedly closed the monitor: 2020-06-16T05:23:02.759221Z qemu-kvm: -device ramfb,id=video0,bus=pcie.0,addr=0x1: Device 'ramfb' can't go on PCIE bus A better approach is to reject any device definitions that contain PCI addresses. While this is a change in behavior, any existing configurations were non-functional. https://bugzilla.redhat.com/show_bug.cgi?id=1847259Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com>
-
- 25 6月, 2020 4 次提交
-
-
由 Michal Privoznik 提交于
A few commits back (in v6.4.0-131-gbdb8f2e4) the post parse function for domain interface was changed so that it doesn't fill in model for hostdev types of interfaces (including network type interfaces which would end up hostdevs). While the idea is sound, the execution can be a bit better: virDomainNetResolveActualType() which is used to determine runtime type of given interface is heavy gun - it connects to network driver, fetches network XML, parses it. This all is followed by check whether the interface doesn't already have model set (from domain XML). If we switch the order of these two checks then the short circuit evaluation will ensure the expensive check is done only if really needed. This commit in fact fixes qemuxml2xmltest which due to lacking fake network driver tries to connect to network:///session and start the virtnetworkd. Fortunately, because of v6.3.0-25-gf28fbb05 it fails to do so and virDomainNetResolveActualType() returns -1. The only reason we don't see the test failing is because our input XMLs have model and thus we are saved by the latter (now former) check. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NLaine Stump <laine@redhat.com>
-
由 Laine Stump 提交于
Until recently, an <interface type='network'> would automatically be assigned model "rtl8139", which in turn would lead to the device being assigned a PCI address on a conventional PCI controller (i.e. a pcie-to-pci-bridge). If the network was a typical Linux host bridge-based network that used an emulated device, this would be appropriate, since the guest actually would get an emulated rtl8139 NIC, and that device is a conventional PCI device. However, if the network being used was a pool of hostdev devices, the guest would get an actual PCIe network device assigned from the host via VFIO; while the interface model in that case is irrelevant for the QEMU commandline to assign the device, the PCI address would have already been assigned prior to runtime, so the address assignment would be done based on the model='rtl8139' - a conventional PCI device. VFIO assignment of a PCIe device to a conventional PCI slot works, but we would rather have these devices in a PCIe slot. Since commit bdb8f2e4, if <interface type='network'> points to a etwork that is a pool of hostdev devices, the interface model will be _unset_ by default. This patch uses that information when deciding what type of slot to assign to the device: since all hostdev network interfaces are SR-IOV VFs, and *all* SR-IOV network cards are PCIe, it is safe to assume that the VFs are PCIe and we should assign then to a PCIe slot in the guest. Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
由 Prathamesh Chavan 提交于
All the domain job related APIs were present in `qemu_domain.c` along with the other domain APIs. In this patch, we move all the qemu domain job APIs into a separate file. Also, in this process, `qemuDomainTrackJob()`, `qemuDomainFreeJob()`, `qemuDomainInitJob()` and `qemuDomainObjSaveStatus()` were converted to a non-static funciton and exposed using `qemu_domain.h`. Signed-off-by: NPrathamesh Chavan <pc44800@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Prathamesh Chavan 提交于
In functions `qemuDomainObjInitJob`, `qemuDomainObjResetJob`, `qemuDomainObjResetAgentJob`, `qemuDomainObjResetAsyncJob`, `qemuDomainObjFreeJob`, `qemuDomainJobAllowed`, `qemuDomainNestedJobAllowed` we avoid sending the complete qemuDomainObjPrivatePtr as parameter and instead just send qemuDomainJobObjPtr. This is done in a effort to separating the qemu-job APIs into a spearate file. Signed-off-by: NPrathamesh Chavan <pc44800@gmail.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 24 6月, 2020 7 次提交
-
-
由 Michal Privoznik 提交于
Some functions or code paths that may fail don't report error (e.g. when acquiring PID file fails) leading to a silent quit of the leaseshelper. This makes it super hard for us and users to debug what is happening. Fortunately, dnsmasq captures both stdout and stderr so we can write an error message there. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
On a DHCP transaction, dnsmasq runs our leases helper which updates corresponding JSON files. While one dnsmasq won't run the leaseshelper in parallel, two dnsmasqs (from two distinct networks) might. To avoid corrupting JSON file, the leaseshelper acquires PID file first. Well, the way it's acquiring it is not ideal - it calls virPidFileAcquirePath(wait = false); which means, that either it acquires the PID file instantly or returns an error and does not touch the JSON at all. This in turn means that there might be a leases record missing. With wait = true, this won't happen. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1840307Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The "virsh domcapabilities --arch ppc64" command will fail with no error message set if qemu-system-ppc64 is not currently installed. This is because virQEMUCapsCacheLookup() does not report any error message if not capabilities can be obtained from the cache. Almost all methods calling this expected an error to be set on failure. Once that's fixed though, we see a further bug which is that virQEMUCapsCacheLookupDefault() is passing a NULL binary path to virQEMUCapsCacheLookup(), so we need to catch that too. Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Jonathon Jongsma 提交于
It's possible to use ramfb as the boot display of an assigned vgpu device. This was introduced in 4b95738c, but unfortunately the attribute was not formatted into the xml output for such a device. This patch fixes that oversight and adds a xml2xml test to verify proper behavior. https://bugzilla.redhat.com/show_bug.cgi?id=1847791Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Daniel P. Berrangé 提交于
The XML format used for QEMU capabilities is not required to be stable across releases, as we invalidate the cache whenever the libvirt binary changes. We none the less always try to parse te entire XML file before we do any validity checks. Thus if we change the format of any part of the data, or change permitted values for enums, then libvirtd logs will be spammed with errors. These are not in fact errors, but an expected scenario. This change makes the loading code validate the cache timestamp against the libvirtd timestamp immediately. If they don't match then we stop loading the rest of the XML file. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Dmitry Nesterenko 提交于
It is easier for management software (and subsequently distributions) to install hook script under /etc/libvirt/hooks/$driver.d/ and have libvirt execute them in alphabetical order. To maintain backwards compatibility, /etc/libvirt/hooks/$driver hook script is executed the first followed by scripts from the $driver.d directory. The stdio is chained between the scripts. The output of the first script is input of the second and so on. Signed-off-by: NDmitry Nesterenko <dmitry.nesterenko@virtuozzo.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Dmitry Nesterenko 提交于
This refactor is needed to support support hooks placed in several files. Signed-off-by: NDmitry Nesterenko <dmitry.nesterenko@virtuozzo.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 23 6月, 2020 13 次提交
-
-
由 Daniel Henrique Barboza 提交于
This patch wraps it up all the wiring done in previous patches, enabling a PPC64 guest to launch a guest using a TPM Proxy device. Note that device validation is already being done in qemu_validate.c, qemuValidateDomainDeviceDefTPM(), on domain define time. We don't need to verify QEMU capabilities for this device again inside qemu_command.c. Tested-by: NSatheesh Rajendran <sathnaga@linux.vnet.ibm.com> Reviewed-by: NStefan Berger <stefanb@linux.ibm.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Daniel Henrique Barboza 提交于
Previous patch handled the conversion of def->tpm to the array def->tpms and the XML parsing logic. This patch handles the validations needed to ensure the intended behavior. The existing qemuValidateDomainDeviceDefTPM() function was updated to guarantee that the VIR_DOMAIN_TPM_MODEL_SPAPR_PROXY model is exclusive to PPC64 guests and to the VIR_DOMAIN_TPM_TYPE_PASSTHROUGH backend. A new function called qemuDomainDefTPMsPostParse() was added to guarantee that the following combinations in the same domain are valid: - a single TPM device - a single TPM Proxy device - a single TPM + single TPM Proxy devices And these combinations in the same domain are NOT valid: - 2 or more TPM devices - 2 or more TPM Proxy devices Tested-by: NSatheesh Rajendran <sathnaga@linux.vnet.ibm.com> Reviewed-by: NStefan Berger <stefanb@linux.ibm.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Daniel Henrique Barboza 提交于
A TPM Proxy device can coexist with a regular TPM, but the current domain definition supports only a single TPM device in the 'tpm' pointer. This patch replaces this existing pointer in the domain definition to an array of TPM devices. All files that references the old pointer were adapted to handle the new array instead. virDomainDefParseXML() TPM related code was adapted to handle the parsing of an extra TPM device. TPM validations after this new scenario will be updated in the next patch. Tested-by: NSatheesh Rajendran <sathnaga@linux.vnet.ibm.com> Reviewed-by: NStefan Berger <stefanb@linux.ibm.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Daniel Henrique Barboza 提交于
This trivial rework is aimed to reduce the amount of line changes made by the next patch, when 'def->tpm' will become a 'def->tpms' array. Instead of using a 'switch' where only the VIR_DOMAIN_TPM_TYPE_EMULATOR label does something, use an 'if' clause instead. Tested-by: NSatheesh Rajendran <sathnaga@linux.vnet.ibm.com> Reviewed-by: NStefan Berger <stefanb@linux.ibm.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Daniel Henrique Barboza 提交于
qemuExtDevicesInitPaths() does not need 'ret'. Tested-by: NSatheesh Rajendran <sathnaga@linux.vnet.ibm.com> Reviewed-by: NStefan Berger <stefanb@linux.ibm.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Daniel Henrique Barboza 提交于
Expose the TPM Proxy support for PPC64 guests by creating a new cap called QEMU_CAPS_DEVICE_SPAPR_TPM_PROXY. This device is part of the machinery the guest need to orchestrate with the PPC64 Ultravisor the transition to the Secure VM (SVM) mode. Inside QEMU, this device will be used with the H_TPM_COMM hypercall to connect with the TPM Resource Manager, enabling the guest to open and close TPM sessions with the host TPM. Tested-by: NSatheesh Rajendran <sathnaga@linux.vnet.ibm.com> Reviewed-by: NStefan Berger <stefanb@linux.ibm.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Daniel Henrique Barboza 提交于
Use g_autoptr() in qemuCaps to get rid of a virObjectUnref call, a 'cleanup' label and the 'ret' pointer. Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
When building command line for IOMMU or machine, there are two comments which mention function that validate IOMMU. But they both refer to old name which was changed in v6.3.0-rc1~246. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Menno Lageman 提交于
Format the address width attribute. Depending on the version of QEMU it is named 'aw-bits' or 'x-aw-bits'. Signed-off-by: NMenno Lageman <menno.lageman@oracle.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Menno Lageman 提交于
Add a new aw_bits attribute to the iommu device to control the address width of the intel-iommu Signed-off-by Menno Lageman <menno.lageman@oracle.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Liao Pingfang 提交于
Correct the log name for qemu_security.c to qemu.qemu_security instead of qemu.qemu_process. Signed-off-by: NLiao Pingfang <liao.pingfang@zte.com.cn> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
The bitmap name used for the incremental backup would be leaked otherwise. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Originally the function was cleaning up a failed job only but now there's other stuff that needs to be cleared too. Make only steps which clean up after a failed job depend on the 'started' field and execute the rest of the code always. This fixes a leak of the backup job tracking object and the blockdev-add helper data. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-