- 19 1月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
The file became a garbage dump for all kinds of utility functions over time. Move them to a separate file so that the files can become a clean interface for the storage backends.
-
- 13 1月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
The check is pointless since LVM is capable to detect it's own members and the check is flawed as it would fail if neither libblkid nor parted is installed. We don't really need to babysit LVM in this way. This reverts commit cb38b6cb.
-
- 10 1月, 2017 4 次提交
-
-
由 John Ferlan 提交于
At startup time, rather than blindly trusting the target devices are still properly formatted, let's check to make sure the pool's target devices are all properly formatted before attempting to start the pool. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1373711 Add support and documentation for the [NO_]OVERWRITE flags for the logical backend. Update virsh.pod with a description of the process for usage of the flags and building of the pool's volume group. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Make the remaining code a bit cleaner. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
If the build fails, then we need to ensure that we've run pvremove on any devices which we've run pvcreate on; otherwise, a subsequent build could fail since running pvcreate twice on a device requires special force arguments. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 18 5月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Rather than have virCommandRun just spit out the error, allow callers to decide to pass the exitstatus so the caller can make intelligent decisions based on the error.
-
- 27 3月, 2016 1 次提交
-
-
由 Roman Bogorodskiy 提交于
This reverts commit 6682d621. The "if (vol->target.format != VIR_STORAGE_FILE_RAW)" check in the createVol backend. This check is bogus because virStorageVolDefParseXML() in conf/storage_conf.c sets target.format only if volOptions in virStoragePoolTypeInfo has formatFromString set, and that's not the case the logical backend. So the check always fails and breaks volume creation.
-
- 21 3月, 2016 2 次提交
-
-
由 Richard Laager 提交于
-
由 Richard Laager 提交于
This improves the code consistency around freeing vol->target.path in createVol implementations.
-
- 03 3月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
While trying to build with -Os couple of compile errors showed up. conf/domain_conf.c: In function 'virDomainChrRemove': conf/domain_conf.c:13666:24: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] virDomainChrDefPtr ret, **arrPtr = NULL; ^ Compiler fails to see that @ret is used only if set in the loop, but whatever, there's no harm in initializing the variable. In vboxAttachDrivesNew and _vboxAttachDrivesOld compiler thinks that @rc may be used uninitialized. Well, not directly, but maybe after some optimization. Yet again, no harm in initializing a variable. In file included from ./util/virthread.h:26:0, from ./datatypes.h:28, from vbox/vbox_tmpl.c:43, from vbox/vbox_V3_1.c:37: vbox/vbox_tmpl.c: In function '_vboxAttachDrivesOld': ./util/virerror.h:181:5: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ ^ In file included from vbox/vbox_V3_1.c:37:0: vbox/vbox_tmpl.c:1041:14: note: 'rc' was declared here nsresult rc; ^ Yet again, one uninitialized variable: qemu/qemu_driver.c: In function 'qemuDomainBlockCommit': qemu/qemu_driver.c:17194:9: error: 'baseSource' may be used uninitialized in this function [-Werror=maybe-uninitialized] qemuDomainPrepareDiskChainElement(driver, vm, baseSource, ^ And another one: storage/storage_backend_logical.c: In function 'virStorageBackendLogicalMatchPoolSource.isra.2': storage/storage_backend_logical.c:618:33: error: 'thisSource' may be used uninitialized in this function [-Werror=maybe-uninitialized] thisSource->devices[j].path)) ^ Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 26 2月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Generates a false positive for Coverity, but it turns out there's no need to check ret == -1 since if VIR_APPEND_ELEMENT is successful, the local vol pointer is cleared anyway. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 11 2月, 2016 1 次提交
-
-
由 Ján Tomko 提交于
Using strcat directly is more readable than passing strlen of the copied string to strncat.
-
- 04 2月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Rather than have a unwieldy regex string - split it up into its components each having it's own #define and then combine in a different #define Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 03 2月, 2016 3 次提交
-
-
由 John Ferlan 提交于
Rather than a loop reallocating space to build the regex, just allocate it once up front, then if there's more than 1 nextent, append a comma and another regex_unit string. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
The 'stripes' value is described as the "Number of stripes or mirrors in a logical volume". So add "mirror" and anything that starts with "raid" to the list of segtypes that can have an 'nextents' value greater than one. Use of raid segtypes (raid1, raid4, raid5*, raid6*, and raid10) is favored over mirror in more recent lvm code. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rather than preallocating a set number of elements, then walking through the extents and adjusting the specific element in place, use the APPEND macros to handle that chore. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 30 1月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Create a helper routine in order to parse any extents information including the extent size, length, and the device string contained within the generated 'lvs' output string. A future patch would then be able to avoid the code more cleanly Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 29 1月, 2016 1 次提交
-
-
由 John Ferlan 提交于
When commit id '82c1740a' made changes to the output format (changing from using a ',' separator to '#'), the examples in the lvs output from the comments weren't changed. Additionally, the two new fields added ('segtype' and 'stripes') were not included in the output, leaving it well confusing. This patch fixes the sample output, adds a 'striped' example, and makes other comment related adjustments for long line and spacing between followup 'NB' remarks (while I'm there). Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 17 12月, 2015 1 次提交
-
-
由 John Ferlan 提交于
Commit id '71b803ac' assumed that the storage pool source device path was required for a 'logical' pool. This resulted in a failure to start a pool without any device path defined. So, adjust the virStorageBackendLogicalMatchPoolSource logic to return success if at least the pool name matches the vgs output when no pool source device path is/are provided.
-
- 16 12月, 2015 2 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1025230 Add a new helper virStorageBackendLogicalMatchPoolSource to compare the pool's source name against the output from a 'pvs' command to list all volume group physical volume data on the host. In addition, compare the pool's source device list against the particular volume group's device list to ensure the source device(s) listed for the pool match what the was listed for the volume group. Then for pool startup or check API's we need to call this new API in order to ensure that the pool we're about to start or declare active during checkPool has a valid definition vs. the running host.
-
由 John Ferlan 提交于
Rework virStorageBackendLogicalFindPoolSources a bit to create a helper virStorageBackendLogicalGetPoolSources that will make the pvs call in order to generate a list of associated pv_name and vg_name's. A future patch will make use of this for start/check processing to ensure the storage pool source definition matches expectations.
-
- 10 12月, 2015 1 次提交
-
-
由 John Ferlan 提交于
Similar to the openflags which allow VIR_STORAGE_VOL_OPEN_NOERROR to be passed to avoid open errors, add a 'readflags' variable so that in the future read failures could also be ignored.
-
- 21 10月, 2015 1 次提交
-
-
由 Ishmanpreet Kaur Khera 提交于
We have macros for both positive and negative string matching. Therefore there is no need to use !STREQ or !STRNEQ. At the same time as we are dropping this, new syntax-check rule is introduced to make sure we won't introduce it again. Signed-off-by: NIshmanpreet Kaur Khera <khera.ishman@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 14 10月, 2015 1 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1233003 Track when the logical volume was successfully created in order to properly handle the call to virStorageBackendLogicalDeleteVol. It's possible that the failure to create was because someone created an LV in the pool outside of libvirt's knowledge. In this case, we don't want to delete that LV. A subsequent or future refresh of the pool will find the volume and cause an earlier failure Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 10 6月, 2015 1 次提交
-
-
由 John Ferlan 提交于
-
- 26 5月, 2015 1 次提交
-
-
由 Cole Robinson 提交于
The XML parser sets a default <mode> if none is explicitly passed in. This is then used at pool/vol creation time, and unconditionally reported in the XML. The problem with this approach is that it's impossible for other code to determine if the user explicitly requested a storage mode. There are some cases where we want to make this distinction, but we currently can't. Handle <mode> parsing like we handle <owner>/<group>: if no value is passed in, set it to -1, and adjust the internal consumers to handle it.
-
- 02 4月, 2015 1 次提交
-
-
由 Erik Skultety 提交于
In order to be able to use 'checkPool' inside functions which do not have any connection reference, 'conn' attribute needs to be discarded from the checkPool's signature, since it's not used by any storage backend anyway.
-
- 02 3月, 2015 1 次提交
-
- 17 12月, 2014 1 次提交
-
-
由 John Ferlan 提交于
A recent lvm change has resulted in a change for the "default" type of logical volume created when the "--virtualsize" or "--V" is supplied on the command line (e.g. when the allocation and capacity values of a to be created volume differ). It seems that at the very least the following change adjusts the default type: https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=e0164f21 and the following may also have some impact. https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=87fc3b71 When using the virsh vol-create-as or vol-create xmlfile commands, the result is that libvirt will now create a "thin logical volume" and a "thin logical volume pool" rather than just a "thin snapshot logical volume". For example the following sequence: # lvcreate --name test -L 2M -V 5M lvm_test Rounding up size to full physical extent 4.00 MiB Rounding up size to full physical extent 8.00 MiB Logical volume "test" created. # lvs lvm_test LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert lvol1 lvm_test twi-a-tz-- 4.00m 0.00 0.98 test lvm_test Vwi-a-tz-- 8.00m lvol1 0.00 compared to the former code which had the following: LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert test LVM_Test swi-a-s--- 4.00m [test_vorigin] 0.00 Since libvirt doesn't know how to parse the thin logical volume and pool, it will fail to find the newly created volume and pool even though it exists in the volume group. It cannot find since the command used to find/parse returns a thin volume 'test' with no associated device, for example the output is: lvol1##UgUwkp-fTFP-C0rc-ufue-xrYh-dkPr-FGPFPx#lvol1_tdata(0)#thin-pool#1#4194304#4194304#4194304#twi-a-tz-- test##NcaIoH-4YWJ-QKu3-sJc3-EOcS-goff-cThLIL##thin#0#8388608#4194304#8388608#Vwi-a-tz-- as compared to the former which had the following: test#[test_vorigin]#Dt5Of3-4WE6-buvw-CWJ4-XOiz-ywOU-YULYw6#/dev/sda3(1300)#linear#1#4194304#4194304#4194304#swi-a-s--- While it's possible to generate code to handle the new thin lv and pool, this patch will add a "--type snapshot" onto the lvcreate command libvirt uses in order to "for now" be able to continue to utilize the thin snapshots
-
- 22 7月, 2014 1 次提交
-
-
由 Roman Bogorodskiy 提交于
virStorageBackendLogicalCreateVol contains a piece like: if (vol->target.path != NULL) { /* A target path passed to CreateVol has no meaning */ VIR_FREE(vol->target.path); } The 'if' is useless here, but 'syntax-check' doesn't catch that because of the comment, so drop the 'if'.
-
- 18 7月, 2014 1 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1091866 Add a new boolean 'sparse'. This will be used by the logical backend storage driver to determine whether the target volume is sparse or not (also known by a snapshot or thin logical volume). Although setting sparse to true at creation could be seen as duplicitous to setting during virStorageBackendLogicalMakeVol() in case there are ever other code paths between Create and FindLVs that need to know about the volume be sparse. Use the 'sparse' in a new virStorageBackendLogicalVolWipe() to decide whether to attempt to wipe the logical volume or not. For now, I have found no means to wipe the volume without writing to it. Writing to the sparse volume causes it to be filled. A sparse logical volume is not completely writeable as there exists metadata which if overwritten will cause the sparse lv to go INACTIVE which means pool-refresh will not find it. Access to whatever lvm uses to manage data blocks is not provided by any API I could find.
-
- 17 7月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
For non-local storage drivers we can't expect to use the "scrub" tool to wipe the volume. Split the code into a separate backend function so that we can add protocol specific code later. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1118710
-
- 16 7月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
As we have a nested pointer for storing the backing store of a volume there's no need to store it in a separate struct.
-
- 11 7月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
For non-local storage drivers we can't expect to use the FDStream backend for up/downloading volumes. Split the code into a separate backend function so that we can add protocol specific code later.
-
- 02 5月, 2014 1 次提交
-
-
由 John Ferlan 提交于
Commit id 'ac9a0963' refactored out the 'withCapacity' for the virStorageBackendUpdateVolInfo() API. See: http://www.redhat.com/archives/libvir-list/2014-April/msg00043.html This resulted in a difference in how 'virsh vol-info --pool <poolName> <volume>' or 'virsh vol-list vol-list --pool <poolName> --details' outputs the capacity information for a directory pool with a qcow2 sparse file. For example, using the following XML mkdir /home/TestPool cat testpool.xml <pool type='dir'> <name>TestPool</name> <uuid>6bf80895-10b6-75a6-6059-89fdea2aefb7</uuid> <source> </source> <target> <path>/home/TestPool</path> <permissions> <mode>0755</mode> <owner>0</owner> <group>0</group> </permissions> </target> </pool> virsh pool-create testpool.xml virsh vol-create-as --pool TestPool temp_vol_1 \ --capacity 1048576 --allocation 1048576 --format qcow2 virsh vol-info --pool TestPool temp_vol_1 Results in listing a Capacity value. Prior to the commit, the value would be '1.0 MiB' (1048576 bytes). However, after the commit the output would be (for example) '192.50 KiB', which for my system was the size of the volume in my file system (eg 'ls -l TestPool/temp_vol_1' results in '197120' bytes or 192.50 KiB). While perhaps technically correct, it's not necessarily what the user expected (certainly virt-test didn't expect it). This patch restores the code to not update the target capacity for this path
-
- 02 4月, 2014 3 次提交
-
-
由 Eric Blake 提交于
Now that each virStorageSource can track allocation information, and given that we already have the information without extra syscalls, it's easier to just always populate the information directly into the struct than it is to sometimes pass the address of the struct members down the call chain. * src/storage/storage_backend.h (virStorageBackendUpdateVolInfo) (virStorageBackendUpdateVolTargetInfo) (virStorageBackendUpdateVolTargetInfoFD): Update signature. * src/storage/storage_backend.c (virStorageBackendUpdateVolInfo) (virStorageBackendUpdateVolTargetInfo) (virStorageBackendUpdateVolTargetInfoFD): Always populate struct members instead. * src/storage/storage_backend_disk.c (virStorageBackendDiskMakeDataVol): Update client. * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget) (virStorageBackendFileSystemRefresh) (virStorageBackendFileSystemVolRefresh): Likewise. * src/storage/storage_backend_gluster.c (virStorageBackendGlusterRefreshVol): Likewise. * src/storage/storage_backend_logical.c (virStorageBackendLogicalMakeVol): Likewise. * src/storage/storage_backend_mpath.c (virStorageBackendMpathNewVol): Likewise. * src/storage/storage_backend_scsi.c (virStorageBackendSCSINewLun): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
One of the features of qcow2 is that a wrapper file can have more capacity than its backing file from the guest's perspective; what's more, sparse files make tracking allocation of both the active and backing file worthwhile. As such, it makes more sense to show allocation numbers for each file in a chain, and not just the top-level file. This sets up the fields for the tracking, although it does not modify XML to display any new information. * src/util/virstoragefile.h (_virStorageSource): Add fields. * src/conf/storage_conf.h (_virStorageVolDef): Drop redundant fields. * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom) (createRawFile, virStorageBackendCreateQemuImgCmd) (virStorageBackendCreateQcowCreate): Update clients. * src/storage/storage_driver.c (storageVolDelete) (storageVolCreateXML, storageVolCreateXMLFrom, storageVolResize) (storageVolWipeInternal, storageVolGetInfo): Likewise. * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget) (virStorageBackendFileSystemRefresh) (virStorageBackendFileSystemVolResize) (virStorageBackendFileSystemVolRefresh): Likewise. * src/storage/storage_backend_logical.c (virStorageBackendLogicalMakeVol) (virStorageBackendLogicalCreateVol): Likewise. * src/storage/storage_backend_scsi.c (virStorageBackendSCSINewLun): Likewise. * src/storage/storage_backend_mpath.c (virStorageBackendMpathNewVol): Likewise. * src/storage/storage_backend_rbd.c (volStorageBackendRBDRefreshVolInfo) (virStorageBackendRBDCreateImage): Likewise. * src/storage/storage_backend_disk.c (virStorageBackendDiskMakeDataVol) (virStorageBackendDiskCreateVol): Likewise. * src/storage/storage_backend_sheepdog.c (virStorageBackendSheepdogBuildVol) (virStorageBackendSheepdogParseVdiList): Likewise. * src/storage/storage_backend_gluster.c (virStorageBackendGlusterRefreshVol): Likewise. * src/conf/storage_conf.c (virStorageVolDefFormat) (virStorageVolDefParseXML): Likewise. * src/test/test_driver.c (testOpenVolumesForPool) (testStorageVolCreateXML, testStorageVolCreateXMLFrom) (testStorageVolDelete, testStorageVolGetInfo): Likewise. * src/esx/esx_storage_backend_iscsi.c (esxStorageVolGetXMLDesc): Likewise. * src/esx/esx_storage_backend_vmfs.c (esxStorageVolGetXMLDesc) (esxStorageVolCreateXML): Likewise. * src/parallels/parallels_driver.c (parallelsAddHddByVolume): Likewise. * src/parallels/parallels_storage.c (parallelsDiskDescParseNode) (parallelsStorageVolDefineXML, parallelsStorageVolCreateXMLFrom) (parallelsStorageVolDefRemove, parallelsStorageVolGetInfo): Likewise. * src/vbox/vbox_tmpl.c (vboxStorageVolCreateXML) (vboxStorageVolGetXMLDesc): Likewise. * tests/storagebackendsheepdogtest.c (test_vdi_list_parser): Likewise. * src/phyp/phyp_driver.c (phypStorageVolCreateXML): Likewise.
-
由 Eric Blake 提交于
Some preparatory work before consolidating storage volume structs with the rest of virstoragefile. Making these changes allows a volume target to be much closer to (a subset of) the virStorageSource struct. Making perms be a pointer allows it to be optional if we have a storage pool that doesn't expose permissions in a way we can access. It also allows future patches to optionally expose permissions details learned about a disk image via domain <disk> listings, rather than just limiting it to storage volume listings. Disk partition types was only used by internal code to control what type of partition to create when carving up an MS-DOS partition table storage pool (and is not used for GPT partition tables or other storage pools). It was not exposed in volume XML, and as it is more closely related to extent information of the overall block device than it is to the <target> information describing the host file. Besides, if we ever decide to expose it in XML down the road, we can move it back as needed. * src/conf/storage_conf.h (_virStorageVolTarget): Change perms to pointer, enhance comments. Move partition type... (_virStorageVolSource): ...here. * src/conf/storage_conf.c (virStorageVolDefFree) (virStorageVolDefParseXML, virStorageVolTargetDefFormat): Update clients. * src/storage/storage_backend_fs.c (createFileDir): Likewise. * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom) (virStorageBackendCreateRaw, virStorageBackendCreateExecCommand) (virStorageBackendUpdateVolTargetInfoFD): Likewise. * src/storage/storage_backend_logical.c (virStorageBackendLogicalCreateVol): Likewise. * src/storage/storage_backend_disk.c (virStorageBackendDiskMakeDataVol) (virStorageBackendDiskPartTypeToCreate): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 01 4月, 2014 1 次提交
-
-
由 Cole Robinson 提交于
Remove the original VolOpen implementation, which is now only used in one spot.
-