- 31 1月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
The custom namespaces were originally registered against the storage pool source struct, but during review this was changed to the top level storage pool struct. The namespace URIs were not updated to match, so had a redundant '/source' component. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 30 1月, 2019 1 次提交
-
-
由 John Ferlan 提交于
Introduce the virStoragePoolFSMountOptionsDef to be used to manage the Storage Pool XML Namespace for mount options. Using a new virStorageBackendNamespaceInit function, set the virStoragePoolXMLNamespace into the _virStoragePoolOptions when the storage backend is loaded. Modify the storagepool.rng to allow for the usage of a different XML namespace to parse the fs_mount_opts to be included with the fs and netfs storage pool definitions. Modify the storagepoolxml2xmltest to utilize a properly modified XML file to parse and format the namespace for a netfs storage pool. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 14 12月, 2018 2 次提交
-
-
由 John Ferlan 提交于
Turns out there some build platforms that must not define MOUNT or VGCHANGE in config.h... So moving the commands from the storage backend specific module into a common storage_util module causes issues for those platforms. So instead of assuming they are there, let's just pass the command string to the storage util API's from the storage backend specific code (as would have been successful before). Also modify the test to determine whether the MOUNT and/or VGCHANGE doesn't exist and just define it to (for example) what Fedora has for the path. Could have just used "mount" and "vgchange" in the call, but that defeats the purpose of adding the call to virTestClearCommandPath. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Daniel P. Berrangé 提交于
In many files there are header comments that contain an Author: statement, supposedly reflecting who originally wrote the code. In a large collaborative project like libvirt, any non-trivial file will have been modified by a large number of different contributors. IOW, the Author: comments are quickly out of date, omitting people who have made significant contribitions. In some places Author: lines have been added despite the person merely being responsible for creating the file by moving existing code out of another file. IOW, the Author: lines give an incorrect record of authorship. With this all in mind, the comments are useless as a means to identify who to talk to about code in a particular file. Contributors will always be better off using 'git log' and 'git blame' if they need to find the author of a particular bit of code. This commit thus deletes all Author: comments from the source and adds a rule to prevent them reappearing. The Copyright headers are similarly misleading and inaccurate, however, we cannot delete these as they have legal meaning, despite being largely inaccurate. In addition only the copyright holder is permitted to change their respective copyright statement. Reviewed-by: NErik Skultety <eskultet@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 13 12月, 2018 3 次提交
-
-
由 John Ferlan 提交于
Move into storage_util for reuse by test harness Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 John Ferlan 提交于
Move virStorageBackendFileSystemMountCmd to storage_util so that it can be used by the test harness. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 John Ferlan 提交于
Extract out the code that is used to create the MOUNT command for starting the pool. We can use this for Storage Pool XML to Argv testing to ensure code changes don't alter how a storage pool is started. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 20 9月, 2018 2 次提交
-
-
由 Erik Skultety 提交于
All of the ones being removed are pulled in by internal.h. The only exception is sanlock which expects the application to include <stdint.h> before sanlock's headers, because sanlock prototypes use fixed width int, but they don't include stdint.h themselves, so we have to leave that one in place. Signed-off-by: NErik Skultety <eskultet@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Erik Skultety 提交于
It doesn't really make sense for us to have stdlib.h and string.h but not stdio.h in the internal.h header. Signed-off-by: NErik Skultety <eskultet@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 03 5月, 2018 3 次提交
-
-
由 Daniel P. Berrangé 提交于
The storage file drivers are currently loaded as a side effect of loading the storage driver. This is a bogus dependancy because the storage file code has no interaction with the storage drivers, and even ultimately be running in a completely separate daemon. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The storage file code needs to be run in the hypervisor drivers, while the storage backend code needs to be run in the storage driver. Split the source code as a preparatory step for creating separate loadable modules. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 09 2月, 2018 2 次提交
-
-
由 Daniel P. Berrangé 提交于
The QEMU driver loadable module needs to be able to resolve all ELF symbols it references against libvirt.so. Some of its symbols can only be resolved against the storage_driver.so loadable module which creates a hard dependancy between them. By moving the storage file backend framework into the util directory, this gets included directly in the libvirt.so library. The actual backend implementations are still done as loadable modules, so this doesn't re-add deps on gluster libraries. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The storage driver backends are serving the public storage pools API, while the storage file backends are serving the internal QEMU driver and / or libvirt utility code. To prep for moving this storage file backend framework into the utility code, split out the backend definitions. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 01 2月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Now that we can open connections to the secondary drivers on demand, there is no need to pass a virConnectPtr into all the backend functions. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 06 10月, 2017 1 次提交
-
-
由 John Ferlan 提交于
In preparation for privatizing the object, use the accessor.
-
- 11 7月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
Allow specifying offset to read an arbitrary position in the file. This warrants a rename to virStorageFileRead.
-
- 04 4月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
The native gluster pool source list data differs from the data used for attaching gluster volumes as netfs pools. Currently the only difference was the format. Since native pools don't use it and later there will be more differences add a more deterministic way to switch between the types instead.
-
- 21 2月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
Add APIs that allow to dynamically register driver backends so that the list of available drivers does not need to be known during compile time. This will allow us to modularize the storage driver on runtime.
-
- 11 2月, 2017 2 次提交
-
-
由 Erik Skultety 提交于
Right now, we use simple string comparison both on the source paths (mount's output vs pool's source) and the target (mount's mnt_dir vs pool's target). The problem are symlinks and mount indeed returns symlinks in its output, e.g. /dev/mappper/lvm_symlink. The same goes for the pool's source/target, so in order to successfully compare these two replace plain string comparison with virFileComparePaths which will resolve all symlinks and canonicalize the paths prior to comparison. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1417203Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
When FS pool's source is already mounted on the target location instead of just simply marking the pool as active, thus starting it we fail with an error stating that the source is indeed already mounted on the target. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 27 1月, 2017 1 次提交
-
-
由 John Ferlan 提交于
Commit id '5f07c3c0' broke the freebsd build in the libvirt CI test environment because the UMOUNT was not defined unless WITH_STORAGE_FS is defined. So remove the virStorageBackendUmountLocal from storage_util.c,h and restore the code back in the storage_backend_fs.c and _vstorage.c modules.
-
- 26 1月, 2017 3 次提交
-
-
由 John Ferlan 提交于
Move all the volume functions to storage_util to create local/common helpers using the same naming syntax as the existing upload, download, and wipe virStorageBackend*Local API's. In the process of doing so, found more API's that can now become local to storage_util. In order to distinguish between local/external - I changed the names of the now local only ones from "virStorageBackend..." to just "storageBackend..." Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Move some pool functions to storage_util to create local/common helpers using the same naming syntax as the existing upload, download, and wipe virStorageBackend*Local API's. In the process of doing so, found a few API's that can now become local to storage_util. In order to distinguish between local/external - I changed the names of the now local only ones from "virStorageBackend..." to just "storageBackend..." Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Just moving code around with minor adjustment to have the Stop code combine with the Unmount code since all the Stop code did was call the Unmount code.
-
- 19 1月, 2017 2 次提交
-
-
由 Peter Krempa 提交于
The file backend code was mistakenly put into #if WITH_STORAGE_FS. This is not necessary since all the backends just access files on disk, and thus the code for WITH_STORAGE_DIR is sufficient to compile everything.
-
由 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.
-
- 18 1月, 2017 3 次提交
-
-
由 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 提交于
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.
-
- 13 1月, 2017 1 次提交
-
-
由 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 5 次提交
-
-
由 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 提交于
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>
-
- 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 9月, 2016 1 次提交
-
-
由 John Ferlan 提交于
A LUKS volume uses the volume secret type just like the QCOW2 secret, so adjust the loading of the default secrets to handle any volume that the virStorageFileGetMetadataFromBuf code has deemed to be an encrypted volume to search for the volume's secret. This lookup is done by volume usage where the usage is expected to be the path to volume.
-
- 28 7月, 2016 1 次提交
-
-
由 Daniel P. Berrange 提交于
The current LUKS support has a "luks" volume type which has a "luks" encryption format. This partially makes sense if you consider the QEMU shorthand syntax only requires you to specify a format=luks, and it'll automagically uses "raw" as the next level driver. QEMU will however let you override the "raw" with any other driver it supports (vmdk, qcow, rbd, iscsi, etc, etc) IOW the intention though is that the "luks" encryption format is applied to all disk formats (whether raw, qcow2, rbd, gluster or whatever). As such it doesn't make much sense for libvirt to say the volume type is "luks" - we should be saying that it is a "raw" file, but with "luks" encryption applied. IOW, when creating a storage volume we should use this XML <volume> <name>demo.raw</name> <capacity>5368709120</capacity> <target> <format type='raw'/> <encryption format='luks'> <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccd2f80d6f'/> </encryption> </target> </volume> and when configuring a guest disk we should use <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/home/berrange/VirtualMachines/demo.raw'/> <target dev='sda' bus='scsi'/> <encryption format='luks'> <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccd2f80d6f'/> </encryption> </disk> This commit thus removes the "luks" storage volume type added in commit 318ebb36 Author: John Ferlan <jferlan@redhat.com> Date: Tue Jun 21 12:59:54 2016 -0400 util: Add 'luks' to the FileTypeInfo The storage file probing code is modified so that it can probe the actual encryption formats explicitly, rather than merely probing existance of encryption and letting the storage driver guess the format. The rest of the code is then adapted to deal with VIR_STORAGE_FILE_RAW w/ VIR_STORAGE_ENCRYPTION_FORMAT_LUKS instead of just VIR_STORAGE_FILE_LUKS. The commit mentioned above was included in libvirt v2.0.0. So when querying volume XML this will be a change in behaviour vs the 2.0.0 release - it'll report 'raw' instead of 'luks' for the volume format, but still report 'luks' for encryption format. I think this change is OK because the storage driver did not include any support for creating volumes, nor starting guets with luks volumes in v2.0.0 - that only since then. Clearly if we change this we must do it before v2.1.0 though. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 02 7月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Add parse and format of the luks/passphrase secret including tests for volume XML parsing. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-