1. 06 5月, 2014 1 次提交
  2. 25 4月, 2014 2 次提交
  3. 24 4月, 2014 7 次提交
  4. 12 4月, 2014 4 次提交
    • E
      conf: delete internal directory field · e0292e0c
      Eric Blake 提交于
      Another field no longer needed, getting us one step closer to
      merging virStorageFileMetadata and virStorageSource.
      
      * src/util/virstoragefile.h (_virStorageFileMetadata): Drop
      field.
      * src/util/virstoragefile.c (virStorageFileGetMetadataInternal)
      (virStorageFileGetMetadataFromFDInternal): Alter signature.
      (virStorageFileFreeMetadata, virStorageFileGetMetadataFromBuf)
      (virStorageFileGetMetadataFromFD): Adjust clients.
      * tests/virstoragetest.c (_testFileData, testStorageChain)
      (mymain): Simplify test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e0292e0c
    • E
      conf: tweak chain lookup internals · d193b34d
      Eric Blake 提交于
      Thanks to the testsuite, I feel quite confident that this rewrite
      is correct; it gives the same results for all cases except for one.
      I can make the argument that _that_ case was a pre-existing bug:
      when looking up relative names, the lookup is supposed to be
      pegged to the directory that contains the parent qcow2 file.  Thus,
      this resolves the fixme first mentioned in commit 367cd69d (even
      though I accidentally removed the fixme comment early in 74430fe3).
      
      * src/util/virstoragefile.c (virStorageFileChainLookup): Depend on
      new rather than old fields.
      * tests/virstoragetest.c (mymain): Adjust test to match fix.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d193b34d
    • E
      conf: drop redundant parameter to chain lookup · 74430fe3
      Eric Blake 提交于
      The original chain lookup code had to pass in the starting name,
      because it was not available in the chain.  But now that we have
      added fields to the struct, this parameter is redundant.
      
      * src/util/virstoragefile.h (virStorageFileChainLookup): Alter
      signature.
      * src/util/virstoragefile.c (virStorageFileChainLookup): Adjust
      handling of top of chain.
      * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Adjust caller.
      * tests/virstoragetest.c (testStorageLookup, mymain): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      74430fe3
    • E
      conf: test backing chain lookup · 367cd69d
      Eric Blake 提交于
      I realized that we had no good test coverage of looking up a
      name from within a backing chain, even though code like
      block-commit is relying on it.
      
      * tests/virstoragetest.c (testStorageLookup): New function.
      (mymain): New tests.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      367cd69d
  5. 11 4月, 2014 4 次提交
    • E
      conf: delete useless backingStoreFormat field · 86cfa1f6
      Eric Blake 提交于
      Drop another redundant field from virStorageFileMetadata.
      
      * src/util/virstoragefile.h (_virStorageFileMetadata): Drop
      field.
      * src/util/virstoragefile.c
      (virStorageFileGetMetadataFromFDInternal)
      (virStorageFileGetMetadataFromFD)
      (virStorageFileGetMetadataRecurse): Adjust callers.
      * tests/virstoragetest.c (_testFileData, testStorageChain)
      (mymain): Simplify test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      86cfa1f6
    • E
      conf: delete useless backingStoreIsFile field · c919ed7e
      Eric Blake 提交于
      Finally starting to prune away some of the old fields that have
      been made redundant by the new fields, on my way towards directly
      reusing virStorageSource.
      
      * src/util/virstoragefile.h (_virStorageFileMetadata): Drop
      field.
      * src/util/virstoragefile.c (virStorageFileGetMetadataInternal)
      (virStorageFileChainLookup): Adjust callers.
      * tests/virstoragetest.c (_testFileData, testStorageChain)
      (mymain): Simplify test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c919ed7e
    • E
      conf: provide details on network backing store · 7010768c
      Eric Blake 提交于
      So far, my work has been merely preserving the status quo of
      backing file analysis.  But this patch starts to tread in the
      territory of making the backing chain code more powerful - we
      will eventually support network storage containing non-raw
      formats.  Here, we expose metadata information about a network
      backing store, even if that information is still hardcoded to
      a raw format for now.
      
      * src/util/virstoragefile.c (virStorageFileGetMetadataRecurse):
      Also populate struct for non-file backing.
      (virStorageFileGetMetadata, virStorageFileGetMetadatainternal):
      Recognize non-file top image.
      (virFindBackingFile): Add comment.
      (virStorageFileChainGetBroken): Adjust comment, ensure output
      is set.
      * tests/virstoragetest.c (mymain): Update test to reflect it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7010768c
    • E
      conf: make virstoragetest debug easier · aa506b46
      Eric Blake 提交于
      I'm tired of alternating between test failures due to bugs in
      my refactoring work, vs. test failures due to leftovers in
      the file system from the previous test.  This patch has no
      impact when the testsuite is successful, but doeesn't hurt either.
      
      * tests/virstoragetest.c (testPrepImages): Clean up from prior
      failed test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      aa506b46
  6. 09 4月, 2014 7 次提交
    • E
      conf: test for more fields · 63fb7863
      Eric Blake 提交于
      Validate that all the new fields are getting set to desired values.
      
      * tests/virstoragetest.c (_testFileData, testStorageChain): Check
      for more fields.
      (mymain): Populate additional fields.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      63fb7863
    • E
      conf: start testing contents of the new backing chain fields · 6d698220
      Eric Blake 提交于
      The testsuite is absolutely essential to feeling comfortable
      about swapping the backing chain structure over to a new format.
      This patch tests the path settings, and demonstrates that the
      correct short name is being passed to the child.
      
      * tests/virstoragetest.c (testStorageChain): Test path.
      (mymain): Update expected data.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6d698220
    • E
      conf: rename some test fields · 4a349efc
      Eric Blake 提交于
      A later patch will be adding some new fields to
      virStorageFileMetadata; to minimize confusion, renaming the
      test fields now will make it more obvious which fields are
      being tested later.
      
      * tests/virstoragetest.c (_testFileData): Alter names.
      (testStorageChain, mymain): Adjust clients.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4a349efc
    • J
      build: avoid compiler warning on shadowed name · a18c7130
      Jean-Baptiste Rouault 提交于
      Introduced in commit d1e55de3.
      virstoragetest.c: In function ‘testStorageChain’:
      virstoragetest.c:249:10: warning: declaration of ‘abs’ shadows a global
      declaration [-Wshadow]
      a18c7130
    • E
      conf: another refactor of virstoragetest · d1e55de3
      Eric Blake 提交于
      Another reduction in the number of structs I have to modify
      when I start tracking new fields in virStorageFileMetadata.
      
      * tests/virstoragetest.c (_testFileData): Add fields.
      (testStorageChain): Select between fields based on flag.
      (mymain): Record both absolute and relative expectations in one
      struct.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d1e55de3
    • E
      conf: interleave virstoragetest structs · 34861333
      Eric Blake 提交于
      As I add more tests, it's getting harder to follow the split between
      a struct in one place and a test using the struct in another.
      Interleaving the tests makes changes more localized, and also makes
      debugging easier when a test goes wrong during my refactoring work.
      
      * tests/virstoragetest.c (mymain): Modify structs as we go, rather
      than up-front.
      (testStorageChain): Make failure debugging easier.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      34861333
    • E
      conf: test for more scenarios · fcc7d0ed
      Eric Blake 提交于
      Part of the upcoming refactoring will change how broken chains
      are detected; it makes sense to test that this works.  In
      particular, test the just-fixed infinite loop detection bug.
      Also, make sure that detection of directories is sane.
      
      * tests/virstoragetest.c (testStorageChain): Enhance test.
      (mymain): Add more tests.
      (testCleanupImages, testPrepImages): Populate a directory.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fcc7d0ed
  7. 05 4月, 2014 2 次提交
    • E
      tests: refactor virstoragetest for less stack space · d1a1d841
      Eric Blake 提交于
      I'm about to add fields to virStorageFileMetadata, which means
      also adding fields to the testFileData struct in virstoragetest.
      Alas, adding even one pointer on an x86_64 machine gave me a
      dreaded compiler error:
      
      virstoragetest.c:712:1: error: the frame size of 4208 bytes is larger than 4096 bytes [-Werror=frame-larger-than=]
      
      After some experimentation, I realized that each test was creating
      yet another testChainData (which contains testFileData) on the stack;
      forcing the reuse of one of these structures instead of creating a
      fresh one each time drastically reduces the size requirements.  While
      at it, I also got rid of a lot of intermediate structs, with some
      macro magic that lets me directly build up the destination chains
      inline.
      
      For a bit more insight into what this patch does:
      The old code uses an intermediate variable as a fixed-size array
      of structs:
      testFileData chain[] = { a, b };
      data.files = chain;
      
      In the new code, the use of VIR_FLATTEN_* allows the TEST_CHAIN()
      macro to still take a single argument for each chain, but now of
      the form '(a, b)', where it is turned into the var-args 'a, b'
      multiple arguments understood by TEST_ONE_CHAIN().  Thus, the
      new code avoids an intermediate variable, and directly provides
      the list of pointers to be assigned into array elements:
      data.files = { &a, &b };
      
      * tests/virstoragetest.c (mymain): Rewrite TEST_ONE_CHAIN to
      reuse the same struct for each test, and to take the data
      inline rather than via intermediate variables.
      (testChainData): Use bounded array of pointers instead of
      unlimited array of struct.
      (testStorageChain): Reflect struct change.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d1a1d841
    • E
      tests: use C99 initialization for storage test · 7da61b30
      Eric Blake 提交于
      Writing this test with C99 initializers will make it easier to test
      additions and deletions to struct members as I refactor the code.
      
      * tests/virstoragetest.c (mymain): Rewrite initializers.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7da61b30
  8. 03 4月, 2014 1 次提交
  9. 02 4月, 2014 1 次提交
    • E
      conf: modify tracking of encrypted images · 2279d560
      Eric Blake 提交于
      A future patch will merge virStorageFileMetadata and virStorageSource,
      but I found it easier to do if both structs use the same information
      for tracking whether a source file needs encryption keys.
      
      * src/util/virstoragefile.h (_virStorageFileMetadata): Prepare
      full encryption struct instead of just a bool.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Use transfer semantics.
      * src/storage/storage_backend_gluster.c
      (virStorageBackendGlusterRefreshVol): Likewise.
      * src/util/virstoragefile.c (virStorageFileGetMetadataInternal):
      Populate struct.
      (virStorageFileFreeMetadata): Adjust clients.
      * tests/virstoragetest.c (testStorageChain): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2279d560
  10. 25 3月, 2014 1 次提交
  11. 18 3月, 2014 1 次提交
  12. 16 1月, 2014 1 次提交
    • E
      tests: be more explicit on qcow2 versions in virstoragetest · 974e5914
      Eric Blake 提交于
      While working on v1.0.5-maint (the branch in use on Fedora 19)
      with the host at Fedora 20, I got a failure in virstoragetest.
      I traced it to the fact that we were using qemu-img to create a
      qcow2 file, but qemu-img changed from creating v2 files by
      default in F19 to creating v3 files in F20.  Rather than leaving
      it up to qemu-img, it is better to write the test to force
      testing of BOTH file formats (better code coverage and all).
      
      This patch alone does not fix all the failures in v1.0.5-maint;
      for that, we must decide to either teach the older branch to
      understand v3 files, or to reject them outright as unsupported.
      But for upstream, making the test less dependent on changing
      qemu-img defaults is always a good thing.
      
      * tests/virstoragetest.c (testPrepImages): Simplify creation of
      raw file; check if qemu supports compat and if so use it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      974e5914
  13. 08 10月, 2013 1 次提交
  14. 11 7月, 2013 1 次提交
  15. 10 7月, 2013 1 次提交
  16. 11 5月, 2013 1 次提交
    • L
      util: move virFile* functions from virutil.c to virfile.c · bfe7721d
      Laine Stump 提交于
      These all existed before virfile.c was created, and for some reason
      weren't moved.
      
      This is mostly straightfoward, although the syntax rule prohibiting
      write() had to be changed to have an exception for virfile.c instead
      of virutil.c.
      
      This movement pointed out that there is a function called
      virBuildPath(), and another almost identical function called
      virFileBuildPath(). They really should be a single function, which
      I'll take care of as soon as I figure out what the arglist should look
      like.
      bfe7721d
  17. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  18. 16 4月, 2013 1 次提交
  19. 27 2月, 2013 2 次提交
    • E
      tests: skip virstoragetest on RHEL 5 · 9194679e
      Eric Blake 提交于
      virstoragetest was failing on RHEL 5, but with no good error message:
      
      TEST: virstoragetest
                                              0   FAIL
      
      It turns out that qemu-img was so old, that it lacked support for
      -o backing_file.  It didn't help that the test was also using
      qemu-img from PATH, even after first probing for kvm-img.
      
      * tests/virstoragetest.c (testPrepImages): Consistently use
      discovered binary.  Skip instead of fail if qemu-img fails during
      setup.
      9194679e
    • E
      tests: consistent skip messages · eb41338e
      Eric Blake 提交于
      On RHEL 5, I noticed this test failure message:
      
      TEST: qemumonitorjsontest
      libvirt not compiled with yajl, skippingSKIP: qemumonitorjsontest
      
      * tests/virstoragetest.c (testPrepImages): Use simpler fputs.
      * tests/qemumonitorjsontest.c (mymain): Ensure trailing newline.
      eb41338e