[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] util:report diskchain as broken if without enough permission



When backing files of a disk file are stored in NFS shared folder,
qemu process requires at least the read permission.
But in some rare situation, these backing files can not even be read
If so, we should treat the diskchains as broken.
This patch add a checking for this, report negative in such case.
---
 src/util/virstoragefile.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 0b9cec3..3dee7ab 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -1127,7 +1127,11 @@ virStorageFileChainGetBroken(virStorageFileMetadataPtr chain,
         /* Break if no backing store or backing store is not file */
        if (!tmp->backingStoreRaw)
            break;
-       if (!tmp->backingStore) {
+
+       if (tmp->backingStoreIsFile) {
+           if (!tmp->backingMeta)
+               goto error;
+       } else if (!tmp->backingStore) {
            if (VIR_STRDUP(*brokenFile, tmp->backingStoreRaw) < 0)
                goto error;
            break;
-- 
1.8.3.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]