[libvirt] [PATCH] Ignore char devices in storage pools by default

Without this, using /dev/mapper as a directory pool fails in virStorageBackendUpdateVolTargetInfoFD: cannot seek to end of file '/dev/mapper/control': Illegal seek Skip over character devices by default. https://bugzilla.redhat.com/show_bug.cgi?id=710866 --- src/storage/storage_backend.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/storage/storage_backend.h b/src/storage/storage_backend.h index 5314411..f5e9440 100644 --- a/src/storage/storage_backend.h +++ b/src/storage/storage_backend.h @@ -130,7 +130,6 @@ enum { # define VIR_STORAGE_VOL_OPEN_DEFAULT (VIR_STORAGE_VOL_OPEN_ERROR |\ VIR_STORAGE_VOL_OPEN_REG |\ - VIR_STORAGE_VOL_OPEN_CHAR |\ VIR_STORAGE_VOL_OPEN_BLOCK) int virStorageBackendVolOpenCheckMode(const char *path, struct stat *sb, -- 1.8.3.2

On 03/20/2014 10:08 AM, Ján Tomko wrote:
Without this, using /dev/mapper as a directory pool fails in virStorageBackendUpdateVolTargetInfoFD: cannot seek to end of file '/dev/mapper/control': Illegal seek
Skip over character devices by default.
I agree that character devices can't serve as a storage volume. It may still be nice to have storage pools express all file names, including those files that can't be volumes (dangling symlinks, character devices, named fifos or sockets) rather than its current filtering (regular files, block devices, directories, symlinks to one of the above). Doing so would make storage pools become a way to do remote directory listings, for all types of files and not just storage volumes, which becomes handy for choosing new volume names (which should not conflict with existing files, even where the existing files cannot be a storage volume). But that's a bigger change for a different day.
https://bugzilla.redhat.com/show_bug.cgi?id=710866 --- src/storage/storage_backend.h | 1 - 1 file changed, 1 deletion(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 03/20/2014 05:45 PM, Eric Blake wrote:
On 03/20/2014 10:08 AM, Ján Tomko wrote:
Without this, using /dev/mapper as a directory pool fails in virStorageBackendUpdateVolTargetInfoFD: cannot seek to end of file '/dev/mapper/control': Illegal seek
Skip over character devices by default.
I agree that character devices can't serve as a storage volume.
It may still be nice to have storage pools express all file names, including those files that can't be volumes (dangling symlinks, character devices, named fifos or sockets) rather than its current filtering (regular files, block devices, directories, symlinks to one of the above). Doing so would make storage pools become a way to do remote directory listings, for all types of files and not just storage volumes, which becomes handy for choosing new volume names (which should not conflict with existing files, even where the existing files cannot be a storage volume). But that's a bigger change for a different day.
https://bugzilla.redhat.com/show_bug.cgi?id=710866 --- src/storage/storage_backend.h | 1 - 1 file changed, 1 deletion(-)
ACK.
Thanks, pushed now. Jan
participants (2)
-
Eric Blake
-
Ján Tomko