1. 15 10月, 2013 1 次提交
  2. 21 8月, 2013 1 次提交
    • J
      Report secret usage error message similarly · 1fa7946f
      John Ferlan 提交于
      Each of the modules handled reporting error messages from the secret fetching
      slightly differently with respect to the error. Provide a similar message
      for each error case and provide as much data as possible.
      1fa7946f
  3. 23 7月, 2013 2 次提交
    • J
      storage: Support "chap" authentication for iscsi pool · 249409e7
      John Ferlan 提交于
      Although the XML for CHAP authentication with plain "password"
      was introduced long ago, the function was never implemented. This
      patch replaces the login/password mechanism by following the
      'ceph' (or RBD) model of using a 'username' with a 'secret' which
      has the authentication information.
      
      This patch performs the authentication during startPool() processing
      of pools with an authType of VIR_STORAGE_POOL_AUTH_CHAP specified
      for iSCSI pools.
      
      There are two types of CHAP configurations supported for iSCSI
      authentication:
      
        * Initiator Authentication
            Forward, one-way; The initiator is authenticated by the target.
      
        * Target Authentication
            Reverse, Bi-directional, mutual, two-way; The target is authenticated
            by the initiator; This method also requires Initiator Authentication
      
      This only supports the "Initiator Authentication". (I don't have any
      enterprise iSCSI env for testing, only have a iSCSI target setup with
      tgtd, which doesn't support "Target Authentication").
      
      "Discovery authentication" is not supported by tgt yet too. So this only
      setup the session authentication by executing 3 iscsiadm commands, E.g:
      
      % iscsiadm -m node --target "iqn.2013-05.test:iscsi.foo" --name \
        "node.session.auth.authmethod" -v "CHAP" --op update
      
      % iscsiadm -m node --target "iqn.2013-05.test:iscsi.foo" --name \
        "node.session.auth.username" -v "Jim" --op update
      
      % iscsiadm -m node --target "iqn.2013-05.test:iscsi.foo" --name \
        "node.session.auth.password" -v "Jimsecret" --op update
      249409e7
    • J
      storage_iscsi: Reflect the default target port · 5c62d5ea
      John Ferlan 提交于
      Make sure default iSCSI target is 3260.
      5c62d5ea
  4. 11 7月, 2013 1 次提交
  5. 10 7月, 2013 1 次提交
  6. 07 6月, 2013 1 次提交
  7. 21 5月, 2013 1 次提交
  8. 10 5月, 2013 1 次提交
  9. 09 5月, 2013 1 次提交
  10. 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
  11. 08 4月, 2013 1 次提交
  12. 21 12月, 2012 5 次提交
  13. 21 9月, 2012 1 次提交
  14. 02 8月, 2012 1 次提交
    • G
      storage: netfs and iscsi need option srcSpec for resource discovery · 40570488
      Guannan Ren 提交于
      The option 'srcSpec' to virsh command find-storage-pool-sources
      is optional for logical type of storage pool, but mandatory for
      netfs and iscsi type.
      When missing the option for netfs and iscsi, libvirt reports XML
      parsing error due to null string option srcSpec.
      
      before
      error: Failed to find any netfs pool sources
      error: (storage_source_specification):1: Document is empty
      (null)
      
      after:
      error: pool type 'iscsi' requires option --srcSpec for source discovery
      40570488
  15. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  16. 19 7月, 2012 1 次提交
  17. 12 7月, 2012 1 次提交
  18. 01 5月, 2012 1 次提交
    • E
      storage: fix build with iscsi · 29e702e5
      Eric Blake 提交于
      The previous storage patch missed an instance affected by the struct
      member rename.  It also had some botched whitespace detected by
      'make check'.
      
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIFindPoolSources): Adjust to new struct.
      * src/conf/storage_conf.c (virStoragePoolSourceFormat): Fix
      indentation.
      29e702e5
  19. 30 4月, 2012 1 次提交
  20. 30 3月, 2012 1 次提交
  21. 26 1月, 2012 1 次提交
    • D
      Introduce new API for generating random numbers · e95ef67b
      Daniel P. Berrange 提交于
      The old virRandom() API was not generating good random numbers.
      Replace it with a new API virRandomBits which instead of being
      told the upper limit, gets told the number of bits of randomness
      required.
      
      * src/util/virrandom.c, src/util/virrandom.h: Add virRandomBits,
        and move virRandomInitialize
      * src/util/util.h, src/util/util.c: Delete virRandom and
        virRandomInitialize
      * src/libvirt.c, src/security/security_selinux.c,
        src/test/test_driver.c, src/util/iohelper.c: Update for
        changes from virRandom to virRandomBits
      * src/storage/storage_backend_iscsi.c: Remove bogus call
        to virRandomInitialize & convert to virRandomBits
      e95ef67b
  22. 12 11月, 2011 1 次提交
    • E
      build: drop useless dirent.h includes · e55ec69d
      Eric Blake 提交于
      * .gnulib: Update to latest, for improved syntax-check.
      * src/lxc/lxc_container.c (includes): Drop unused include.
      * src/network/bridge_driver.c: Likewise.
      * src/node_device/node_device_linux_sysfs.c: Likewise.
      * src/openvz/openvz_driver.c: Likewise.
      * src/qemu/qemu_conf.c: Likewise.
      * src/storage/storage_backend_iscsi.c: Likewise.
      * src/storage/storage_backend_mpath.c: Likewise.
      * src/uml/uml_conf.c: Likewise.
      * src/uml/uml_driver.c: Likewise.
      e55ec69d
  23. 25 10月, 2011 2 次提交
    • E
      storage: make previous leak less likely to regress · b1836a25
      Eric Blake 提交于
      Splitting into two functions allows the user to call the right
      function, rather than having to remember that a *Free function is
      an exception to the rule.
      
      * src/conf/storage_conf.h (virStoragePoolSourceClear): New function.
      * src/libvirt_private.syms (storage_conf.h): Export it.
      * src/conf/storage_conf.c (virStoragePoolSourceFree): Split...
      (virStoragePoolSourceClear): ...into new function.
      (virStoragePoolDefFree, virStoragePoolDefParseSourceString):
      Update callers.
      * src/test/test_driver.c (testStorageFindPoolSources): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemNetFindPoolSourcesFunc)
      (virStorageBackendFileSystemNetFindPoolSources): Likewise.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIFindPoolSources): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalFindPoolSources): Likewise.
      b1836a25
    • E
      storage: plug iscsi memory leak · 79052a76
      Eric Blake 提交于
      Detected by Coverity.  virStoragePoolSourceFree does not free the
      actual passed-in pointer.  A bigger patch would be to rename it
      virStoragePoolSourceClear to match behavior, or even split it into
      two functions depending on needed behavior; but this is the minimal
      fix to the one location out of eight that leaked memory.
      
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIFindPoolSources): Free memory.
      79052a76
  24. 01 10月, 2011 1 次提交
    • S
      lvm storage backend: handle command_names=1 in lvm.conf · 30f555c6
      Serge E. Hallyn 提交于
      If the regexes supported (?:pvs)?, then we could handle this by
      optionally matching but not returning the initial command name.  But it
      doesn't.  So add a new char* argument to
      virStorageBackendRunProgRegex().  If that argument is NULL then we act
      as usual.  Otherwise, if the string at that argument is found at the
      start of a returned line, we drop that before running the regex.
      
      With this patch, virt-manager shows me lvs with command_names 1 or 0.
      
      The definitions of PVS_BASE etc may want to be moved into the configure
      scripts (though given how PVS is found, IIUC that could only happen if
      pvs was a link to pvs_real), but in any case no sense dealing with that
      until we're sure this is an ok way to handle it.
      Signed-off-by: NSerge Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      30f555c6
  25. 22 7月, 2011 1 次提交
    • E
      build: rename files.h to virfile.h · 8e22e089
      Eric Blake 提交于
      In preparation for a future patch adding new virFile APIs.
      
      * src/util/files.h, src/util/files.c: Move...
      * src/util/virfile.h, src/util/virfile.c: ...here, and rename
      functions to virFile prefix.  Macro names are intentionally
      left alone.
      * *.c: All '#include "files.h"' uses changed.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
      * src/libvirt_private.syms: Likewise.
      * docs/hacking.html.in: Likewise.
      * HACKING: Regenerate.
      8e22e089
  26. 13 7月, 2011 1 次提交
    • E
      storage: reject unknown flags · 64bd1b9d
      Eric Blake 提交于
      * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom)
      (virStorageBackendCreateQemuImg)
      (virStorageBackendCreateQcowCreate): Reject unknown flags.
      * src/storage/storage_backend_disk.c (virStorageBackendDiskBuildPool)
      (virStorageBackendDiskDeleteVol): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemNetFindPoolSources)
      (virStorageBackendFileSystemBuild)
      (virStorageBackendFileSystemDelete, createFileDir)
      (virStorageBackendFileSystemVolBuildFrom)
      (virStorageBackendFileSystemVolDelete): Likewise.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIFindPoolSources): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalFindPoolSources)
      (virStorageBackendLogicalBuildPool)
      (virStorageBackendLogicalDeletePool)
      (virStorageBackendLogicalDeleteVol): Likewise.
      * src/storage/storage_driver.c (storageOpen, storagePoolCreate)
      (storagePoolDefine, storagePoolRefresh, storagePoolGetXMLDesc)
      (storageVolumeCreateXML, storageVolumeCreateXMLFrom)
      (storageVolumeGetXMLDesc): Likewise.
      64bd1b9d
  27. 04 7月, 2011 1 次提交
    • E
      storage: avoid crash on parse error · 5dc404b7
      Eric Blake 提交于
      Coverity detected that we could crash on bogus input.  Meanwhile,
      strtok_r is rather heavy compared to strchr.
      
      * src/storage/storage_backend_iscsi.c (virStorageBackendIQNFound):
        Check for parse failure, and use lighter-weight functions.
      5dc404b7
  28. 17 5月, 2011 2 次提交
  29. 04 5月, 2011 1 次提交
    • E
      storage: use virCommand to avoid compiler warning · f72393fa
      Eric Blake 提交于
      clang didn't like the last increment to nargs.  But why even
      track nargs ourselves, when virCommand does it for us?
      
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIConnection): Switch to virCommand to avoid
      a dead-store warning on nargs.
      f72393fa
  30. 05 4月, 2011 2 次提交
    • M
    • E
      build: detect potentential uninitialized variables · 0d166c6b
      Eric Blake 提交于
      Even with -Wuninitialized (which is part of autobuild.sh
      --enable-compile-warnings=error), gcc does NOT catch this
      use of an uninitialized variable:
      
      {
        if (cond)
          goto error;
        int a = 1;
      error:
        printf("%d", a);
      }
      
      which prints 0 (supposing the stack started life wiped) if
      cond was true.  Clang will catch it, but we don't use clang
      as often.  Using gcc -Wjump-misses-init catches it, but also
      gives false positives:
      
      {
        if (cond)
          goto error;
        int a = 1;
        return a;
      error:
        return 0;
      }
      
      Here, a was never used in the scope of the error block, so
      declaring it after goto is technically fine (and clang agrees).
      However, given that our HACKING already documents a preference
      to C89 decl-before-statement, the false positive warning is
      enough of a prod to comply with HACKING.
      
      [Personally, I'd _really_ rather use C99 decl-after-statement
      to minimize scope, but until gcc can efficiently and reliably
      catch scoping and uninitialized usage bugs, I'll settle with
      the compromise of enforcing a coding standard that happens to
      reject false positives if it can also detect real bugs.]
      
      * acinclude.m4 (LIBVIRT_COMPILE_WARNINGS): Add -Wjump-misses-init.
      * src/util/util.c (__virExec): Adjust offenders.
      * src/conf/domain_conf.c (virDomainTimerDefParseXML): Likewise.
      * src/remote/remote_driver.c (doRemoteOpen): Likewise.
      * src/phyp/phyp_driver.c (phypGetLparNAME, phypGetLparProfile)
      (phypGetVIOSFreeSCSIAdapter, phypVolumeGetKey)
      (phypGetStoragePoolDevice)
      (phypVolumeGetPhysicalVolumeByStoragePool)
      (phypVolumeGetPath): Likewise.
      * src/vbox/vbox_tmpl.c (vboxNetworkUndefineDestroy)
      (vboxNetworkCreate, vboxNetworkDumpXML)
      (vboxNetworkDefineCreateXML): Likewise.
      * src/xenapi/xenapi_driver.c (getCapsObject)
      (xenapiDomainDumpXML): Likewise.
      * src/xenapi/xenapi_utils.c (createVMRecordFromXml): Likewise.
      * src/security/security_selinux.c (SELinuxGenNewContext):
      Likewise.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainChangeEjectableMedia):
      Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetPtyPaths):
      Likewise.
      * src/qemu/qemu_driver.c (qemudDomainShutdown)
      (qemudDomainBlockStats, qemudDomainMemoryPeek): Likewise.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendCreateIfaceIQN): Likewise.
      * src/node_device/node_device_udev.c (udevProcessPCI): Likewise.
      0d166c6b
  31. 23 11月, 2010 2 次提交
    • D
      Check whether pools are already active upon libvirtd startup · 1b7e0b1a
      Daniel P. Berrange 提交于
      When libvirt starts up all storage pools default to the inactive
      state, even if the underlying storage is already active on the
      host. This introduces a new API into the internal storage backend
      drivers that checks whether a storage pool is already active. If
      the pool is active at libvirtd startup, the volume list will be
      immediately populated.
      
      * src/storage/storage_backend.h: New internal API for checking
        storage pool state
      * src/storage/storage_driver.c: Check whether a pool is active
        upon driver startup
      * src/storage/storage_backend_fs.c, src/storage/storage_backend_iscsi.c,
        src/storage/storage_backend_logical.c, src/storage/storage_backend_mpath.c,
        src/storage/storage_backend_scsi.c: Add checks for pool state
      1b7e0b1a
    • D
      Add support for iSCSI target auto-discovery · 1da8c567
      Daniel P. Berrange 提交于
      Since the previous patch added support for parsing the output of
      the 'sendtargets' command, it is now trivial to support the
      storage pool discovery API.
      
      Given a hostname and optional portnumber and initiator IQN,
      the code can return a full list of storage pool source docs,
      each one representing a iSCSI target.
      
      * src/storage/storage_backend_iscsi.c: Wire up target
        auto-discovery
      1da8c567