1. 09 4月, 2014 17 次提交
    • E
      conf: track user vs. canonical name through full chain lookup · 79f11b35
      Eric Blake 提交于
      The previous patch started a separation of error messages
      reported against the user-specified name, vs. tracking the
      canonical path that was actually opened.  This patch extends
      that notion, by hoisting directory detection up front, passing
      the canonical path through the entire call chain, and
      simplifying lower-level functions that can now assume that
      a canonical path and directory have been supplied.
      
      * src/util/virstoragefile.c
      (virStorageFileGetMetadataFromFDInternal)
      (virStorageFileGetMetadataInternal): Add parameter, require
      directory.
      (virFindBackingFile): Require directory.
      (virStorageFileGetMetadataFromFD): Pass canonical path.
      (virStorageFileGetMetadataFromBuf): Likewise.
      (virStorageFileGetMetadata): Determine initial directory.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      79f11b35
    • P
      qemu: Unexport qemuBuildNetworkDriveURI() · 90dbdff2
      Peter Krempa 提交于
      The function isn't used in any other file. Convert it to static.
      90dbdff2
    • P
      qemu: Refactor qemuGetDriveSourceString to take virStorageSourcePtr · 816f0f93
      Peter Krempa 提交于
      Refactor the function to avoid multiple wrappers splitting identical
      fields from the now common metadata struct.
      
      The refactor is done by folding in the wrapper used for disk sources
      which allows us to lookup secrets via the secret driver. This may allow
      using stored secrets for snapshot disk images too in the future.
      816f0f93
    • P
      storage: Refactor location of metadata for storage drive access to files · cecd6566
      Peter Krempa 提交于
      Now that we store all metadata about a storage image in a
      virStorageSource struct let's use it also to store information needed by
      the storage driver to access and do operations on the files.
      cecd6566
    • P
      storage: Refactor storage file initialization to use virStorageSourcePtr · 9689dfaa
      Peter Krempa 提交于
      Now that storage source metadata is stored in a single struct we don't
      need two initialization functions for different structs.
      9689dfaa
    • P
      conf: Refactor helpers to retrieve actual storage type · 93c1f2cd
      Peter Krempa 提交于
      Now that the storage source definition is uniform convert the helpers to
      retrieve the actual storage type to a single one.
      93c1f2cd
    • J
      storage: Don't update pool available/allocation if buildVol fails · 0c2305b3
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1024159
      
      If adding a volume to a storage pool fails during the CreateXML or
      CreateXMLFrom API's, we don't want to adjust the available and
      allocation values for the storage pool during storageVolDelete
      since we haven't adjusted the values for the create.
      
      Refactor storageVolDelete() a bit to create a storageVolDeleteInternal()
      which will handle the primary deletion activities.  Add a parameter
      updateMeta which will signify whether to update the values or not.
      
      Adjust the calls from CreateXML and CreateXMLFrom to directly call the
      DeleteInternal with the pool lock held.  This does bypass the call
      to virStorageVolDeleteEnsureACL().
      0c2305b3
    • 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
    • R
      tests: use virBhyveCapsBuild in bhyvexml2argv test · 548f21d0
      Roman Bogorodskiy 提交于
      As we can use virBhyveCapsBuild() now, replace
      testBhyveBuildCapabilities() with it.
      548f21d0
    • 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
    • E
      conf: fix detection of infinite backing loop · af095bfa
      Eric Blake 提交于
      While trying to refactor the backing file chain, I noticed that
      if you have a self-referential qcow2 file via a relative name:
      
      qemu-img create -f qcow2 loop 10M
      qemu-img rebase -u -f qcow2 -F qcow2 -b loop loop
      
      then libvirt was creating a chain 2 deep before realizing it
      had hit a loop; furthermore, virStorageFileChainCheckBroken
      was not identifying the chain as broken.  With this patch,
      the loop is detected when the chain is only 1 deep; still
      enough for storage volume XML to display the file, but now
      with a proper error report about where the loop was found.
      
      This patch adds a parameter to virStorageFileGetMetadataRecurse,
      so that errors at the top of the chain remain unchanged; messages
      issued for backing files now use the name provided by the user
      instead of the canonical name (for VDSM, which uses relative
      symlinks to device mapper block devices, this is actually more
      useful).
      
      * src/util/virstoragefile.c (virStorageFileGetMetadataRecurse):
      Add parameter, require canonical path up front.  Mark chain
      broken on OOM or loop detection.
      (virStorageFileGetMetadata): Pass in canonical name.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      af095bfa
    • J
      vmware: set the driver version · 2fe658ad
      Jean-Baptiste Rouault 提交于
      Since commit 7457cbe8 the vmware driver version isn't set anymore.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2fe658ad
    • R
      tests: add bhyve xml2xml test · 6d7a287c
      Roman Bogorodskiy 提交于
      The only implemented test for now is domain metadata test.
      6d7a287c
    • R
      bhyve: add domain metadata support · b291cb5e
      Roman Bogorodskiy 提交于
      Implement domainSetMetadata and domainGetMetadata driver calls.
      b291cb5e
    • R
      bhyve: fix ATTRIBUTE_NONNULL usage · 986a07c7
      Roman Bogorodskiy 提交于
      Fix incorrect ATTRIBUTE_NONNULL usage introduced in 17b17565
      which caused build failure:
      
      bhyve/bhyve_driver.c:127:48: error: expected ')'
      bhyveDriverGetCapabilities(bhyveConnPtr driver ATTRIBUTE_NONNULL)
                                                     ^
      bhyve/bhyve_driver.c:127:27: note: to match this '('
      bhyveDriverGetCapabilities(bhyveConnPtr driver ATTRIBUTE_NONNULL)
      
      Pushed under the build breaker rule.
      986a07c7
  2. 08 4月, 2014 18 次提交
  3. 07 4月, 2014 5 次提交
    • W
      bhyve: connectCompareCPU support · 627d1439
      Wojciech Macek 提交于
      Implement support for connectCompareCPU.
      627d1439
    • W
      bhyve: create capabilities submodule · b15a2bbd
      Wojciech Macek 提交于
      - Move all capabilities functions to separate file
      - Add initCPU
      b15a2bbd
    • W
      bhyve: support for connectBaselineCPU · 36cf8174
      Wojciech Macek 提交于
      Implement bhyveConnectBaselineCPU to support OpenStack/Nova
      36cf8174
    • L
      interface: dump inactive xml when interface isn't active · 7284c499
      Laine Stump 提交于
      Other drivers in libvirt (e.g. network, qemu) will automatically
      return the "inactive" (persistent configuration) XML of an object when
      that object is inactive. The netcf backend of the interface driver
      would always try to return the live status XML of the interface, even
      when it was down. Although netcf does return valid XML in that case,
      for bond interfaces it is missing almost all of its content, including
      the <bond> subelement itself, leading to this error message from
      "virsh iface-dumpxml" of a bond interface that is inactive:
      
        error: XML error: bond interface misses the bond element
      
      (this is because libvirt's validation of the XML returned by netcf
      always requires a <bond> element be present).
      
      This patch modifies the interface driver netcf backend to check if the
      interface is inactive, and in that case always return the inactive XML
      (which will always have a <bond> element, thus eliminating the error
      message, as well as making operation more in line with other drivers.
      
      This fixes the following bug:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=878394
      7284c499
    • E
      hash: add common utility functions · 09567144
      Eric Blake 提交于
      I almost wrote a hash value free function that just called
      VIR_FREE, then realized I couldn't be the first person to
      do that.  Sure enough, it was worth factoring into a common
      helper routine.
      
      * src/util/virhash.h (virHashValueFree): New function.
      * src/util/virhash.c (virHashValueFree): Implement it.
      * src/util/virobject.h (virObjectFreeHashData): New function.
      * src/libvirt_private.syms (virhash.h, virobject.h): Export them.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit): Use
      common function.
      * src/qemu/qemu_capabilities.c (virQEMUCapsCacheNew): Likewise.
      * src/qemu/qemu_command.c (qemuDomainCCWAddressSetCreate):
      Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorGetBlockInfo): Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      * src/util/virclosecallbacks.c (virCloseCallbacksNew): Likewise.
      * src/util/virkeyfile.c (virKeyFileParseGroup): Likewise.
      * tests/qemumonitorjsontest.c
      (testQemuMonitorJSONqemuMonitorJSONGetBlockInfo): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      09567144