mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-22 14:09:22 +00:00
storage: Fix printing/casting of uid_t/gid_t
Other parts of libvirt use "%u" for formatting uid/gid and typecast to unsigned int. Storage driver used the signed variant.
This commit is contained in:
parent
253319ced6
commit
8ef4f598f1
@ -2797,7 +2797,8 @@ virStorageFileChown(virStorageSourcePtr src,
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("chown of storage file %p to %d:%d", src, uid, gid);
|
VIR_DEBUG("chown of storage file %p to %u:%u",
|
||||||
|
src, (unsigned int)uid, (unsigned int)gid);
|
||||||
|
|
||||||
return src->drv->backend->storageFileChown(src, uid, gid);
|
return src->drv->backend->storageFileChown(src, uid, gid);
|
||||||
}
|
}
|
||||||
@ -2819,9 +2820,9 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
|
|||||||
virStorageSourcePtr backingStore = NULL;
|
virStorageSourcePtr backingStore = NULL;
|
||||||
int backingFormat;
|
int backingFormat;
|
||||||
|
|
||||||
VIR_DEBUG("path=%s format=%d uid=%d gid=%d probe=%d",
|
VIR_DEBUG("path=%s format=%d uid=%u gid=%u probe=%d",
|
||||||
src->path, src->format,
|
src->path, src->format,
|
||||||
(int)uid, (int)gid, allow_probe);
|
(unsigned int)uid, (unsigned int)gid, allow_probe);
|
||||||
|
|
||||||
/* exit if we can't load information about the current image */
|
/* exit if we can't load information about the current image */
|
||||||
if (!virStorageFileSupportsBackingChainTraversal(src))
|
if (!virStorageFileSupportsBackingChainTraversal(src))
|
||||||
@ -2834,13 +2835,15 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
|
|||||||
if (src == parent) {
|
if (src == parent) {
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
_("Cannot access storage file '%s' "
|
_("Cannot access storage file '%s' "
|
||||||
"(as uid:%d, gid:%d)"),
|
"(as uid:%u, gid:%u)"),
|
||||||
src->path, (int)uid, (int)gid);
|
src->path, (unsigned int)uid,
|
||||||
|
(unsigned int)gid);
|
||||||
} else {
|
} else {
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
_("Cannot access backing file '%s' "
|
_("Cannot access backing file '%s' "
|
||||||
"of storage file '%s' (as uid:%d, gid:%d)"),
|
"of storage file '%s' (as uid:%u, gid:%u)"),
|
||||||
src->path, parent->path, (int)uid, (int)gid);
|
src->path, parent->path,
|
||||||
|
(unsigned int)uid, (unsigned int)gid);
|
||||||
}
|
}
|
||||||
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -2934,8 +2937,8 @@ virStorageFileGetMetadata(virStorageSourcePtr src,
|
|||||||
bool allow_probe,
|
bool allow_probe,
|
||||||
bool report_broken)
|
bool report_broken)
|
||||||
{
|
{
|
||||||
VIR_DEBUG("path=%s format=%d uid=%d gid=%d probe=%d, report_broken=%d",
|
VIR_DEBUG("path=%s format=%d uid=%u gid=%u probe=%d, report_broken=%d",
|
||||||
src->path, src->format, (int)uid, (int)gid,
|
src->path, src->format, (unsigned int)uid, (unsigned int)gid,
|
||||||
allow_probe, report_broken);
|
allow_probe, report_broken);
|
||||||
|
|
||||||
virHashTablePtr cycle = NULL;
|
virHashTablePtr cycle = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user