- 27 7月, 2016 4 次提交
-
-
由 Peter Krempa 提交于
http(s), ftp(s) and tftp use URIs for volume definitions in the JSON pseudo protocol so it's pretty straightforward to add support for them.
-
由 Peter Krempa 提交于
JSON pseudo protocol for qemu allows to explicitly specify devices. Add convertor to the internal type.
-
由 Peter Krempa 提交于
Add a modular parser that will allow to parse 'json' backing definitions that are supported by qemu. The initial implementation adds support for the 'file' driver. Due to the approach qemu took to implement the JSON backing strings it's possible to specify them in two approaches. The object approach: json:{ "file" : { "driver":"file", "filename":"/path/to/file" } } And a partially flattened approach: json:{"file.driver":"file" "file.filename":"/path/to/file" } Both of the above are supported by qemu and by the code added in this commit. The current implementation de-flattens the first level ('file.') if possible and required. Other handling may be added later but currently only one level was possible anyways.
-
由 Peter Krempa 提交于
As we already test that the extraction of the backing store string works well additional tests for the backing store string parser can be made simpler. Export virStorageSourceNewFromBackingAbsolute and use it to parse the backing store strings, format them using virDomainDiskSourceFormat and match them against expected XMLs.
-
- 25 6月, 2016 2 次提交
-
-
由 John Ferlan 提交于
Add the ability to detect a luks encrypted device. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
The version field historically has been a 4 byte data; however, an upcoming new type will use a 2 byte version. So let's adjust for that now. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 24 6月, 2016 3 次提交
-
-
由 John Ferlan 提交于
Add utility to format the virSecretLookupTypeDefPtr in XML Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Move to virsecret.c and rename to virSecretLookupParseSecret. Also convert to usage xmlNodePtr and virXMLPropString rather than virXPathString. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Move the enum into a new src/util/virsecret.h, rename it to be virSecretLookupType. Add a src/util/virsecret.h in order to perform a couple of simple operations on the secret XML and virSecretLookupTypeDef for clearing and copying. This includes quite a bit of collateral damage, but the goal is to remove the "virStorage*" and replace with the virSecretLookupType so that it's easier to to add new lookups that aren't necessarily storage pool related. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 13 5月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
Move some parts of virStorageFileRemoveLastPathComponent into a separate function so they can be reused. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 11 5月, 2016 1 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1318993 Commit id 'dd519a29' caused a regression cloning a volume into a logical pool by removing just the 'allocation' adjustment during storageVolCreateXMLFrom. Combined with the change to not require the new volume input XML to have a capacity listed (commit id 'e3f1d2a8') left the possibility that a zero allocation value (e.g., not provided) would create a thin/sparse logical volume. When a thin lv becomes fully populated, then LVM sets the partition 'inactive' and the subsequent fdatasync() fails. Add a new 'has_allocation' flag to be set at XML parse time to indicate that allocation was provided. This is done so that if it's not provided the create-from code uses the capacity value since we document that if omitted, the volume will be fully allocated at time of creation. For a logical backend, that creation time is 'createVol', while for a file backend, creation doesn't set the size, but the 'createRaw' called during buildVolFrom will decide whether the file is sparse or not based on the provided capacity and allocation value. For volume clones that provide different allocation and capacity values to allow for sparse files, there is no change.
-
- 09 5月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
For disks sources described by a libvirt volume we don't need to do a complicated check since virStorageTranslateDiskSourcePool already correctly determines the actual disk type. Replace the checks using a new accessor that does not open-code the whole logic.
-
- 15 4月, 2016 1 次提交
-
-
由 Olga Krishtal 提交于
Refreshes meta-information such as allocation, capacity, format, etc. Ploop volumes differ from other volume types. Path to volume is the path to directory with image file root.hds and DiskDescriptor.xml. https://openvz.org/Ploop/format Due to this fact, operations of opening the volume have to be done once again. get the information. To decide whether the given volume is ploops one, it is necessary to check the presence of root.hds and DiskDescriptor.xml files in volumes' directory. Only in this case the volume can be manipulated as the ploops one. Such strategy helps us to resolve problems that might occure, when we upload some other volume type from ploop source. Signed-off-by: NOlga Krishtal <okrishtal@virtuozzo.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 15 2月, 2016 1 次提交
-
-
由 Ján Tomko 提交于
Replace all occurrences of VMWare outside the news.
-
- 10 2月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
The virStringListLength function does not ever modify the passed string list. It merely counts the items in it. Make sure that we reflect this bit in the function header. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> (crobinso: fix up spacing and squash in sheepdog bit suggested by Andrea)
-
- 06 1月, 2016 1 次提交
-
-
由 Wido den Hollander 提交于
If no port number was provided for a storage pool libvirt defaults to port 6789; however, librbd/librados already default to 6789 when no port number is provided. In the future Ceph will switch to a new port for the Ceph monitors since port 6789 is already assigned to a different application by IANA. Port 6789 is assigned to SMC-HTTPS and Ceph now has port 3300 assigned as the 'Ceph monitor' port. In this case it is the best solution to not hardcode any port number into libvirt and let librados handle the connection. Only if a user specifies a different port number we pass it down to librados, otherwise we leave it blank. Signed-off-by: NWido den Hollander <wido@widodh.nl> merge
-
- 07 8月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
Qemu reports physical size 0 for block devices. As 15fa84ac changed the behavior of qemuDomainGetBlockInfo to just query the monitor this created a regression since we didn't report the size correctly any more. This patch adds code to refresh the physical size of a block device by opening it and seeking to the end and uses it both in qemuDomainGetBlockInfo and also in qemuDomainGetStatsOneBlock that was broken since it was introduced in this respect. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1250982
-
- 27 4月, 2015 1 次提交
-
-
由 zhang bo 提交于
snapshot and configFile are not freed, free them. Signed-off-by: NZhang Bo <oscar.zhangbo@huawei.com>
-
- 22 4月, 2015 3 次提交
-
-
由 Peter Krempa 提交于
When a user would specify a backing chain index that is above the start point libvirt would report a rather unhelpful error: invalid argument: could not find backing store 1 in chain for 'sub/link2' This patch adds an explicit check that the index is below start point in the backing store and reports the following error if not: invalid argument: requested backing store index 1 is above 'sub/../qcow2' in chain for 'sub/link2' Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1177062
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
Some storage protocols allow to have the @path field in struct virStorageSource set to NULL. Add NULLSTR() wrappers to handle this possibility until I finish the storage source error formatter.
-
- 13 4月, 2015 1 次提交
-
-
由 Ján Tomko 提交于
For future reuse in the snapshot XML.
-
- 18 3月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
If the storage device type is parsed as network our parser still allows it to omit the <source> element. The empty drive check would not trigger on such device as it expects that every network storage source is valid. Use VIR_STORAGE_NET_PROTOCOL_NONE as a marker that the storage source is empty.
-
- 26 2月, 2015 2 次提交
-
-
由 Peter Krempa 提交于
The gluster volume name extraction code was copied from the XML parser without changing the VIR_ERR_XML_ERROR error code. Use VIR_ERR_CONFIG_UNSUPPORTED instead.
-
由 Peter Krempa 提交于
Similar to commit fdb80ed4 libvirtd would crash if a gluster URI without path would be used in the backing chain of a volume. The crash happens in the gluster specific part of the parser that extracts the gluster volume name from the path. Fix the crash by checking that the PATH is NULL. This patch does not contain a test case as it's not possible to test it with the current infrastructure as the test suite would attempt to contact the gluster server in the URI. I'm working on the test suite addition but that will be post-release material. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1196528
-
- 25 2月, 2015 1 次提交
-
-
由 Ján Tomko 提交于
Do not use relPath, it has not been filled by virStorageFileMetadataNew.
-
- 04 2月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
If a storage file would be backed with a NBD device without path (nbd://localhost) libvirt would crash when parsing the backing path for the disk as the URI structure's path element is NULL in such case but the NBD parser would access it shamelessly.
-
- 26 1月, 2015 1 次提交
-
-
由 Ján Tomko 提交于
After the 8-byte size header, there are two one-byte headers and two bytes of padding before the crypt_header field. Our QCOW1_HDR_CRYPT constant did not skip the padding. http://git.qemu.org/?p=qemu.git;a=blob;f=block/qcow.c;h=ece22697#l41 https://bugzilla.redhat.com/show_bug.cgi?id=1185165
-
- 09 1月, 2015 1 次提交
-
-
由 Ján Tomko 提交于
Remove the resize flag and use the same code path for all callers. This flag was added by commit 18f03166 to allow virStorageFileResize use 'safezero' while preserving the behavior. Explicitly return -2 when a fallback to a different method should be done, to make the code path more obvious. Fail immediately when ftruncate fails in the mmap method, as we did before commit 18f03166.
-
- 17 12月, 2014 2 次提交
-
-
由 Eric Blake 提交于
Right now, grabbing blockinfo always calls stat on the disk, then opens the image to determine the capacity, using a throw-away virStorageSourcePtr. This has a couple of drawbacks: 1. We are calling stat and opening a file on every invocation of the API. However, there are cases where the stats should NOT be changing between successive calls (if a domain is running, no one should be changing the physical size of a block device or raw image behind our backs; capacity of read-only files should not be changing; and we are the gateway to the block-resize command to know when the capacity of read-write files should be changing). True, we still have to use stat in some cases (a sparse raw file changes allocation if it is read-write and the amount of holes is changing, and a read-write qcow2 image stored in a file changes physical size if it was not fully pre-allocated). But for read-only images, even this should be something we can remember from the previous time, rather than repeating every call. 2. We want to enhance the power of virDomainListGetStats, by sharing code. But we already have a virStorageSourcePtr for each disk, and it would be easier to reuse the common structure than to have to worry about the one-off virDomainBlockInfoPtr. While this patch does not optimize reuse of information in point 1, it does get us closer to being able to do so; by updating a structure that survives between consecutive calls. * src/util/virstoragefile.h (_virStorageSource): Add physical, to mirror virDomainBlockInfo; rearrange fields to match public struct. (virStorageSourceCopy): Copy the new field. * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Store into storage source, then copy to block info. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 John Ferlan 提交于
Currently virStorageFileResize() function uses build conditionals to choose either the posix_fallocate() or syscall(SYS_fallocate) with no fallback in order to preallocate the space in the newly resized file. Since the safezero code has a similar set of conditionals modify the resize and safezero code in order to allow the resize logic to make use of safezero to unify the look/feel of the code paths. Add a new boolean (resize) to safezero() to make the optional decision whether to try syscall(SYS_fallocate) if the posix_fallocate fails because HAVE_POSIX_FALLOCATE is not defined (eg, return -1 and errno == 0). Create a local safezero_sys_fallocate in order to handle the resize code paths that support that. If not present, the set errno = ENOSYS in order to allow the caller to handle the failure scenarios. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 21 11月, 2014 7 次提交
-
-
由 Peter Krempa 提交于
To be able to express some use cases of the RBD backing with libvirt, we need to be able to specify a config file for the RBD client to qemu as that is one of the commonly used options.
-
由 Peter Krempa 提交于
Some storage systems have internal support for snapshots. Libvirt should be able to select a correct snapshot when starting a VM. This patch adds a XML element to select a storage source snapshot for the RBD protocol which supports this feature.
-
由 Peter Krempa 提交于
As we now have a common function to parse backing store string for RBD backing store we can reuse it in the backing store walker so that we don't fail on files backed by RBD storage. This patch also adds a few tests to verify that the parsing works as expected.
-
由 Peter Krempa 提交于
Split out the code so that the function looks homogenous after adding more protocol specific parsers.
-
由 Peter Krempa 提交于
To allow reuse this non-trivial parser code in the backing store parser this part of the command line parser needs to be split out into a separate funciton.
-
由 Peter Krempa 提交于
If there are no hosts for a storage source virStorageSourceCopy and virStorageSourceNewFromBackingRelative would try to copy them anyways. As the success of virStorageNetHostDefCopy is determined by returning a pointer and malloc of 0 elements might return NULL according to the implementation, the result of the copy function may vary. Fix this by copying the hosts array only if there are hosts defined.
-
由 Peter Krempa 提交于
When creating a disk image snapshot the libvirt code would blindly copy the parents label to the newly created image. This runs into problems when you start a VM from an image hosted on NFS (or other storage system that doesn't support selinux labels) and the snapshot destination is on a storage system that does support selinux labels. Libvirt's code in that case generates a different security label for the image hosted on NFS. This label is valid only for NFS images and doesn't allow access in case of a locally stored image. To fix this issue libvirt needs to refrain from copying security information in cases where the default domain seclabel is a better choice. This patch repurposes the now unused @force argument of virStorageSourceInitChainElement to denote whether a copy of the security labelling stuff should be attempted or not. This allows to fine-control the copy operation for cases where we need to keep the label of the old disk vs. the cases where we need to keep the label unset to use the default domain imagelabel. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1151718
-
- 15 11月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 30 10月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
The code that parses the schema from the URI touches the "hosts[0]" member of the storage file source structure in case the URI contains a schema. The hosts array was not yet allocated at the point in the code where the transport protocol was parsed and set. This lead to a crash of libvirtd. Fix the code by allocating the "hosts" array upfront and add a test case to verify this scenario. (Unfortunately this requires shuffling the test case numbers too). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1156288
-