1. 11 2月, 2016 1 次提交
    • J
      Prohibit verbose strcat · 28e5655d
      Ján Tomko 提交于
      Using strcat directly is more readable than passing strlen
      of the copied string to strncat.
      28e5655d
  2. 04 2月, 2016 1 次提交
  3. 03 2月, 2016 3 次提交
  4. 30 1月, 2016 1 次提交
  5. 29 1月, 2016 1 次提交
    • J
      logical: Fix comment examples for virStorageBackendLogicalFindLVs · 680030c4
      John Ferlan 提交于
      When commit id '82c1740a' made changes to the output format (changing from
      using a ',' separator to '#'), the examples in the lvs output from the
      comments weren't changed.
      
      Additionally, the two new fields added ('segtype' and 'stripes') were
      not included in the output, leaving it well confusing.
      
      This patch fixes the sample output, adds a 'striped' example, and makes
      other comment related adjustments for long line and spacing between followup
      'NB' remarks (while I'm there).
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      680030c4
  6. 17 12月, 2015 1 次提交
    • J
      storage: Fix startup issue for logical pool · 8c865052
      John Ferlan 提交于
      Commit id '71b803ac' assumed that the storage pool source device path
      was required for a 'logical' pool. This resulted in a failure to start
      a pool without any device path defined.
      
      So, adjust the virStorageBackendLogicalMatchPoolSource logic to
      return success if at least the pool name matches the vgs output
      when no pool source device path is/are provided.
      8c865052
  7. 16 12月, 2015 2 次提交
    • J
      storage: Add helper to compare logical pool def against pvs output · 71b803ac
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1025230
      
      Add a new helper virStorageBackendLogicalMatchPoolSource to compare the
      pool's source name against the output from a 'pvs' command to list all
      volume group physical volume data on the host.  In addition, compare the
      pool's source device list against the particular volume group's device
      list to ensure the source device(s) listed for the pool match what the
      was listed for the volume group.
      
      Then for pool startup or check API's we need to call this new API in
      order to ensure that the pool we're about to start or declare active
      during checkPool has a valid definition vs. the running host.
      71b803ac
    • J
      storage: Create helper for virStorageBackendLogicalFindPoolSources · ae5519f7
      John Ferlan 提交于
      Rework virStorageBackendLogicalFindPoolSources a bit to create a
      helper virStorageBackendLogicalGetPoolSources that will make the
      pvs call in order to generate a list of associated pv_name and vg_name's.
      
      A future patch will make use of this for start/check processing to
      ensure the storage pool source definition matches expectations.
      ae5519f7
  8. 10 12月, 2015 1 次提交
  9. 21 10月, 2015 1 次提交
  10. 14 10月, 2015 1 次提交
  11. 10 6月, 2015 1 次提交
  12. 26 5月, 2015 1 次提交
    • C
      storage: conf: Don't set any default <mode> in the XML · 7c2d65dd
      Cole Robinson 提交于
      The XML parser sets a default <mode> if none is explicitly passed in.
      This is then used at pool/vol creation time, and unconditionally reported
      in the XML.
      
      The problem with this approach is that it's impossible for other code
      to determine if the user explicitly requested a storage mode. There
      are some cases where we want to make this distinction, but we currently
      can't.
      
      Handle <mode> parsing like we handle <owner>/<group>: if no value is
      passed in, set it to -1, and adjust the internal consumers to handle
      it.
      7c2d65dd
  13. 02 4月, 2015 1 次提交
  14. 02 3月, 2015 1 次提交
  15. 17 12月, 2014 1 次提交
    • J
      logical: Add "--type snapshot" to lvcreate command · cafb934d
      John Ferlan 提交于
      A recent lvm change has resulted in a change for the "default" type of
      logical volume created when the "--virtualsize" or "--V" is supplied on
      the command line (e.g. when the allocation and capacity values of a to
      be created volume differ). It seems that at the very least the following
      change adjusts the default type:
      
      https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=e0164f21
      
      and the following may also have some impact.
      
      https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=87fc3b71
      
      When using the virsh vol-create-as or vol-create xmlfile commands, the
      result is that libvirt will now create a "thin logical volume" and a
      "thin logical volume pool" rather than just a "thin snapshot logical
      volume". For example the following sequence:
      
        # lvcreate --name test -L 2M -V 5M lvm_test
          Rounding up size to full physical extent 4.00 MiB
          Rounding up size to full physical extent 8.00 MiB
          Logical volume "test" created.
        # lvs lvm_test
          LV    VG       Attr       LSize Pool  Origin Data%  Meta%  Move Log Cpy%Sync Convert
          lvol1 lvm_test twi-a-tz-- 4.00m              0.00   0.98
          test  lvm_test Vwi-a-tz-- 8.00m lvol1        0.00
      
      compared to the former code which had the following:
      
          LV   VG       Attr       LSize  Pool Origin         Data%  Move Log Cpy%Sync Convert
          test LVM_Test swi-a-s---  4.00m      [test_vorigin]   0.00
      
      Since libvirt doesn't know how to parse the thin logical volume
      and pool, it will fail to find the newly created volume and pool
      even though it exists in the volume group.
      
      It cannot find since the command used to find/parse returns a thin volume
      'test' with no associated device, for example the output is:
      
        lvol1##UgUwkp-fTFP-C0rc-ufue-xrYh-dkPr-FGPFPx#lvol1_tdata(0)#thin-pool#1#4194304#4194304#4194304#twi-a-tz--
        test##NcaIoH-4YWJ-QKu3-sJc3-EOcS-goff-cThLIL##thin#0#8388608#4194304#8388608#Vwi-a-tz--
      
      as compared to the former which had the following:
      
            test#[test_vorigin]#Dt5Of3-4WE6-buvw-CWJ4-XOiz-ywOU-YULYw6#/dev/sda3(1300)#linear#1#4194304#4194304#4194304#swi-a-s---
      
      While it's possible to generate code to handle the new thin lv and pool, this
      patch will add a "--type snapshot" onto the lvcreate command libvirt uses
      in order to "for now" be able to continue to utilize the thin snapshots
      cafb934d
  16. 22 7月, 2014 1 次提交
    • R
      storage: logical: drop useless if · 53939d58
      Roman Bogorodskiy 提交于
      virStorageBackendLogicalCreateVol contains a piece like:
      
          if (vol->target.path != NULL) {
              /* A target path passed to CreateVol has no meaning */
              VIR_FREE(vol->target.path);
          }
      
      The 'if' is useless here, but 'syntax-check' doesn't catch that
      because of the comment, so drop the 'if'.
      53939d58
  17. 18 7月, 2014 1 次提交
    • J
      storage: Disallow vol_wipe for sparse logical volumes · 8a9f7cbe
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1091866
      
      Add a new boolean 'sparse'.  This will be used by the logical backend
      storage driver to determine whether the target volume is sparse or not
      (also known by a snapshot or thin logical volume). Although setting sparse
      to true at creation could be seen as duplicitous to setting during
      virStorageBackendLogicalMakeVol() in case there are ever other code paths
      between Create and FindLVs that need to know about the volume be sparse.
      
      Use the 'sparse' in a new virStorageBackendLogicalVolWipe() to decide whether
      to attempt to wipe the logical volume or not. For now, I have found no
      means to wipe the volume without writing to it. Writing to the sparse
      volume causes it to be filled. A sparse logical volume is not completely
      writeable as there exists metadata which if overwritten will cause the
      sparse lv to go INACTIVE which means pool-refresh will not find it.
      Access to whatever lvm uses to manage data blocks is not provided by
      any API I could find.
      8a9f7cbe
  18. 17 7月, 2014 1 次提交
  19. 16 7月, 2014 1 次提交
  20. 11 7月, 2014 1 次提交
  21. 02 5月, 2014 1 次提交
    • J
      Restore skipping of setting capacity · f1856eb6
      John Ferlan 提交于
      Commit id 'ac9a0963' refactored out the 'withCapacity' for the
      virStorageBackendUpdateVolInfo() API.  See:
      
      http://www.redhat.com/archives/libvir-list/2014-April/msg00043.html
      
      This resulted in a difference in how 'virsh vol-info --pool <poolName>
      <volume>' or 'virsh vol-list vol-list --pool <poolName> --details' outputs
      the capacity information for a directory pool with a qcow2 sparse file.
      
      For example, using the following XML
      
      mkdir /home/TestPool
      cat testpool.xml
      <pool type='dir'>
        <name>TestPool</name>
        <uuid>6bf80895-10b6-75a6-6059-89fdea2aefb7</uuid>
        <source>
        </source>
        <target>
          <path>/home/TestPool</path>
          <permissions>
            <mode>0755</mode>
            <owner>0</owner>
            <group>0</group>
          </permissions>
        </target>
      </pool>
      
      virsh pool-create testpool.xml
      virsh vol-create-as --pool TestPool temp_vol_1 \
            --capacity 1048576 --allocation 1048576 --format qcow2
      virsh vol-info --pool TestPool temp_vol_1
      
      Results in listing a Capacity value.  Prior to the commit, the value would
      be '1.0 MiB' (1048576 bytes). However, after the commit the output would be
      (for example) '192.50 KiB', which for my system was the size of the volume
      in my file system (eg 'ls -l TestPool/temp_vol_1' results in '197120' bytes
      or 192.50 KiB). While perhaps technically correct, it's not necessarily
      what the user expected (certainly virt-test didn't expect it).
      
      This patch restores the code to not update the target capacity for this path
      f1856eb6
  22. 02 4月, 2014 3 次提交
    • E
      conf: drop redundant parameters during probe · ac9a0963
      Eric Blake 提交于
      Now that each virStorageSource can track allocation information,
      and given that we already have the information without extra
      syscalls, it's easier to just always populate the information
      directly into the struct than it is to sometimes pass the address
      of the struct members down the call chain.
      
      * src/storage/storage_backend.h (virStorageBackendUpdateVolInfo)
      (virStorageBackendUpdateVolTargetInfo)
      (virStorageBackendUpdateVolTargetInfoFD): Update signature.
      * src/storage/storage_backend.c (virStorageBackendUpdateVolInfo)
      (virStorageBackendUpdateVolTargetInfo)
      (virStorageBackendUpdateVolTargetInfoFD): Always populate struct
      members instead.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskMakeDataVol): Update client.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget)
      (virStorageBackendFileSystemRefresh)
      (virStorageBackendFileSystemVolRefresh): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageBackendGlusterRefreshVol): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalMakeVol): Likewise.
      * src/storage/storage_backend_mpath.c
      (virStorageBackendMpathNewVol): Likewise.
      * src/storage/storage_backend_scsi.c
      (virStorageBackendSCSINewLun): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ac9a0963
    • 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: 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
  23. 01 4月, 2014 3 次提交
  24. 25 3月, 2014 1 次提交
  25. 21 3月, 2014 1 次提交
  26. 18 3月, 2014 1 次提交
  27. 10 3月, 2014 1 次提交
  28. 12 2月, 2014 1 次提交
  29. 16 1月, 2014 1 次提交
  30. 10 1月, 2014 1 次提交
  31. 21 10月, 2013 1 次提交
  32. 16 10月, 2013 1 次提交
    • D
      Ignore thin pool LVM devices. · 4132dede
      Dusty Mabe 提交于
      This should resolve:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=924672
      
      For BZ 924672 the problem stems from the fact that thin pool logical
      volume devices show up in /sbin/lvs output just like normal logical
      volumes do. Libvirt incorrectly assumes they are just normal logical
      volumes and that they will have a corresponding /dev/vgname/lvname
      device that has been created by udev and tries to use this device.
      
      To illustrate here is an example of the /dev/vgname/ directory and
      the lvs output for a normal lv, thin lv, and thin pool:
      
          LV     VG       Attr      LSize  Pool Origin Data%  Move Log Copy%  Convert
          lv     vgguests -wi-a----  1.00g
          pool   vgguests twi-a-tz- 11.00g               0.00
          thinlv vgguests Vwi-a-tz-  1.00g pool          0.00
      total 0
      lrwxrwxrwx. 1 root root 7 Oct  8 19:35 lv -> ../dm-7
      lrwxrwxrwx. 1 root root 7 Oct  8 19:37 thinlv -> ../dm-6
      
      This patch modifies virStorageBackendLogicalMakeVol() to ignore thin pool
      devices.
      4132dede
  33. 16 9月, 2013 1 次提交