1. 18 3月, 2016 1 次提交
    • J
      conf: Format disk pool part_separator attribute for running pool · efb5e46b
      John Ferlan 提交于
      Commit id '4f846170' added printing of a new field 'part_separator';
      however, neglected to do so when there was an "freeExtent" defined
      for the device (as there would be when the disk pool was started).
      
      This patch adjusts the logic to appropriately format the device path and
      if there the part_separator attribute.
      efb5e46b
  2. 26 2月, 2016 1 次提交
    • J
      storage: Fix error path in virStoragePoolObjLoad · c53e4ae0
      John Ferlan 提交于
      While reviewing how storage driver used ObjListPtr's for reference
      in some recent secret driver patches to use the same mechanism, I came
      across an instance where the wrong API was called for error paths after
      successfully allocating the storage pool pointer and inserting into
      the driver pool list.
      
      The path is after virStoragePoolObjAssignDef succeeds - the 'def' passed
      in is assigned to pool->def (or newDef) so it shouldn't be the only thing
      deleted. The pool is now part of driver->pools.objs, so it would need to
      be removed (as happens in the storagePoolCreateXML error paths).
      
      Rather than calling virStoragePoolDefFree to free the def which is now
      assigned to the pool, call virStoragePoolObjRemove to ensure the pool
      element is removed from the driver list and that anything stored in pool
      is properly handled by virStoragePoolObjFree including the call to
      virStoragePoolDefFree for the pool->{def|newDef} element.
      c53e4ae0
  3. 20 1月, 2016 1 次提交
    • J
      conf: Add storage pool device attribute part_separator · 4f846170
      John Ferlan 提交于
      Add a new storage pool source device attribute 'part_separator=[yes|no]'
      in order to allow a 'disk' storage pool using a device mapper multipath
      device to not add the "p" partition separator to the generated device
      name when libvirt_parthelper is run.
      
      This will allow libvirt to find device mapper multipath devices which were
      configured in /etc/multipath.conf to use 'user_friendly_names' or custom
      'alias' names for the LUN.
      4f846170
  4. 04 1月, 2016 1 次提交
    • W
      rbd: Return VIR_STORAGE_FILE_RAW as format for RBD volumes · 688623b5
      Wido den Hollander 提交于
      This used to return 'unkown' and that was not correct.
      
      A vol-dumpxml now returns:
      
      <volume type='network'>
        <name>image3</name>
        <key>libvirt/image3</key>
        <source>
        </source>
        <capacity unit='bytes'>10737418240</capacity>
        <allocation unit='bytes'>10737418240</allocation>
        <target>
          <path>libvirt/image3</path>
          <format type='raw'/>
        </target>
      </volume>
      
      The RBD driver will now error out if a different format than RAW
      is provided when creating a volume.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      688623b5
  5. 21 10月, 2015 1 次提交
  6. 30 6月, 2015 2 次提交
  7. 04 6月, 2015 1 次提交
  8. 29 5月, 2015 1 次提交
    • J
      Properly free the xmlDocPtr when loading pool state · 5aa72904
      Ján Tomko 提交于
      Use xmlFreeDoc instead of plain xmlFree.
      
      4 bytes in 1 blocks are definitely lost in loss record 9 of 1,084
          at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
          by 0x70730D6: xmlStrndup (in /usr/lib64/libxml2.so.2.9.2)
          by 0x701E3DC: xmlNewDoc (in /usr/lib64/libxml2.so.2.9.2)
          by 0x70C39F8: xmlSAX2StartDocument (in /usr/lib64/libxml2.so.2.9.2)
          by 0x7017245: xmlParseDocument (in /usr/lib64/libxml2.so.2.9.2)
          by 0x7017606: xmlDoRead (in /usr/lib64/libxml2.so.2.9.2)
          by 0x5309DAD: virXMLParseHelper (virxml.c:742)
          by 0x5367584: virStoragePoolLoadState (storage_conf.c:1863)
      5aa72904
  9. 26 5月, 2015 2 次提交
    • C
      conf: storage: Don't emit empty <permissions> block · 42dd6a99
      Cole Robinson 提交于
      42dd6a99
    • 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
  10. 22 5月, 2015 1 次提交
  11. 13 5月, 2015 2 次提交
    • J
      conf: Remove source host name check for iSCSI · 4b2b53f6
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1171984
      https://bugzilla.redhat.com/show_bug.cgi?id=1188463
      
      Remove the check for the source host name for iSCSI source XML processing
      declaring duplicate sources when the source device path and if present the
      initiator of a proposed storage pool matches an existing storage pool.
      
      The backend iSCSI storage driver uses 'iscsiadm --mode session' to query
      available iscsid target sessions. The output displayed is the IP address
      and the IQN (target path) of known targets. The displayed IP address
      is a resolved address based on the session --login. Additionally, iscsid
      keeps track of the various ways to define the host name (IPv4 Address,
      IPv6 Address, /etc/hosts, etc.) for that IQN (see output of an 'iscsiadm
      --mode node'). If an incoming IQN matches and the host name provided by
      libvirt is resolved to the existing IQN, then iscsid will "reuse" the
      session. Although libvirt could do the same name resolution, if there
      is a difference, iscsid could still declare two seemingly different sources
      to be the same and not create a new session which means libvirt now has
      two storage pools looking at the same source. Thus to avoid any strange
      host name resolution issues, just rely on iscsid for that and do not
      allow multiple pools on the same host to use the same device path (IQN).
      4b2b53f6
    • J
      conf: Adjust duplicate source host port check · 6dd9297c
      John Ferlan 提交于
      Only perform the port number check if the incoming definition actually
      provides it. Since the port number is optional we could erroneously pass
      a duplicate source host check since some storage pool backends which fill
      in the default port number (e.g., iSCSI and sheepdog) for the started pool.
      6dd9297c
  12. 15 4月, 2015 8 次提交
  13. 13 4月, 2015 2 次提交
  14. 07 4月, 2015 1 次提交
  15. 03 4月, 2015 2 次提交
    • E
      conf: Introduce virStoragePoolSaveState · 39b183b4
      Erik Skultety 提交于
      Introduce virStoragePoolSaveState to properly format the state XML in
      the same manner as virStoragePoolDefFormat, except for adding a
      <poolstate> ... </poolstate> around the definition. This is similar to
      virNetworkObjFormat used to save the live/active network information.
      39b183b4
    • E
      conf: Introduce virStoragePoolDefFormatBuf · 6ae11909
      Erik Skultety 提交于
      When modifying config/status XML, it might be handy to include some
      additional XML elements (e.g. <poolstate>). In order to do so,
      introduce new formatting function virStoragePoolDefFormatBuf and make
      virStoragePoolDefFormat call it.
      6ae11909
  16. 02 4月, 2015 1 次提交
    • E
      conf: Introduce virStoragePoolSaveXML · 22592a3f
      Erik Skultety 提交于
      Make XML definition saving more generic by moving the common code into
      virStoragePoolSaveXML and leave case specific code to
      PoolSave{Status,Config,...} functions.
      22592a3f
  17. 13 3月, 2015 1 次提交
    • J
      Introduce virBitmapIsBitSet · 22fd3ac3
      Ján Tomko 提交于
      A helper that never returns an error and treats bits out of bitmap range
      as false.
      
      Use it everywhere we use ignore_value on virBitmapGetBit, or loop over
      the bitmap size.
      22fd3ac3
  18. 02 3月, 2015 4 次提交
  19. 17 12月, 2014 1 次提交
  20. 16 12月, 2014 1 次提交
    • M
      storage: unify permission formatting · d2632d60
      Martin Kletzander 提交于
      Volume and pool formatting functions took different approaches to
      unspecified uids/gids.  When unknown, it is always parsed as -1, but one
      of the functions formatted it as unsigned int (wrong) and one as
      int (better).  Due to that, our two of our XML files from tests cannot
      be parsed on 32-bit machines.
      
      RNG schema needs to be modified as well, but because both
      storagepool.rng and storagevol.rng need same schema for permission
      element, save some space by moving it to storagecommon.rng.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      d2632d60
  21. 03 12月, 2014 1 次提交
    • J
      Replace virStoragePoolFree with virObjectUnref · adbbff5f
      John Ferlan 提交于
      Since virStoragePoolFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      adbbff5f
  22. 01 12月, 2014 2 次提交
    • J
      storage: Add mixed fc_host/scsi_host duplicate adapter source checks · b09ff138
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1159180
      
      The virStoragePoolSourceFindDuplicate only checks the incoming definition
      against the same type of pool as the def; however, for "scsi_host" and
      "fc_host" adapter pools, it's possible that either some pool "scsi_host"
      adapter definition is already using the scsi_hostN that the "fc_host"
      adapter definition wants to use or some "fc_host" pool adapter definition
      is using a vHBA scsi_hostN or parent scsi_hostN that an incoming "scsi_host"
      definition is trying to use.
      
      This patch adds the mismatched type checks and adds extraneous comments
      to describe what each check is determining.
      
      This patch also modifies the documentation to be describe what scsi_hostN
      devices a "scsi_host" source adapter should use and which to avoid. It also
      updates the parent definition to specifically call out that for mixed
      environments it's better to define which parent to use so that the duplicate
      pool checks can be done properly.
      b09ff138
    • J
      storage: Move and rename getVhbaSCSIHostParent · 7b4cdb6e
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1159180
      
      Move the API from the backend to storage_conf and rename it to
      virStoragePoolGetVhbaSCSIHostParent.  A future patch will need to
      use this functionality from storage_conf
      7b4cdb6e
  23. 15 11月, 2014 1 次提交
  24. 12 11月, 2014 1 次提交
    • 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