- 19 1月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
The storage driver helper functions that deal with parted were put into the disk backend code but are used commonly across.
-
- 18 1月, 2017 6 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1346566 If libvirt_parthelper is erroneously told to append the partition separator 'p' onto the generated output for a disk pool using device mapper that has 'user_friendly_names' set to true, then the error recovery path will fail to find volume resulting in the pool being in an unusable state. So, augment the documentation to provide the better hint that the part_separator='yes' should be set when user_friendly_names are not being used. Additionally, once we're in the error path where the returned name doesn't match the expected partition name try to see if the reason is because the 'p' was erroneosly added. If so alter the about to be removed vol->target.path so that the DiskDeleteVol code can find the partition that was created and remove it.
-
由 John Ferlan 提交于
If the voldef type is VIR_STORAGE_VOL_BLOCK, then as long as the format is known, let's allow the probe to happen - gets a truer value and the same probe/update would be allowed for the same volume defined in a domain.
-
由 John Ferlan 提交于
For volume processing in virStorageBackendUpdateVolTargetInfo to get the capacity commit id 'a760ba3a' added the ability to probe a volume that didn't list a target format. Unfortunately, the code used the virStorageSource (e.g. target->type - virStorageType) rather than virStorageVolDef (e.g. vol->type - virStorageVolType) in order to make the comparison. As it turns out target->type for a volume is not filled in at all for a voldef as the code relies on vol->type. Ironically the result is that only VIR_STORAGE_VOL_BLOCK's would get their capacity updated. This patch will adjust the code to check the "vol->type" field instead as an argument. This way for a voldef, the correct comparison is made. Additionally for a backingStore, the 'type' field is never filled in; however, since we know that the provided path is a location at which the backing store can be accessed on the local filesystem thus just pass VIR_STORAGE_VOL_FILE in order to satisfy the adjusted voltype check. Whether it's a FILE or a BLOCK only matters if we're trying to get more data based on the target->format.
-
由 Peter Krempa 提交于
The tool is used for pool discovery. Since we call an external binary we don't really need to compile out the code that uses it. We can check whether it exists at runtime.
-
由 Peter Krempa 提交于
Similarly to the 'netfs' pool, return an error if the host does not have any volumes.
-
由 Peter Krempa 提交于
In commit 4090e153 we went back from reporting no errors if no storage pools were found on a given host to reporting a bad error. And only in cases when gluster was not installed. Report a less bad error in case there are no volumes. Also report the error when gluster is installed but no volumes were found, since virStorageBackendFindGlusterPoolSources would return success in that case.
-
- 14 1月, 2017 3 次提交
-
-
由 John Ferlan 提交于
For case VIR_STORAGE_BLKID_PROBE_DIFFERENT, clean up the message to avoid using the virsh like --overwrite syntax. Additionally provide a different error message when not writing the label to avoid confusion.
-
由 John Ferlan 提交于
Rather than special casing the VIR_STORAGE_BLKID_PROBE_UNKNOWN after calling virStorageBackendBLKIDFindPart, just allow the switch statement handle setting ret = -2.
-
由 John Ferlan 提交于
If neither BLKID or PARTED is available and we're not writing, then just return 0 which allows the underlying storage pool to generate a failure. If both are unavailable and we're writing, then generate a more generic error message.
-
- 13 1月, 2017 2 次提交
-
-
由 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.
-
由 Peter Krempa 提交于
The check does not work properly (crashes) with netfs filesystems and also checking that a device is not empty when attempting to mount a filesystem is not very usefull since the mount will fail anyways. As the code would improve only a very minor corner case I don't really see a reason to have this code at all. This code would also fail if libvirt is compiled without support for blkid and without parted. This reverts commit a11fd697.
-
- 10 1月, 2017 13 次提交
-
-
由 John Ferlan 提交于
Commit id 'a48c674f' caused problems for systems without PARTED installed. So move the PARTED probing code back to storage_backend_disk.c and create a shim within storage_backend.c to call it if WITH_STORAGE_DISK is true; otherwise, just return -1 with the error.
-
由 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>
-
由 John Ferlan 提交于
Currently as long as the disk is formatted using a known parted format type, the algorithm is happy to continue. However, that leaves a scenario whereby a disk formatted using "pc98" could be used by a pool that's defined using "dvh" (or vice versa). Alter the check to be match and different and adjust the caller. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rather than have the Disk code having to use PARTED to determine if there's something on the device, let's use the virStorageBackendDeviceProbe. and only fallback to the PARTED probing if the BLKID code isn't built in. This will also provide a mechanism for the other current caller (File System Backend) to utilize a PARTED parsing algorithm in the event that BLKID isn't built in to at least see if *something* exists on the disk before blindly trying to use. The PARTED error checking will not find file system types, but if there is a partition table set on the device, it will at least cause a failure. Move virStorageBackendDiskValidLabel and virStorageBackendDiskFindLabel to storage_backend and rename/rework the code to fit the new model. Update the virsh.pod description to provide a more generic description of the process since we could now use either blkid or parted to find data on the target device. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Prior to starting up, let's be sure the target volume device is formatted as we expect; otherwise, inhibit the start. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
It's possible that the API could be called from a startup path in order to check whether the label on the device matches what our format is. In order to handle that condition, add a 'writelabel' boolean to the API in order to indicate whether a write or just read is about to happen. This alters two "error" conditions that would care about knowing. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
A device may be formatted using some sort of disk partition format type. We can check that using the blkid_ API's as well - so alter the logic to allow checking the device for both a filesystem and a disk partition. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1363586 Commit id '27758859' introduced the "NO_OVERWRITE" flag check for file system backends; however, the implementation, documentation, and algorithm was inconsistent. For the "flag" description for the API the flag was described as "Do not overwrite existing pool"; however, within the storage backend code the flag is described as "it probes to determine if filesystem already exists on the target device, renurning an error if exists". The code itself was implemented using the paradigm to set up the superblock probe by creating a filter that would cause the code to only search for the provided format type. If that type wasn't found, then the algorithm would return success allowing the caller to format the device. If the format type already existed on the device, then the code would fail indicating that the a filesystem of the same type existed on the device. The result is that if someone had a file system of one type on the device, it was possible to overwrite it if a different format type was specified in updated XML effectively trashing whatever was on the device already. This patch alters what NO_OVERWRITE does for a file system backend to be more realistic and consistent with what should be expected when the caller requests to not overwrite the data on the disk. Rather than filter results based on the expected format type, the code will allow success/failure be determined solely on whether the blkid_do_probe calls finds some known format on the device. This adjustment also allows removal of the virStoragePoolProbeResult enum that was under utilized. If it does find a formatted file system different errors will be generated indicating a file system of a specific type already exists or a file system of some other type already exists. In the original virsh support commit id 'ddcd5674', the description for '--no-overwrite' within the 'pool-build' command help output has an ambiguous "of this type" included in the short description. Compared to the longer description within the "Build a given pool." section of the virsh.pod file it's more apparent that the meaning of this flag would cause failure if a probe of the target already has a filesystem. So this patch also modifies the short description to just be the antecedent of the 'overwrite' flag, which matches the API description. This patch also modifies the grammar in virsh.pod for no-overwrite as well as reworking the paragraph formats to make it easier to read. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rename virStorageBackendFileSystemProbe and to virStorageBackendBLKIDFindFS and move to the more common storage_backend module. Create a shim virStorageBackendDeviceIsEmpty which will make the call to the virStorageBackendBLKIDFindFS and check the return value. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Michal Privoznik 提交于
The code at the very bottom of the DAC secdriver that calls chown() should be fine with read-only data. If something needs to be prepared it should have been done beforehand. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 09 1月, 2017 1 次提交
-
-
由 Daniel P. Berrange 提交于
The public virSecret object has a single "usage_id" field but the virSecretDef object has a different 'char *' field for each usage type, but the code all assumes every usage type has a corresponding single string. Get rid of the pointless union in virSecretDef and just use "usage_id" everywhere. This doesn't impact public XML format, only the internal handling. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 07 1月, 2017 1 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1349696 As it turns out using only the 'parent' to achieve the goal of a consistent vHBA parent has issues with reboots where the scsi_hostX parent could change to scsi_hostY causing either failure to create the vHBA or usage of the wrong HBA for our vHBA. Thus add the ability to search for the "parent" by the parent wwnn/ wwpn values or just a fabric_name if someone only cares to ensure usage of the same SAN for the vHBA.
-
- 05 1月, 2017 3 次提交
-
-
由 John Ferlan 提交于
Remove duplicated code - make one simple path through Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Move the check for an already existing vHBA to the top of the function. No sense in first decoding a provided parent if the next thing we're going to do is fail if a provided wwnn/wwpn already exists. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Use the ret = -1, goto cleanup, etc. rather than current hodgepodge. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 21 12月, 2016 1 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1332019 This function will essentially be a wrapper to virStorageVolInfo in order to provide a mechanism to have the "physical" size of the volume returned instead of the "allocation" size. This will provide similar capabilities to the virDomainBlockInfo which can return both allocation and physical of a domain storage volume. NB: Since we're reusing the _virStorageVolInfo and not creating a new _virStorageVolInfoFlags structure, we'll need to generate the rpc APIs remoteStorageVolGetInfoFlags and remoteDispatchStorageVolGetInfoFlags (although both were originally created from gendispatch.pl and then just copied into daemon/remote.c and src/remote/remote_driver.c). The new API will allow the usage of a VIR_STORAGE_VOL_GET_PHYSICAL flag and will make the decision to return the physical or allocation value into the allocation field. In order to get that physical value, virStorageBackendUpdateVolTargetInfoFD adds logic to fill in physical value matching logic in qemuStorageLimitsRefresh used by virDomainBlockInfo when the domain is inactive. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 13 12月, 2016 2 次提交
-
-
由 John Ferlan 提交于
Instead of having duplicated code in qemuStorageLimitsRefresh and virStorageBackendUpdateVolTargetInfo to get capacity specific data about the storage backing source or volume -- create a common API to handle the details for both. As a side effect, virStorageFileProbeFormatFromBuf returns to being a local/static helper to virstoragefile.c For the QEMU code - if the probe is done, then the format is saved so as to avoid future such probes. For the storage backend code, there is no need to deal with the probe since we cannot call the new API if target->format == NONE. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Instead of having duplicated code in qemuStorageLimitsRefresh and virStorageBackendUpdateVolTargetInfoFD to fill in the storage backing source or volume allocation, capacity, and physical values - create a common API that will handle the details for both. The common API will fill in "default" capacity values as well - although those more than likely will be overridden by subsequent code. Having just one place to make the determination of what the values should be will make things be more consistent. For the QEMU code - the data filled in will be for inactive domains for the GetBlockInfo and DomainGetStatsOneBlock API's. For the storage backend code - the data will be filled in during the volume updates. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 05 12月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Commit id '03e750f3' added support for checking the PLOOP type; however, it used 'target.type' which no storage code ever fills in, so it will never be set. Change to just vol->type (could use vol->target.format as well).
-
- 02 12月, 2016 1 次提交
-
-
由 Yuri Chornoivan 提交于
-
- 28 11月, 2016 1 次提交
-
-
由 Chen Hanxiao 提交于
We had a lot of rados_conf_set and check works. Use helper virStorageBackendRBDRADOSConfSet for them. Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com>
-
- 25 11月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
We have couple of functions that operate over NULL terminated lits of strings. However, our naming sucks: virStringJoin virStringFreeList virStringFreeListCount virStringArrayHasString virStringGetFirstWithPrefix We can do better: virStringListJoin virStringListFree virStringListFreeCount virStringListHasString virStringListGetFirstWithPrefix Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 22 11月, 2016 1 次提交
-
-
由 Sławek Kapłoński 提交于
New line character in name of storagepool is now forbidden because it mess virsh output and can be confusing for users. Validation of name is done in driver, after parsing XML to avoid problems with dissappeared pools which was already created with new-line char in name. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 16 11月, 2016 1 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1366460 When using the --overwrite switch on a pool-build or pool-create, the The mkfs.ext{2|3|4} commands use mke2fs which requires using the '-F' switch in order to force overwriting the current filesystem on the whole disk. Likewise, the mkfs.vfat command uses mkfs.fat which requires using the '-I' switch in order to force overwriting the current filesystem on the whole disk.
-
- 12 10月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
This way we get reference counting and we can get rid of locking function. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-