1. 01 12月, 2014 1 次提交
  2. 15 11月, 2014 1 次提交
  3. 12 11月, 2014 3 次提交
    • J
      storage: Introduce 'managed' for the fchost parent · 5530f248
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160926
      
      Introduce a 'managed' attribute to allow libvirt to decide whether to
      delete a vHBA vport created via external means such as nodedev-create.
      The code currently decides whether to delete the vHBA based solely on
      whether the parent was provided at creation time. However, that may not
      be the desired action, so rather than delete and force someone to create
      another vHBA via an additional nodedev-create allow the configuration of
      the storage pool to decide the desired action.
      
      During createVport when libvirt does the VPORT_CREATE, set the managed
      value to YES if not already set to indicate to the deleteVport code that
      it should delete the vHBA when the pool is destroyed.
      
      If libvirtd is restarted all the memory only state was lost, so for a
      persistent storage pool, use the virStoragePoolSaveConfig in order to
      write out the managed value.
      
      Because we're now saving the current configuration, we need to be sure
      to not save the parent in the output XML if it was undefined at start.
      Saving the name would cause future starts to always use the same parent
      which is not the expected result when not providing a parent. By not
      providing a parent, libvirt is expected to find the best available
      vHBA port for each subsequent (re)start.
      
      At deleteVport, use the new managed value to decide whether to execute
      the VPORT_DELETE.  Since we no longer save the parent in memory or in
      XML when provided, if it was not provided, then we have to look it up.
      5530f248
    • J
      storage: Introduce virStoragePoolSaveConfig · 523c6908
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160926
      
      Introduce the ability to save a configuration of a persistent configuration
      that may be changed by storage pool backend activity, such as start or stop
      523c6908
    • J
      storage: Don't use a stack copy of the adapter · 5b226fcd
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160926
      
      Passing a copy of the storage pool adapter to a function just changes the
      copy of the fields in the particular function and then when returning to
      the caller those changes are discarded.  While not yet biting us in the
      storage clean-up case, it did cause an issue for the fchost storage pool
      startup case, createVport.  The issue was at startup, if no parent is found
      in the XML, the code will search for the 'best available' parent and then
      store that in the in memory copy of the adapter.  Of course, in this case
      it was a copy, so when returning to the virStorageBackendSCSIStartPool that
      change was discarded (or lost) from the pool->def->source.adapter which
      meant at shutdown (deleteVport), the code assumed no adapter was passed
      and skipped the deletion, leaving the vHBA created by libvirt still defined
      requiring an additional stop of a nodedev-destroy to remove.
      
      Adjusted the createVport to take virStoragePoolDefPtr instead of the
      adapter copy. Then use the virStoragePoolSourceAdapterPtr when processing.
      A future patch will need the 'def' anyway, so this just sets up for that.
      5b226fcd
  4. 01 11月, 2014 2 次提交
    • J
      Relax duplicate SCSI host pool checking · 59389231
      Ján Tomko 提交于
      Since commit 3f99d64d no new scsi_host pools can be defined
      if one of the already defined scsi_host pools does not refer
      to an accessible scsi_host adapter.
      
      Relax the check by skipping over these inaccessible pools
      when checking for duplicates.
      59389231
    • J
      Match scsi_host pools by parent address first · 77911d30
      Ján Tomko 提交于
      If both source adapters are specified by a parent address,
      just comparing the address is faster and catches even addresses
      that do not refer to valid adapters.
      77911d30
  5. 29 10月, 2014 1 次提交
    • J
      storage_conf: Resolve libvirtd crash matching scsi_host · 3f99d64d
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1146837
      
      Resolve a crash in libvirtd resulting from commit id 'a4bd62ad' (1.0.6)
      which added parentaddr and unique_id to allow unique identification of
      a scsi_host, but assumed that all the pool entries and the incoming
      definition would be similarly defined. If the existing pool uses the
      'name' attribute and an incoming pool is using the parentaddr/unique_id,
      then the code will attempt to compare the existing name string against
      the incoming name string which doesn't exist (is NULL) and results in
      a core (STREQ).
      
      Conversely, if the existing pool used the parentaddr/unique_id and the
      to be defined pool used the name, then the comparison would be against
      the parentaddr, but since the incoming pool doesn't have one - that would
      leave the comparison against a parentaddr of all 0's and a unique_id of 0,
      which will always comparison to fail. This means someone could define the
      same source adapter for two pools
      
      In order to resolve this, adjust the code to get the 'host#' to be used
      by the storage scsi backend in order to check/start the pool and make sure
      the incoming definition doesn't match any of the existing pool defs.
      3f99d64d
  6. 18 9月, 2014 1 次提交
    • R
      storage: zfs: implement pool build and delete · b4af4022
      Roman Bogorodskiy 提交于
       - Provide an implementation for buildPool and deletePool operations
         for the ZFS storage backend.
       - Add VIR_STORAGE_POOL_SOURCE_DEVICE flag to ZFS pool poolOptions
         as now we can specify devices to build pool from
       - storagepool.rng: add an optional 'sourceinfodev' to 'sourcezfs' and
         add an optional 'target' to 'poolzfs' entity
       - Add a couple of tests to storagepoolxml2xmltest
      b4af4022
  7. 06 9月, 2014 1 次提交
    • P
      storage_conf: Fix libvirtd crash when defining scsi storage pool · 119b6dfc
      Pradipta Kr. Banerjee 提交于
      Since 9f781da6
      
      Resolve a libvirtd crash in virStoragePoolSourceFindDuplicate()
      when there is an existing SCSI pool defined with adapter type as
      'scsi_host' and defining a new SCSI pool with adapter type as
      'fc_host' and parent attribute missing or vice versa.
      
      For example, if there is an existing SCSI pool with adapter type
      as 'scsi_host' defined using the following XML
      
      <pool type='scsi'>
        <name>TEST_SCSI_POOL</name>
          <source>
             <adapter type='scsi_host' name='scsi_host1'/>
          </source>
          <target>
              <path>/dev/disk/by-path</path>
          </target>
      </pool>
      
      When defining another SCSI pool with adapter type as 'fc_host' using the
      following XML will crash libvirtd
      
      <pool type='scsi'>
        <name>TEST_SCSI_FC_POOL</name>
        <source>
           <adapter type='fc_host' wwnn='1234567890abcdef' wwpn='abcdef1234567890'/>
        </source>
        <target>
           <path>/dev/disk/by-path</path>
        </target>
      </pool>
      
      Same is true for the reverse case as well where there exists a SCSI pool
      with adapter type as 'fc_host' and another SCSI pool is defined with
      adapter type as 'scsi_host'.
      
      This happens because for fc_host 'name' is optional attribute whereas for
      scsi_host its mandatory. However the check in libvirt for finding duplicate
      storage pools didn't take that into account while comparing
      Signed-off-by: NPradipta Kr. Banerjee <bpradip@in.ibm.com>
      119b6dfc
  8. 28 8月, 2014 1 次提交
  9. 20 8月, 2014 1 次提交
  10. 12 8月, 2014 1 次提交
    • R
      storage: ZFS support · 0257d06b
      Roman Bogorodskiy 提交于
      Implement ZFS storage backend driver. Currently supported
      only on FreeBSD because of ZFS limitations on Linux.
      
      Features supported:
      
       - pool-start, pool-stop
       - pool-info
       - vol-list
       - vol-create / vol-delete
      
      Pool definition looks like that:
      
       <pool type='zfs'>
        <name>myzfspool</name>
        <source>
          <name>actualpoolname</name>
        </source>
       </pool>
      
      The 'actualpoolname' value is a name of the pool on the system,
      such as shown by 'zpool list' command. Target makes no sense
      here because volumes path is always /dev/zvol/$poolname/$volname.
      
      User has to create a pool on his own, this driver doesn't
      support pool creation currently.
      
      A volume could be used with Qemu by adding an entry like this:
      
          <disk type='volume' device='disk'>
            <driver name='qemu' type='raw'/>
            <source pool='myzfspool' volume='vol5'/>
            <target dev='hdc' bus='ide'/>
          </disk>
      0257d06b
  11. 22 7月, 2014 2 次提交
    • O
      storage: Introduce parentaddr into virStoragePoolSourceAdapter · a4bd62ad
      Osier Yang 提交于
      Between reboots and kernel reloads, the SCSI host number used for SCSI
      storage pools may change requiring modification to the storage pool XML
      in order to use a specific SCSI host adapter.
      
      This patch introduces the "parentaddr" element and "unique_id" attribute
      for the SCSI host adapter in order to uniquely identify the adapter
      between reboots and kernel reloads. For now the goal is to only parse
      and format the XML. Both will be required to be provided in order to
      uniquely identify the desired SCSI host.
      
      The new XML is expected to be as follows:
      
        <adapter type='scsi_host'>
          <parentaddr unique_id='3'>
            <address domain='0x0000' bus='0x00' slot='0x1f' func='0x2'/>
          </parentaddr>
        </adapter>
      
      where "parentaddr" is the parent device of the SCSI host using the PCI
      address on which the device resides and the value from the unique_id file
      for the device. Both the PCI address and unique_id values will be used
      to traverse the /sys/class/scsi_host/ directories looking at each link
      to match the PCI address reformatted to the directory link format where
      "domain:bus:slot:function" is found.  Then for each matching directory
      the unique_id file for the scsi_host will be used to match the unique_id
      value in the xml.
      
      For a PCI address listed above, this will be formatted to "0000:00:1f.2"
      and the links in /sys/class/scsi_host will be used to find the host#
      to be used for the 'scsi_host' device. Each entry is a link to the
      /sys/bus/pci/devices directories, e.g.:
      
      %  ls -al /sys/class/scsi_host/host2
      lrwxrwxrwx. 1 root root 0 Jun  1 00:22 /sys/class/scsi_host/host2 -> ../../devices/pci0000:00/0000:00:1f.2/ata3/host2/scsi_host/host2
      
      % cat /sys/class/scsi_host/host2/unique_id
      3
      
      The "parentaddr" and "name" attributes are mutually exclusive to identify
      the SCSI host number. Use of the "parentaddr" element will be the preferred
      mechanism.
      
      This patch only supports to parse and format the XMLs. Later patches will
      add code to find out the scsi host number.
      a4bd62ad
    • O
      virStoragePoolSourceAdapter: Refine the SCSI_HOST adapter name · 53f62056
      Osier Yang 提交于
      Preparation for future patches by creating a scsi_host union. For now,
      just the 'name' will be present.
      53f62056
  12. 16 7月, 2014 2 次提交
    • C
      storagevol: add nocow to vol xml · a9fd30e6
      Chunyan Liu 提交于
      Add 'nocow' to storage volume xml so that user can have an option
      to set NOCOW flag to the newly created volume. It's useful on btrfs
      file system to enhance performance.
      
      Btrfs has low performance when hosting VM images, even more when the guest
      in those VM are also using btrfs as file system. One way to mitigate this
      bad performance is to turn off COW attributes on VM files. Generally, there
      are two ways to turn off COW on btrfs: a) by mounting fs with nodatacow,
      then all newly created files will be NOCOW. b) per file. Add the NOCOW file
      attribute. It could only be done to empty or new files.
      
      This patch tries the second way, according to 'nocow' option, it could set
      NOCOW flag per file:
      for raw file images, handle 'nocow' in libvirt code; for non-raw file images,
      pass 'nocow=on' option to qemu-img, and let qemu-img to handle that (requires
      qemu-img version >= 2.1).
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      a9fd30e6
    • P
      storage: Track backing store of a volume in the target struct · 15213d1e
      Peter Krempa 提交于
      As we have a nested pointer for storing the backing store of a volume
      there's no need to store it in a separate struct.
      15213d1e
  13. 12 7月, 2014 1 次提交
  14. 04 7月, 2014 1 次提交
    • J
      Utilize virDomainDiskAuth for storage pools · 97e3397c
      John Ferlan 提交于
      Replace the authType, chap, and cephx unions in virStoragePoolSource
      with a single pointer to a virStorageAuthDefPtr.  Adjust all users of
      the previous chap/cephx and secret unions with the source->auth data.
      97e3397c
  15. 03 7月, 2014 1 次提交
    • J
      Use virBufferCheckError everywhere we report OOM error · 92a8e72f
      Ján Tomko 提交于
      Replace:
      if (virBufferError(&buf)) {
          virBufferFreeAndReset(&buf);
          virReportOOMError();
          ...
      }
      
      with:
      if (virBufferCheckError(&buf) < 0)
          ...
      
      This should not be a functional change (unless some callers
      misused the virBuffer APIs - a different error would be reported
      then)
      92a8e72f
  16. 01 7月, 2014 1 次提交
  17. 16 5月, 2014 1 次提交
    • E
      maint: shorten 'TypeType' function names · ab517818
      Eric Blake 提交于
      The VIR_ENUM_DECL/VIR_ENUM_IMPL helper macros already append 'Type'
      to the enum name being converted; it looks silly to have functions
      with 'TypeType' in their name.  Even though some of our enums have
      to have a 'Type' suffix, the corresponding string conversion
      functions do not.
      
      * src/conf/secret_conf.h (VIR_ENUM_DECL): Rename virSecretUsageType.
      * src/conf/storage_conf.h (VIR_ENUM_DECL): Rename
      virStoragePoolAuthType, virStoragePoolSourceAdapterType,
      virStoragePartedFsType.
      * src/conf/domain_conf.c (virDomainDiskDefParseXML)
      (virDomainFSDefParseXML, virDomainFSDefFormat): Update callers.
      * src/conf/secret_conf.c (virSecretDefParseUsage)
      (virSecretDefFormatUsage): Likewise.
      * src/conf/storage_conf.c (virStoragePoolDefParseAuth)
      (virStoragePoolDefParseSource, virStoragePoolSourceFormat):
      Likewise.
      * src/lxc/lxc_controller.c (virLXCControllerSetupLoopDevices):
      Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskPartFormat): Likewise.
      * src/util/virstorageencryption.c (virStorageEncryptionSecretParse)
      (virStorageEncryptionSecretFormat): Likewise.
      * tools/virsh-secret.c (cmdSecretList): Likewise.
      * src/libvirt_private.syms (secret_conf.h, storage_conf.h): Export
      corrected names.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ab517818
  18. 29 4月, 2014 1 次提交
    • E
      conf: use virDirRead API · 6b9f40e8
      Eric Blake 提交于
      When reading configuration files, we were silently ignoring
      directory read failures.  While unlikely, we might as well
      report them.
      
      * src/conf/domain_conf.c (virDomainObjListLoadAllConfigs): Report
      readdir errors.
      * src/conf/network_conf.c (virNetworkLoadAllState)
      (virNetworkLoadAllConfigs): Likewise.
      * src/conf/nwfilter_conf.c (virNWFilterLoadAllConfigs): Likewise.
      * src/conf/storage_conf.c (virStoragePoolLoadAllConfigs):
      Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6b9f40e8
  19. 02 4月, 2014 3 次提交
    • E
      conf: track sizes directly in source struct · cce2410a
      Eric Blake 提交于
      One of the features of qcow2 is that a wrapper file can have
      more capacity than its backing file from the guest's perspective;
      what's more, sparse files make tracking allocation of both
      the active and backing file worthwhile.  As such, it makes
      more sense to show allocation numbers for each file in a chain,
      and not just the top-level file.  This sets up the fields for
      the tracking, although it does not modify XML to display any
      new information.
      
      * src/util/virstoragefile.h (_virStorageSource): Add fields.
      * src/conf/storage_conf.h (_virStorageVolDef): Drop redundant
      fields.
      * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom)
      (createRawFile, virStorageBackendCreateQemuImgCmd)
      (virStorageBackendCreateQcowCreate): Update clients.
      * src/storage/storage_driver.c (storageVolDelete)
      (storageVolCreateXML, storageVolCreateXMLFrom, storageVolResize)
      (storageVolWipeInternal, storageVolGetInfo): Likewise.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget)
      (virStorageBackendFileSystemRefresh)
      (virStorageBackendFileSystemVolResize)
      (virStorageBackendFileSystemVolRefresh): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalMakeVol)
      (virStorageBackendLogicalCreateVol): Likewise.
      * src/storage/storage_backend_scsi.c
      (virStorageBackendSCSINewLun): Likewise.
      * src/storage/storage_backend_mpath.c
      (virStorageBackendMpathNewVol): Likewise.
      * src/storage/storage_backend_rbd.c
      (volStorageBackendRBDRefreshVolInfo)
      (virStorageBackendRBDCreateImage): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskMakeDataVol)
      (virStorageBackendDiskCreateVol): Likewise.
      * src/storage/storage_backend_sheepdog.c
      (virStorageBackendSheepdogBuildVol)
      (virStorageBackendSheepdogParseVdiList): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageBackendGlusterRefreshVol): Likewise.
      * src/conf/storage_conf.c (virStorageVolDefFormat)
      (virStorageVolDefParseXML): Likewise.
      * src/test/test_driver.c (testOpenVolumesForPool)
      (testStorageVolCreateXML, testStorageVolCreateXMLFrom)
      (testStorageVolDelete, testStorageVolGetInfo): Likewise.
      * src/esx/esx_storage_backend_iscsi.c (esxStorageVolGetXMLDesc):
      Likewise.
      * src/esx/esx_storage_backend_vmfs.c (esxStorageVolGetXMLDesc)
      (esxStorageVolCreateXML): Likewise.
      * src/parallels/parallels_driver.c (parallelsAddHddByVolume):
      Likewise.
      * src/parallels/parallels_storage.c (parallelsDiskDescParseNode)
      (parallelsStorageVolDefineXML, parallelsStorageVolCreateXMLFrom)
      (parallelsStorageVolDefRemove, parallelsStorageVolGetInfo):
      Likewise.
      * src/vbox/vbox_tmpl.c (vboxStorageVolCreateXML)
      (vboxStorageVolGetXMLDesc): Likewise.
      * tests/storagebackendsheepdogtest.c (test_vdi_list_parser):
      Likewise.
      * src/phyp/phyp_driver.c (phypStorageVolCreateXML): Likewise.
      cce2410a
    • E
      conf: use common struct in storage volumes · df176115
      Eric Blake 提交于
      A fairly smooth transition.  And now that domain disks and
      storage volumes share a common struct, it opens the doors for
      a future patch to expose more details in the XML for both
      objects.
      
      * src/conf/storage_conf.h (_virStorageVolTarget): Delete.
      (_virStorageVolDef): Use common type.
      * src/conf/storage_conf.c (virStorageVolDefFree)
      (virStorageVolTargetDefFormat): Update clients.
      * src/storage/storage_backend.h: Likewise.
      * src/storage/storage_backend.c
      (virStorageBackendDetectBlockVolFormatFD)
      (virStorageBackendUpdateVolTargetInfo)
      (virStorageBackendUpdateVolTargetInfoFD): Likewise.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      df176115
    • E
      conf: tweak volume target struct details · dae1568c
      Eric Blake 提交于
      Some preparatory work before consolidating storage volume
      structs with the rest of virstoragefile.  Making these
      changes allows a volume target to be much closer to (a
      subset of) the virStorageSource struct.
      
      Making perms be a pointer allows it to be optional if we
      have a storage pool that doesn't expose permissions in a
      way we can access.  It also allows future patches to
      optionally expose permissions details learned about a disk
      image via domain <disk> listings, rather than just
      limiting it to storage volume listings.
      
      Disk partition types was only used by internal code to
      control what type of partition to create when carving up
      an MS-DOS partition table storage pool (and is not used
      for GPT partition tables or other storage pools).  It was
      not exposed in volume XML, and as it is more closely
      related to extent information of the overall block device
      than it is to the <target> information describing the host
      file.  Besides, if we ever decide to expose it in XML down
      the road, we can move it back as needed.
      
      * src/conf/storage_conf.h (_virStorageVolTarget): Change perms to
      pointer, enhance comments.  Move partition type...
      (_virStorageVolSource): ...here.
      * src/conf/storage_conf.c (virStorageVolDefFree)
      (virStorageVolDefParseXML, virStorageVolTargetDefFormat): Update
      clients.
      * src/storage/storage_backend_fs.c (createFileDir): Likewise.
      * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom)
      (virStorageBackendCreateRaw, virStorageBackendCreateExecCommand)
      (virStorageBackendUpdateVolTargetInfoFD): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalCreateVol): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskMakeDataVol)
      (virStorageBackendDiskPartTypeToCreate): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      dae1568c
  20. 31 3月, 2014 1 次提交
  21. 25 3月, 2014 1 次提交
  22. 18 3月, 2014 1 次提交
  23. 14 3月, 2014 1 次提交
  24. 12 3月, 2014 2 次提交
  25. 10 3月, 2014 1 次提交
    • M
      conf: Utilize more of VIR_(APPEND|INSERT|DELETE)_ELEMENT · 2133441a
      Michal Privoznik 提交于
      This fixes a possible double free. In virNetworkAssignDef() if
      virBitmapNew() fails, then virNetworkObjFree(network) is called.
      However, with network->def pointing to actual @def. So if caller
      frees @def again, ...
      
      Moreover, this fixes one possible memory leak too. In
      virInterfaceAssignDef() if appending to the list of interfaces
      fails, we ought to call virInterfaceObjFree() instead of bare
      VIR_FREE().
      
      Although, in order to do that some array size variables needs
      to be turned into size_t rather than int.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2133441a
  26. 15 2月, 2014 1 次提交
  27. 16 1月, 2014 2 次提交
    • P
      storage: Introduce internal pool support · 362da820
      Peter Krempa 提交于
      To allow using the storage driver APIs to do operation on generic domain
      disks we will need to introduce internal storage pools that will give is
      a base to support this stuff even on files that weren't originally
      defined as a part of the pool.
      
      This patch introduces the 'internal' flag for a storage pool that will
      prevent it from being listed along with the user defined storage pools.
      362da820
    • C
      conf: Always use VIR_ERR_CONFIG_UNSUPPORTED on enumFromString() failures · 9b73290f
      Christophe Fergeau 提交于
      Currently, during XML parsing, when a call to a FromString() function to
      get an enum value fails, the error which is reported is either
      VIR_ERR_CONFIG_UNSUPPORTED, VIR_ERR_INTERNAL_ERROR or VIR_ERR_XML_ERROR.
      
      This commit makes such conversion failures consistently return
      VIR_ERR_CONFIG_UNSUPPORTED.
      9b73290f
  28. 19 12月, 2013 1 次提交
    • P
      storage: Add gluster pool filter and fix virsh pool listing · b560946c
      Peter Krempa 提交于
      Recent addition of the gluster pool type omitted fixing the virsh and
      virConnectListAllStoragePool filters. A typecast of the converting
      function in virsh showed that also the sheepdog pool was omitted in the
      command parser.
      
      This patch adds gluster pool filtering support and fixes virsh to
      properly convert all supported storage pool types. The added typecast
      should avoid doing such mistakes in the future.
      b560946c
  29. 26 11月, 2013 3 次提交
    • E
      storage: add network-dir as new storage volume type · ecd881b7
      Eric Blake 提交于
      In the 'directory' and 'netfs' storage pools, a user can see
      both 'file' and 'dir' storage volume types, to know when they
      can descend into a subdirectory.  But in a network-based storage
      pool, such as the upcoming 'gluster' pool, we use 'network'
      instead of 'file', and did not have any counterpart for a
      directory until this patch.  Adding a new volume type
      'network-dir' is better than reusing 'dir', because it makes
      it clear that the only way to access 'network' volumes within
      that container is through the network mounting (leaving 'dir'
      for something accessible in the local file system).
      
      * include/libvirt/libvirt.h.in (virStorageVolType): Expand enum.
      * docs/formatstorage.html.in: Document it.
      * docs/schemasa/storagevol.rng (vol): Allow new value.
      * src/conf/storage_conf.c (virStorageVol): Use new value.
      * src/qemu/qemu_command.c (qemuBuildVolumeString): Fix client.
      * src/qemu/qemu_conf.c (qemuTranslateDiskSourcePool): Likewise.
      * tools/virsh-volume.c (vshVolumeTypeToString): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemVolDelete): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ecd881b7
    • E
      storage: initial support for linking with libgfapi · 318ea3cb
      Eric Blake 提交于
      We support gluster volumes in domain XML, so we also ought to
      support them as a storage pool.  Besides, a future patch will
      want to take advantage of libgfapi to handle the case of a
      gluster device holding qcow2 rather than raw storage, and for
      that to work, we need a storage backend that can read gluster
      storage volume contents.  This sets up the framework.
      
      Note that the new pool is named 'gluster' to match a
      <disk type='network'><source protocol='gluster'> image source
      already supported in a <domain>; it does NOT match the
      <pool type='netfs'><source><target type='glusterfs'>,
      since that uses a FUSE mount to a local file name rather than
      a network name.
      
      This and subsequent patches have been tested against glusterfs
      3.4.1 (available on Fedora 19); there are likely bugs in older
      versions that may prevent decent use of gfapi, so this patch
      enforces the minimum version tested.  A future patch may lower
      the minimum.  On the other hand, I hit at least two bugs in
      3.4.1 that will be fixed in 3.5/3.4.2, where it might be worth
      raising the minimum: glfs_readdir is nicer to use than
      glfs_readdir_r [1], and glfs_fini should only return failure on
      an actual failure [2].
      
      [1] http://lists.gnu.org/archive/html/gluster-devel/2013-10/msg00085.html
      [2] http://lists.gnu.org/archive/html/gluster-devel/2013-10/msg00086.html
      
      * configure.ac (WITH_STORAGE_GLUSTER): New conditional.
      * m4/virt-gluster.m4: new file.
      * libvirt.spec.in (BuildRequires): Support gluster in spec file.
      * src/conf/storage_conf.h (VIR_STORAGE_POOL_GLUSTER): New pool
      type.
      * src/conf/storage_conf.c (poolTypeInfo): Treat similar to
      sheepdog and rbd.
      (virStoragePoolDefFormat): Don't output target for gluster.
      * src/storage/storage_backend_gluster.h: New file.
      * src/storage/storage_backend_gluster.c: Likewise.
      * po/POTFILES.in: Add new file.
      * src/storage/storage_backend.c (backends): Register new type.
      * src/Makefile.am (STORAGE_DRIVER_GLUSTER_SOURCES): Build new files.
      * src/storage/storage_backend.h (_virStorageBackend): Documet
      assumption.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      318ea3cb
    • E
      storage: expose volume meta-type in XML · 1b5c8d4c
      Eric Blake 提交于
      I got annoyed at having to use both 'virsh vol-list $pool --details'
      AND 'virsh vol-dumpxml $vol $pool' to learn if I had populated
      the volume correctly.  Since two-thirds of the data present in
      virStorageVolGetInfo() already appears in virStorageVolGetXMLDesc(),
      this just adds the remaining piece of information, as:
      
      <volume type='...'>
        ...
      </volume>
      
      * docs/formatstorage.html.in: Document new <volume type=...>.
      * docs/schemas/storagevol.rng (vol): Add it to RelaxNG.
      * src/conf/storage_conf.h (virStorageVolTypeToString): Declare.
      * src/conf/storage_conf.c (virStorageVolTargetDefFormat): Output
      the metatype.
      (virStorageVolDefParseXML): Parse it, for unit tests.
      * tests/storagevolxml2xmlout/vol-*.xml: Update tests to match.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1b5c8d4c