1. 26 7月, 2013 1 次提交
  2. 24 7月, 2013 1 次提交
    • J
      storage: Add connection for autostart storage pool · a873b496
      John Ferlan 提交于
      Add a privileged field to storageDriverState
      
      Use the privileged value in order to generate a connection which could
      be passed to the various storage backend drivers.
      
      In particular, the iSCSI driver will need a connect in order to perform
      pool authentication using the 'chap' secrets and the RBD driver utilizes
      the connection during pool refresh for pools using 'ceph' secrets.
      
      For now that connection will be to be to qemu driver until a mechanism
      is devised to get a connection to just the secret driver without qemu.
      a873b496
  3. 23 7月, 2013 3 次提交
    • J
      Adjust 'ceph' authentication secret usage for rbd pool. · c2257d2e
      John Ferlan 提交于
      Update virStorageBackendRBDOpenRADOSConn() to use the internal API to the
      secret driver in order to get the secret value instead of the external
      virSecretGetValue() path. Without the flag VIR_SECRET_GET_VALUE_INTERNAL_CALL
      there is no way to get the value of private secret.
      
      This also requires ensuring there is a connection which wasn't true for
      for the refreshPool() path calls from storageDriverAutostart() prior to
      adding support for the connection to a qemu driver. It seems calls to
      virSecretLookupByUUIDString() and virSecretLookupByUsage() from the
      refreshPool() path would have failed with no way to find the secret - that is
      theoretically speaking since the 'conn' was NULL the failure would have been
      "failed to find the secret".
      c2257d2e
    • 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. 16 7月, 2013 2 次提交
  5. 12 7月, 2013 1 次提交
    • J
      storage_backend: Resolve Coverity issue · ba3427a0
      John Ferlan 提交于
      The switch statement in 'virStorageBackendCreateQemuImgOpts' used the
      for loop end condition 'VIR_STORAGE_FILE_FEATURE_LAST' as a possible value,
      but since that cannot happen Coverity spits out a DEADCODE message. Adding
      the Coverity tag just removes the Coverity message
      ba3427a0
  6. 11 7月, 2013 2 次提交
  7. 10 7月, 2013 1 次提交
  8. 04 7月, 2013 1 次提交
  9. 03 7月, 2013 1 次提交
  10. 29 6月, 2013 1 次提交
    • J
      Resolve valgrind error in virStorageBackendCreateQemuImgCmd() · 164d46e8
      John Ferlan 提交于
      Commit id '53d5967c' introduced the following:
      
      TEST: storagevolxml2argvtest
            ..............                           14  OK
      ==25636== 358 (264 direct, 94 indirect) bytes in 1 blocks are definitely lost in loss record 67 of 75
      ==25636==    at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
      ==25636==    by 0x4C95791: virAlloc (viralloc.c:124)
      ==25636==    by 0x4CA0BB4: virCommandNewArgs (vircommand.c:805)
      ==25636==    by 0x4CA0C88: virCommandNew (vircommand.c:789)
      ==25636==    by 0x408602: virStorageBackendCreateQemuImgCmd (storage_backend.c:849)
      ==25636==    by 0x405427: testCompareXMLToArgvHelper (storagevolxml2argvtest.c:61)
      ==25636==    by 0x4064DF: virtTestRun (testutils.c:158)
      ==25636==    by 0x40516F: mymain (storagevolxml2argvtest.c:195)
      ==25636==    by 0x406B1A: virtTestMain (testutils.c:722)
      ==25636==    by 0x37C1021A04: (below main) (libc-start.c:225)
      ==25636==
      PASS: storagevolxml2argvtest
      164d46e8
  11. 28 6月, 2013 1 次提交
  12. 24 6月, 2013 2 次提交
  13. 21 6月, 2013 2 次提交
    • J
      storage: add support for creating qcow2 images with extensions · 6298f74d
      Ján Tomko 提交于
      Add -o compat= and -o lazy_refcounts options for qemu-img.
      6298f74d
    • J
      conf: add features to volume target XML · 31d42506
      Ján Tomko 提交于
      Add <features> and <compat> elements to volume target XML.
      
      <compat> is a string which for qcow2 represents the QEMU version
      it should be compatible with. Valid values are 0.10 and 1.1.
      1.1 is implicit if the <features> element is present, otherwise
      qemu-img default is used. 0.10 can be specified to explicitly
      create older images after the qemu-img default changes.
      
      <features> contains optional features, so far
      <lazy_refcounts/> is available, which enables caching of reference
      counters, improving performance for snapshots.
      31d42506
  14. 19 6月, 2013 1 次提交
  15. 10 6月, 2013 1 次提交
  16. 07 6月, 2013 2 次提交
  17. 06 6月, 2013 2 次提交
    • J
      Replace two-state local integers with bool · e557766c
      Ján Tomko 提交于
      Found with 'git grep "= 1"'.
      e557766c
    • P
      storage: Avoid unnecessary ternary operators and refactor the code · b0c3ee0c
      Peter Krempa 提交于
      Setting of local variables in virStorageBackendCreateQemuImgCmd was
      unnecessarily cluttered with ternary operators and repeated testing of
      of conditions.
      
      This patch refactors the function to use if statements and improves
      error reporting in case inputvol is specified but does not contain
      target path. Previously we would complain about "unknown storage vol
      type 0" instead of the actual problem.
      b0c3ee0c
  18. 05 6月, 2013 4 次提交
  19. 31 5月, 2013 1 次提交
  20. 21 5月, 2013 1 次提交
  21. 15 5月, 2013 1 次提交
  22. 11 5月, 2013 2 次提交
    • L
      util: move virFile* functions from virutil.c to virfile.c · bfe7721d
      Laine Stump 提交于
      These all existed before virfile.c was created, and for some reason
      weren't moved.
      
      This is mostly straightfoward, although the syntax rule prohibiting
      write() had to be changed to have an exception for virfile.c instead
      of virutil.c.
      
      This movement pointed out that there is a function called
      virBuildPath(), and another almost identical function called
      virFileBuildPath(). They really should be a single function, which
      I'll take care of as soon as I figure out what the arglist should look
      like.
      bfe7721d
    • L
      util: fix virFileOpenAs return value and resulting error logs · a2c1bedb
      Laine Stump 提交于
      This resolves:
      
           https://bugzilla.redhat.com/show_bug.cgi?id=851411
           https://bugzilla.redhat.com/show_bug.cgi?id=955500
      
      The first problem was that virFileOpenAs was returning fd (-1) in one
      of the error cases rather than ret (-errno), so the caller thought
      that the error was EPERM rather than ENOENT.
      
      The second problem was that some log messages in the general purpose
      qemuOpenFile() function would always say "Failed to create" even if
      the caller hadn't included O_CREAT (i.e. they were trying to open an
      existing file).
      
      This fixes virFileOpenAs to jump down to the error return (which
      returns ret instead of fd) in the previously mentioned incorrect
      failure case of virFileOpenAs(), removes all error logging from
      virFileOpenAs() (since the callers report it), and modifies
      qemuOpenFile to appropriately use "open" or "create" in its log
      messages.
      
      NB: I seriously considered removing logging from all callers of
      virFileOpenAs(), but there is at least one case where the caller
      doesn't want virFileOpenAs() to log any errors, because it's just
      going to try again (qemuOpenFile()). We can't simply make a silent
      variation of virFileOpenAs() though, because qemuOpenFile() can't make
      the decision about whether or not it wants to retry until after
      virFileOpenAs() has already returned an error code.
      
      Likewise, I also considered changing virFileOpenAs() to return -1 with
      errno set on return, and may still do that, but only as a separate
      patch, as it obscures the intent of this patch too much.
      a2c1bedb
  23. 10 5月, 2013 1 次提交
  24. 09 5月, 2013 1 次提交
  25. 08 5月, 2013 1 次提交
    • O
      storage: Skip inactive lv volumes · 59750ed6
      Osier Yang 提交于
      If the volume is of a clustered volume group, and not active, the
      related pool APIs fails on opening /dev/vg/lv. If the volume is
      suspended, it hangs on open(2) the volume.
      
      Though the best solution is to expose the volume status in volume
      XML, and even better to provide API to activate/deactivate the volume,
      but it's not the work I want to touch currently. Volume status in
      other status is just fine to skip.
      
      About the 5th field of lv_attr (from man lvs[8])
      <quote>
       5 State: (a)ctive, (s)uspended, (I)nvalid snapshot, invalid
         (S)uspended snapshot, snapshot (m)erge failed,suspended
         snapshot (M)erge failed, mapped (d)evice present without
         tables,  mapped device present with (i)nactive table
      </quote>
      59750ed6
  26. 03 5月, 2013 2 次提交
    • E
      build: avoid useless virAsprintf · 25ae3d30
      Eric Blake 提交于
      virAsprintf(&foo, "%s", bar) is wasteful compared to
      foo = strdup(bar) (or eventually, VIR_STRDUP(foo, bar),
      but one thing at a time...).
      
      Noticed while reviewing Laine's attempt to clean up broken
      qemu:///session.
      
      * cfg.mk (sc_prohibit_asprintf): Enhance rule.
      * src/esx/esx_storage_backend_vmfs.c
      (esxStorageBackendVMFSVolumeLookupByKey): Fix offender.
      * src/network/bridge_driver.c (networkStateInitialize): Likewise.
      * src/nwfilter/nwfilter_dhcpsnoop.c (virNWFilterSnoopDHCPOpen):
      Likewise.
      * src/storage/storage_backend_sheepdog.c
      (virStorageBackendSheepdogRefreshVol): Likewise.
      * src/util/vircgroup.c (virCgroupAddTaskStrController): Likewise.
      * src/util/virdnsmasq.c (addnhostsAdd): Likewise.
      * src/xen/block_stats.c (xenLinuxDomainDeviceID): Likewise.
      * src/xen/xen_driver.c (xenUnifiedConnectOpen): Likewise.
      * tools/virsh.c (vshGetTypedParamValue): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      25ae3d30
    • L
      util: fix compile errors caused by moving string functions · cc8f9e67
      Laine Stump 提交于
      commit 7c9a2d88 missed adding in a few #include "virstring.h"s, causing
      builds to fail.
      cc8f9e67
  27. 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