static int
virStorageBackendDetectBlockVolFormatFD(virStorageSourcePtr target,
- int fd)
+ int fd,
+ unsigned int readflags ATTRIBUTE_UNUSED)
{
size_t i;
off_t start;
int
virStorageBackendUpdateVolTargetInfo(virStorageSourcePtr target,
bool withBlockVolFormat,
- unsigned int openflags)
+ unsigned int openflags,
+ unsigned int readflags)
{
int ret, fd = -1;
struct stat sb;
}
if (withBlockVolFormat) {
- if ((ret = virStorageBackendDetectBlockVolFormatFD(target, fd)) < 0)
+ if ((ret = virStorageBackendDetectBlockVolFormatFD(target, fd,
+ readflags)) < 0)
goto cleanup;
}
int
virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol,
bool withBlockVolFormat,
- unsigned int openflags)
+ unsigned int openflags,
+ unsigned int readflags)
{
int ret;
if ((ret = virStorageBackendUpdateVolTargetInfo(&vol->target,
withBlockVolFormat,
- openflags)) < 0)
+ openflags, readflags)) < 0)
return ret;
if (vol->target.backingStore &&
(ret = virStorageBackendUpdateVolTargetInfo(vol->target.backingStore,
withBlockVolFormat,
VIR_STORAGE_VOL_OPEN_DEFAULT |
- VIR_STORAGE_VOL_OPEN_NOERROR) < 0))
+ VIR_STORAGE_VOL_OPEN_NOERROR,
+ readflags) < 0))
return ret;
return 0;
int virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol,
bool withBlockVolFormat,
- unsigned int openflags);
+ unsigned int openflags,
+ unsigned int readflags);
int virStorageBackendUpdateVolTargetInfo(virStorageSourcePtr target,
bool withBlockVolFormat,
- unsigned int openflags);
+ unsigned int openflags,
+ unsigned int readflags);
int virStorageBackendUpdateVolTargetInfoFD(virStorageSourcePtr target,
int fd,
struct stat *sb);
if (vol->source.partType == VIR_STORAGE_VOL_DISK_TYPE_EXTENDED) {
if (virStorageBackendUpdateVolInfo(vol, false,
VIR_STORAGE_VOL_OPEN_DEFAULT |
- VIR_STORAGE_VOL_OPEN_NOERROR) == -1)
+ VIR_STORAGE_VOL_OPEN_NOERROR,
+ 0) == -1)
return -1;
vol->target.allocation = 0;
vol->target.capacity =
(vol->source.extents[0].end - vol->source.extents[0].start);
} else {
if (virStorageBackendUpdateVolInfo(vol, false,
- VIR_STORAGE_VOL_OPEN_DEFAULT) < 0)
+ VIR_STORAGE_VOL_OPEN_DEFAULT, 0) < 0)
return -1;
}
if (vol->target.backingStore) {
ignore_value(virStorageBackendUpdateVolTargetInfo(vol->target.backingStore,
false,
- VIR_STORAGE_VOL_OPEN_DEFAULT));
+ VIR_STORAGE_VOL_OPEN_DEFAULT, 0));
/* If this failed, the backing file is currently unavailable,
* the capacity, allocation, owner, group and mode are unknown.
* An error message was raised, but we just continue. */
/* Refresh allocation / capacity / permissions info in case its changed */
ret = virStorageBackendUpdateVolInfo(vol, false,
- VIR_STORAGE_VOL_FS_OPEN_FLAGS);
+ VIR_STORAGE_VOL_FS_OPEN_FLAGS, 0);
if (ret < 0)
return ret;
goto cleanup;
if (virStorageBackendUpdateVolInfo(vol, false,
- VIR_STORAGE_VOL_OPEN_DEFAULT) < 0)
+ VIR_STORAGE_VOL_OPEN_DEFAULT, 0) < 0)
goto cleanup;
nextents = 1;
goto cleanup;
if (virStorageBackendUpdateVolInfo(vol, true,
- VIR_STORAGE_VOL_OPEN_DEFAULT) < 0) {
+ VIR_STORAGE_VOL_OPEN_DEFAULT, 0) < 0) {
goto cleanup;
}
}
if (virStorageBackendUpdateVolInfo(vol, true,
- VIR_STORAGE_VOL_OPEN_DEFAULT) < 0)
+ VIR_STORAGE_VOL_OPEN_DEFAULT, 0) < 0)
goto cleanup;
if (!(vol->key = virStorageBackendSCSISerial(vol->target.path)))