Now that we store only relative names in virStorageSource's member relPath the backingRelative member is obsolete. Remove it and adapt the code to the removal. --- src/util/virstoragefile.c | 4 +--- src/util/virstoragefile.h | 2 -- tests/virstoragetest.c | 8 +------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 7b4e46a..b527a12 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1598,8 +1598,6 @@ virStorageSourceNewFromBackingRelative(virStorageSourcePtr parent, if (VIR_ALLOC(ret) < 0) return NULL; - ret->backingRelative = true; - /* store relative name */ if (VIR_STRDUP(ret->relPath, parent->backingStoreRaw) < 0) goto error; @@ -2168,7 +2166,7 @@ virStorageFileGetRelativeBackingPath(virStorageSourcePtr top, *relpath = NULL; for (next = top; next; next = next->backingStore) { - if (!next->backingRelative || !next->relPath) { + if (!next->relPath) { ret = 1; goto cleanup; } diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 38d1720..92f30a7 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -256,8 +256,6 @@ struct _virStorageSource { /* Name of the child backing store recorded in metadata of the * current file. */ char *backingStoreRaw; - /* is backing store identified as relative */ - bool backingRelative; }; diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 2fd5459..be1ea4d 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -591,13 +591,11 @@ testPathRelativePrepare(void) else backingchain[i].backingStore = NULL; - backingchain[i].backingRelative = true; + backingchain[i].relPath = NULL; } /* normal relative backing chain */ backingchain[0].path = (char *) "/path/to/some/img"; - backingchain[0].relPath = (char *) "/path/to/some/img"; - backingchain[0].backingRelative = false; backingchain[1].path = (char *) "/path/to/some/asdf"; backingchain[1].relPath = (char *) "asdf"; @@ -610,8 +608,6 @@ testPathRelativePrepare(void) /* ovirt's backing chain */ backingchain[4].path = (char *) "/path/to/volume/image1"; - backingchain[4].relPath = (char *) "/path/to/volume/image1"; - backingchain[4].backingRelative = false; backingchain[5].path = (char *) "/path/to/volume/image2"; backingchain[5].relPath = (char *) "../volume/image2"; @@ -624,8 +620,6 @@ testPathRelativePrepare(void) /* some arbitrarily crazy backing chains */ backingchain[8].path = (char *) "/crazy/base/image"; - backingchain[8].relPath = (char *) "/crazy/base/image"; - backingchain[8].backingRelative = false; backingchain[9].path = (char *) "/crazy/base/directory/stuff/volumes/garbage/image2"; backingchain[9].relPath = (char *) "directory/stuff/volumes/garbage/image2"; -- 1.9.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list