]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
util: storage: Remove now redundant backingRelative from virStorageSource
authorPeter Krempa <pkrempa@redhat.com>
Tue, 27 May 2014 08:40:59 +0000 (10:40 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 25 Jun 2014 07:58:42 +0000 (09:58 +0200)
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
src/util/virstoragefile.h
tests/virstoragetest.c

index f8ca5f2ba8d6ba849301c100c8d3985deefba7fd..d6408e499f4daa940fc0199af79b200d84de3173 100644 (file)
@@ -1621,8 +1621,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;
@@ -2223,7 +2221,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;
         }
index cea8cf874fb950b01707f4214de737001beb36aa..272a44d31986589d16dfe71085d338dfd98d7c6c 100644 (file)
@@ -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;
 };
 
 
index c4e0f7cfef0ae86e6edc0d84cf0623e146f903b5..1080730b69724d9129fd6c80c81ab3e627bd61f2 100644 (file)
@@ -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";