- 18 10月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
When formatting an inactive or migratable XML we will need to suppress backing chain members which were detected from the disk to keep semantics straight. This means we need to record, whether a virStorageSource originates from autodetection.
-
- 17 10月, 2017 5 次提交
-
-
由 Peter Krempa 提交于
Express a properly terminated backing chain by putting a virStorageSource of type VIR_STORAGE_TYPE_NONE in the chain. The newly used helpers simplify this greatly. The change fixes a bug as formatting an incomplete backing chain and parsing it back would end up in expressing a terminated chain since src->backingStoreRaw was not populated. By relying on the terminator object this can be now processed appropriately.
-
由 Peter Krempa 提交于
Add helpers that will simplify checking if a backing file is valid or whether it has backing store. The helper virStorageSourceIsBacking returns true if the given virStorageSource is a valid backing store member. virStorageSourceHasBacking returns true if the virStorageSource has a backing store child. Adding these functions creates a central points for further refactors.
-
由 Peter Krempa 提交于
chain->path may be NULL e.g. for NBD drives, so the check needs to avoid dereferencing the path in such case
-
由 Peter Krempa 提交于
We can now use the backing store ID directly rather than counting the number of images seen while looking up images.
-
由 Peter Krempa 提交于
The backing store indexes were not bound to the storage sources in any way. To allow us to bind a given alias to a given storage source we need to save the index in virStorageSource. The backing store ids are now generated when detecting the backing chain. Since we don't re-detect the backing chain after snapshots, the numbering needs to be fixed there.
-
- 16 10月, 2017 3 次提交
-
-
由 Ladi Prosek 提交于
The code was vulnerable to SQL injection. Likely not a security issue due to WMI SQL and other constraints but still lame. For example: virsh # dominfo \" error: failed to get domain '"' error: internal error: SOAP fault during enumeration: code 's:Sender', subcode 'n:CannotProcessFilter', reason 'The data source could not process the filter. The filter might be missing or it might be invalid. Change the filter and try the request again. ', detail 'The WS-Management service cannot process the request. The WQL query is invalid. ' This commit fixes the Hyper-V driver by escaping all WMI SQL string parameters. The same command with the fix: virsh # dominfo \" error: failed to get domain '"' error: Domain not found: No domain with name " Signed-off-by: NLadi Prosek <lprosek@redhat.com>
-
由 Daniel P. Berrange 提交于
This adds a rule to require https links for the libvirt, qemu and kvm websites. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Jiri Denemark 提交于
The API makes a deep copy of a NULL-terminated string list. Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 14 10月, 2017 1 次提交
-
-
由 John Ferlan 提交于
Commit id '8708ca01' added a check to determine whether the NIC had Switchdev capabilities; however, in doing so inadvertently would cause network devices without a PCI device to not be added to the node device database. Thus, network devices having a "computer" as a parent, such as "net_lo*", "net_virbr*", "net_tun*", "net_vnet*", etc. were not added. Alter the check to not even check for Switchdev bits if no PCI device found.
-
- 13 10月, 2017 1 次提交
-
-
由 John Ferlan 提交于
Need to free @groups in the parent on success similar to other APIs (virFile*) which use virGetGroupList and virFork. Reported by Coverity.
-
- 10 10月, 2017 2 次提交
-
-
由 Marc Hartmayer 提交于
This commit fixes the deadlock introduced by commit 0980764d. The call getgrouplist() of the glibc library isn't safe to be called in between fork and exec (see commit 75c12564). Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com> Fixes: 0980764d ("util: share code between virExec and virCommandExec") Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
-
由 Marc Hartmayer 提交于
These functions are used by an upcoming commit. Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
-
- 06 10月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
virTristateBoolFromBool and virTristateSwitchFromBool convert a boolean to the correct enum value.
-
- 05 10月, 2017 2 次提交
-
-
由 Michal Privoznik 提交于
Similarly to previous patch, for some types of interface domain and host are on the same side of RX/TX barrier. In that case, we need to set up the QoS differently. Well, swapped. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1497410 The comment in virNetDevTapInterfaceStats() implementation for Linux states that packets transmitted by domain are received by the host and vice versa. Well, this is true but not for all types of interfaces. For instance, for macvtaps when TAP device is hooked right onto a physical device any packet that domain sends looks also like a packet sent to the host. Therefore, we should allow caller to chose if the stats returned should be straight copy or swapped. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 04 10月, 2017 2 次提交
-
-
由 Michal Privoznik 提交于
It will come handy to know if the MAC address was generated (e.g. during XML parse) or if it was parsed since provided by user in the XML. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Kothapally Madhu Pavan 提交于
Free DBusMessage pointer in virPolkitCheckAuth Signed-off-by: NKothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
-
- 28 9月, 2017 2 次提交
-
-
由 John Ferlan 提交于
Introduce a function to setup any TLS needs for a disk source. If there's a configuration or other error setting up the disk source for TLS, then cause the domain startup to fail. For VxHS, follow the chardevTLS model where if the src->haveTLS hasn't been configured, then take the system/global cfg->haveTLS setting for the storage source *and* mark that we've done so via the tlsFromConfig setting in storage source. Next, if we are using TLS, then generate an alias into a virStorageSource 'tlsAlias' field that will be used to create the TLS object and added to the disk object in order to link the two together for QEMU. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Ashish Mittal 提交于
Add an optional virTristateBool haveTLS to virStorageSource to manage whether a storage source will be using TLS. Sample XML for a VxHS disk: <disk type='network' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source protocol='vxhs' name='eb90327c-8302-4725-9e1b-4e85ed4dc251' tls='yes'> <host name='192.168.0.1' port='9999'/> </source> <target dev='vda' bus='virtio'/> </disk> Additionally add a tlsFromConfig boolean to control whether the TLS setting was due to domain configuration or qemu.conf global setting in order to decide whether to Format the haveTLS setting for either a live or saved domain configuration file. Update the qemuxml2xmltest in order to add a test to show the proper parsing. Also update the docs to describe the tls attribute. Signed-off-by: NAshish Mittal <Ashish.Mittal@veritas.com> Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 27 9月, 2017 3 次提交
-
-
由 Ján Tomko 提交于
Calling fallocate on the new (smaller) capacity ensures that the whole file is allocated, but it does not reduce the file size. Also call ftruncate after fallocate. https://bugzilla.redhat.com/show_bug.cgi?id=1366446
-
由 Ján Tomko 提交于
We have been trying to implement the ALLOCATE flag to mean "the volume should be fully allocated after the resize". Since commit b0579ed9 we do not allocate from the existing capacity, but from the existing allocation value. However this value is a total of all the allocated bytes, not an offset. For a sparsely allocated file: $ perl -e 'print "x"x8192;' > vol1 $ fallocate -p -o 0 -l 4096 vol1 $ virsh vol-info vol1 default Capacity: 8.00 KiB Allocation: 4.00 KiB Treating allocation as an offset would result in an incompletely allocated file: $ virsh vol-resize vol1 --pool default 16384 --allocate Capacity: 16.00 KiB Allocation: 12.00 KiB Call fallocate from zero on the whole requested capacity to fully allocate the file. After that, the volume is fully allocated after the resize: $ virsh vol-resize vol1 --pool default 16384 --allocate $ virsh vol-info vol1 default Capacity: 16.00 KiB Allocation: 16.00 KiB
-
由 Ján Tomko 提交于
Introduce a new function virFileAllocate that will call the non-destructive variants of safezero, essentially reverting my commit 1390c268 safezero: fall back to writing zeroes even when resizing back to the state as of commit 18f03166 virstoragefile: Have virStorageFileResize use safezero This means that _ALLOCATE flag will no longer work on platforms without the allocate syscalls, but it will not overwrite data either.
-
- 25 9月, 2017 1 次提交
-
-
由 Daniel P. Berrange 提交于
Seeing a log message saying 'flags=93' is ambiguous & confusing unless you happen to know that libvirt always prints flags as hex. Change our debug messages so that they always add a '0x' prefix when printing flags, and '0' prefix when printing mode. A few other misc places gain a '0x' prefix in error messages too. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 22 9月, 2017 3 次提交
-
-
由 Laine Stump 提交于
After commit 8708ca01 libvirtd consistently aborts with "stack smashing detected" when nodedev driver is initialized. This is caused by nlmsg_parse() being told that its array of nlattr* has CTRL_CMD_MAX (10) entries, when in fact it is declared to have CTRL_ATTR_MAX (8) entries. Since all the entries are initialized to NULL, the result is that nlmsg_parse is overwriting 2*(sizof(nlattr*)) bytes outside the array. Signed-off-by: NLaine Stump <laine@laine.org> Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 John Ferlan 提交于
Commit id '5604c056' used the wrong API to generate the <secret type='%s'..." field. The previous code used the correct API as was done in commit id '6887af39'. The data is actually a usage type not an auth type even though the result is the same.
-
由 John Ferlan 提交于
Move the virSecretUsageType into the util.
-
- 21 9月, 2017 1 次提交
-
-
由 Daniel P. Berrange 提交于
The iohelper currently calls saferead() to get data from the underlying file. This has a problem with O_DIRECT when hitting end-of-file. saferead() is asked to read 1MB, but the first read() it does may return only a few KB, so it'll try another read() to fill the remaining buffer. Unfortunately the buffer pointer passed into this 2nd read() is likely not aligned to the extent that O_DIRECT requires, so rather than seeing '0' for end-of-file, we'll get -1 + EINVAL due to misaligned buffer. The way the iohelper is currently written, it already handles getting short reads, so there is actually no need to use saferead() at all. We can simply call read() directly. The benefit of this is that we can now write() the data immediately so when we go into the subsequent reads() we'll always have a correctly aligned buffer. Technically the file position ought to be aligned for O_DIRECT too, but this does not appear to matter when at end-of-file. Tested-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 20 9月, 2017 3 次提交
-
-
由 Ashish Mittal 提交于
Add the backing parse and a test case to verify parsing of VxHS backing storage. Signed-off-by: NAshish Mittal <Ashish.Mittal@veritas.com> Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Ashish Mittal 提交于
Add a new virStorageNetProtocol for Veritas HyperScale (VxHS) disks Signed-off-by: NAshish Mittal <Ashish.Mittal@veritas.com> Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Laine Stump 提交于
The mlx4 (Mellanox) netdev driver implements the sysfs phys_port_id file for both VFs and PFs, so you can find the VF netdev plugged into the same physical port as any given PF netdev by comparing the contents of phys_port_id of the respective netdevs. That's what libvirt does when attempting to find the PF netdev for a given VF netdev (or vice versa). Most other netdev's drivers don't implement phys_port_id, so the file is visible in sysfs directory listing, but attempts to read it result in ENOTSUPP. In these cases, libvirt is unable to read phys_port_id of either the PF or the VF, so it just returns the first entry in the PF/VF's list of netdevs. But we've found that the i40e driver is in between those two situations - it implements phys_port_id for PF netdevs, but doesn't implement it for VF netdevs. So libvirt would successfully read the phys_port_id of the PF netdev, then try to find a VF netdev with matching phys_port_id, but would fail because phys_port_id is NULL for all VFs. This would result in a message like the following: Could not find network device with phys_port_id '3cfdfe9edc39' under PCI device at /sys/class/net/ens4f1/device/virtfn0 To solve this problem in a way that won't break functionality for anyone else, this patch saves the first netdev name we find for the device, and returns that if we fail to find a netdev with the desired phys_port_id.
-
- 19 9月, 2017 4 次提交
-
-
由 Ján Tomko 提交于
Instead of checking for all possible constants that every kernel header with devlink support should have (and defining HAVE_DECL_DEVLINK as 1 if any of them is present due to the way AC_CHECK_DECLS works), only check for DEVLINK_CMD_ESWITCH_GET. This is the name of the constant since kernel 4.11. Between 4.8 and 4.11, the now deprecated spelling DEVLINK_CMD_ESWITCH_MODE_GET was used. Assume DEVLINK_ESWITCH_MODE_SWITCHDEV is available, since it was introduced along with the deprecated spelling.
-
由 Nikolay Shirokovskiy 提交于
We only need to zero-out bytes that will be written. May be we even don't need to zero-out at all because of immediate truncate.
-
由 Nikolay Shirokovskiy 提交于
Make alignment of last direct write more straightforward. Using additionally two flags 'end' and 'shortRead' looks complicated.
-
由 Nikolay Shirokovskiy 提交于
-
- 18 9月, 2017 1 次提交
-
-
由 Edan David 提交于
Adding functionality to libvirt that will allow querying the interface for the availability of switchdev Offloading NIC capabilities. The switchdev mode was introduced in kernel 4.8, the iproute2-devlink command to retrieve the switchdev NIC feature with command example: devlink dev eswitch show pci/0000:03:00.0 This feature is needed for Openstack so we can do a scheduling decision if the NIC is in Hardware Offload (switchdev) or regular SR-IOV (legacy) mode. And select the appropriate hypervisors with the requested capability see [1]. [1] - https://specs.openstack.org/openstack/nova-specs/specs/pike/approved/enable-sriov-nic-features.htmlReviewed-by: NLaine Stump <laine@laine.org> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 15 9月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
Some cleanup paths overwrite a usefull error message with a less useful one and we then try to preserve the original message. The handlers added in this patch will simplify the operations since they are designed right for the purpose.
-
- 12 9月, 2017 1 次提交
-
-
由 Guido Günther 提交于
-
- 07 9月, 2017 1 次提交
-
-
由 Stefan Berger 提交于
TPM 2 does not implement sysfs files for cancellation of commands. We therefore use /dev/null for the cancel path passed to QEMU. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Tested-by: NJavier Martinez Canillas <javierm@redhat.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 04 9月, 2017 1 次提交
-
-
由 Daniel P. Berrange 提交于
Although not previously explicitly documented, the expectation for the libvirt event loop is that an implementation is registered early in application startup, before calling any libvirt APIs and then run forever after. Replacing a previously registered event loop is not safe & subject to races even if virConnectClose has been called on open handles, due to delayed deregistration of callbacks during conenction close. Reviewed-by: NAndrea Bolognani <abologna@redhat.com> Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-