- 19 8月, 2019 2 次提交
-
-
由 Vitaly Kuznetsov 提交于
In particular, use DO_TEST_CAPS_LATEST which tests the canonical 'hv-feature' syntax instead of 'hv_feature' aliases and DO_TEST_CAPS_VER with 4.0.0 to also test the old syntax. Suggested-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
virpcimock.c:685:26: error: unused variable 'devid' [-Werror,-Wunused-variable] VIR_AUTOFREE(char *) devid = NULL; ^ Fixes: 76b42294Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 17 8月, 2019 18 次提交
-
-
由 Michal Privoznik 提交于
The pci-stub is so old school that no one uses it. All modern systems have adapted VFIO. Switch our virpcitest too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The pci-stub is so old school that no one uses it. All modern systems have adapted VFIO. Switch our virhostdevtest too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The pci-assign device is so old school that no one uses it. All modern systems have adapted VFIO. Switch our xml2argv test too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The virHostdevPreparePCIDevices() function works in several steps. In the very first one, it checks if devices we want to detach from the host are not taken already by some other domain. However, this piece of code returns different results depending on the stub driver used (which is not wrong per se, but keep on reading). If the stub driver is KVM then virHostdevIsPCINodeDeviceUsed() is called which basically checks if a PCI device from the detach list is not used by any domain (including the one we are preparing the device for). If that is the case, an error is reported ("device in use") and -1 is returned. However, that is not what happens if the stub driver is VFIO. If the stub driver is VFIO, then we iterate over all PCI devices from the same IOMMU group and check if they are taken by some other domain (because a PCI device, well IOMMU group, can't be shared between two or more qemu processes). But we fail to check, if the device we are trying to detach from the host is not already taken by a domain. That is, calling virHostdevPreparePCIDevices() over a hostdev device twice succeeds the first time and fails too late in the second run (fortunately, virHostdevResetAllPCIDevices() will throw an error, but this is already too late because the PCI device in question was moved to the list of inactive PCI devices and now it appears in both lists). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
It may happen that there are two domains with the same name in two separate drivers (e.g. qemu and lxc). That is why for PCI devices we track both names of driver and domain combination which has taken the device. However, when we check if given PCI device is in use (or PCI devices from the same IOMMU group) we compare only domain name. This means that we can mistakenly claim device as free to use while in fact it isn't. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
So far, we don't need to create anything under /sys/kernel/iommu_groups/N/devices directory (which is symlinked from /sys/bus/pci/devices/DDDD:BB:DD.F/iommu_group directory) because virhostdevtest still tests the old KVM assignment and thus has no notion of IOMMU groups. This will change in near future though. And in order to discover devices belonging to the same IOMMU group we need to do what kernel does - create symlinks to devices. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
So far, we are creating devices directly under /sys/bus/pci/devices/*. There is not much problem with it, but if we really want to model kernel behaviour we need to create them under /sys/devices/pciDDDD:BB and then only symlink them from the old location. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
In upcoming patches we will need only some portions of the PCI address. To construct that easily, it's better if the PCI address of a device is stored as four integers rather than one string. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Have just one function to generate path to a PCI driver so that when we change it in near future there's only few of the places we need to fix. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Have just one function to generate path to a PCI device so that when we change it in near future there's only few of the places we need to fix. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
In near future, we will be creating devices under different location and just symlink them under devices/. Just like real kernel does. But for that we need the directories to exist. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
We will need to create more directories and instead of introducing bunch of new variables to hold their actual paths, we can have one and reuse it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The @fakesysfspcidir is derived from @fakerootdir. We don't need two global variables that contain nearly the same content, especially when we construct the actual path anyways. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
It saves us couple of lines. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
When creating a PCI device, the pciDevice structure contains @id member which holds device address (DDDD.BB:DD.F) and is type of 'char *'. But the structure is initialized from a const char and in fact we never modify or free the @id. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Newer kernels (v3.16-rc1~29^2~6^4) have 'driver_override' file which simplifies way of binding a PCI device to desired driver. Libvirt has support for this for some time too (v2.3.0-rc1~236), but not our virpcimock. So far we did not care because our code is designed to deal with this situation. Except for one. hypothetical case: binding a device to the vfio-pci driver can be successful only via driver_override. Any attempt to bind a PCI device to vfio-pci driver using old method (new_id + unbind + bind) will fail because of b803b29c. While on vanilla kernel I'm able to use the old method successfully, it's failing on RHEL kernels (not sure why). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
This reverts commit b70c093f. In next commit the virpcimock is going to be extended and thus binding a PCI device to vfio-pci driver will finally succeed. Remove this test as it will no longer make sense. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The pci_driver_bind() and pci_driver_unbind() functions are "internal implementation", meaning other parts of the code should be able to call them and get the job done. Checking for actions (PCI_ACTION_BIND and PCI_ACTION_UNBIND) should be done in handlers (pci_driver_handle_bind() and pci_driver_handle_unbind()). Surprisingly, the other two actions (PCI_ACTION_NEW_ID and PCI_ACTION_REMOVE_ID) are checked already at this level. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 16 8月, 2019 20 次提交
-
-
由 Laine Stump 提交于
virErrorPreserveLast()/virErrorRestore() (added in commit 8333e745 back in 2017), do a better better job of saving and restoring the last libvirt error than virSaveLastError()/virErrorRestore() (they're simpler, and they also save/restore the system errno). Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Laine Stump 提交于
During networkPortCreateXML, if networkAllocatePort() failed, networkReleasePort() would be called, which would (in the case of network pools of macvtap passthrough devices) attempt to find the allocated device by comparing port->plug.direct.linkdev to each device in the pool. Since port->plug.direct.linkdev was still NULL, the attempted strcmp would result in a SEGV. Calling networkReleasePort() during error cleanup is something that should only be done if networkAllocatePort() has already succeeded. It turns out there is one other possible error exit from networkPortCreateXML() that happens after networkAllocatePort() has succeeded, so the code to call networkReleasePort() was just moved down to there. Resolves: https://bugzilla.redhat.com/1741390Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Laine Stump 提交于
Commit e69444e1 (first appeared in libvirt-5.5.0) added the new value "VIR_ACCESS_PERM_NETWORK_SEARCH_PORTS" to the virAccessPerNetwork enum, and also the string "search_ports" to the VIR_ENUM_IMPL() macro for that enum. Unfortunately, the enum value was added in the middle of the list, while the string was added to the end of the VIR_ENUM_IMPL(). This patch corrects that error by moving the new value to the end of the enum definition, so that the order matches that of the string list. Resolves: https://bugzilla.redhat.com/1741428Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
Now that we support blockdev for qemuDomainBlockCopy we can allow copying to remote destinations as well. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Implement job handling for the block copy job (drive/blockdev-mirror) when using -blockdev. In contrast to the previously implemented blockjobs the block copy job introduces new images to the running qemu instance, thus requires a bit more handling. When copying to new images the code now makes use of blockdev-create to format the images explicitly rather than depending on automagic qemu behaviour. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
QEMU finally exposes an interface which allows us to instruct it to format or create arbitrary images. This is required for blockdev integration of block copy and snapshots as we need to pre-format images prior to use with blockdev-add. This path introduces job handling and also helpers for formatting and attaching a whole image described by a virStorageSource. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Rather than copying just the top level image, let's copy the full user provided backing chain. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
The only code path which calls the parser with the VIR_DOMAIN_DEF_PARSE_DISK_SOURCE is from qemuDomainBlockCopy. Since that code path can properly handle backing chains for the disk and it's desired to pass the parsed chains to the block copy code remove the condition which prevents parsing the <backingStore> element. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
In commit 3f93884a where the job handling of commit jobs with blockdev was added I've forgot to add a 'break' in the switch fomatting the status XML. Thankfully this would not be a problem as the cases where this fell through didn't have any code. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
The utility of the function is extremely limited as for block copy we need to register the mirror chain earlier than when it's set with the disk. This means that it would be open-coded in that case. Avoid any weird usage and just open-code the only current usage, remove the function, and reword the docs. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Commit 16ca234b refactored how the 'shallow' and 'reuse' flags are accessed but neglected to fix the clearing of 'shallow' in case when the disk has no backing chain. This means that we'd request a shallow copy even without backing chain and also a few checks would work wrong. Fix it by using the extracted variable everywhere. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Allow reusing original backing chain when doing a shallow copy without reuse of external image. The existing logic didn't allow it but it will be possible. Also add a note to explain that logic. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Rename qemuDomainObjPrivateXMLFormatBlockjobFormatChain to qemuDomainObjPrivateXMLFormatBlockjobFormatSource and add a 'chain' parameter which allows controlling whether the backing chain is formatted. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
The function ignores all errors from qemuStorageLimitsRefresh by calling virResetLastError. This still logs them. Since qemuStorageLimitsRefresh allows suppressing some, do so. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
qemuStorageLimitsRefresh uses qemuDomainStorageOpenStat internally and there are callers which don't care about the error. Propagate the skipInaccessible flag so that we can log less errors. Callers currently don't care about the return value change. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
None of the callers of qemuDomainStorageUpdatePhysical care about errors. Use the new flag for qemuDomainStorageOpenStat which suppresses some errors and move the reset of the rest of the uncommon errors into this function. Document what is happening in a comment for the function. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
virStorageSourceUpdatePhysicalSize is called only from qemuDomainStorageUpdatePhysical and all callers of it reset the libvirt error if -1 is returned. Don't bother setting the error in the first place. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Some callers of this function actually don't care about errors and reset it. The message is still logged which might irritate users in this case. Add a boolean flag which will do few checks whether it actually makes sense to even try opening the storage file. For local files we check whether it exists and for remote files we at first see whether we even have a storage driver backend for it in the first place before trying to open it. Other problems will still report errors but these are the most common scenarios which can happen here. This patch changes the return value of the function so that the caller is able to differentiate the possibilities. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
The function will be reused in the qemu snapshot code. The argument is turned into const similarly to the other virStorageFileSupports* functions. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
If the nbd export name contains a colon, our parser would not parse it properly as we split the string by colons. Modify the code to look up the exportname and copy any trailing characters as the export name is supposed to be at the end of the string. https://bugzilla.redhat.com/show_bug.cgi?id=1733044Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-