1. 25 10月, 2011 1 次提交
    • 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
  2. 14 9月, 2011 1 次提交
    • P
      xml: Clean up rest of virtual XML document names for XML strings · b998f1f7
      Peter Krempa 提交于
      Commit 498d7833 cleans up some of virtual file names for parsing strings
      in memory. This patch cleans up (hopefuly) the rest forgotten by the
      first patch.
      
      This patch also changes all of the previously modified "filenames" to
      valid URI's replacing spaces for underscores.
      
      Changes to v1:
      - Replace all spaces for underscores, so that the strings form valid
        URI's
      - Replace spaces in places changed by commit 498d7833
      b998f1f7
  3. 05 9月, 2011 1 次提交
    • L
      Check for source conflicts in storage pools · 5a1f2728
      Lei Li 提交于
      Fix bug #611823 storage driver should prohibit pools with duplicate
      underlying storage.
      
      Add internal API virStoragePoolSourceFindDuplicate() to do uniqueness
      check based on source location infomation for pool type.
      
      * AUTHORS: add Lei Li
      5a1f2728
  4. 19 8月, 2011 1 次提交
    • E
      maint: simplify lots of libxml2 clients · d89dd42d
      Eric Blake 提交于
      Repetitive patterns should be factored.  The sign of a good
      factorization is a change that kills 5x more lines than it adds :)
      
      * src/conf/domain_conf.c (virDomainDeviceDefParse)
      (virDomainSnapshotDefParseString): Use new convenience macros.
      * src/conf/storage_conf.c (virStoragePoolDefParseSourceString):
      Likewise.
      * src/cpu/cpu.c (cpuCompareXML, cpuBaselineXML): Likewise.
      * src/esx/esx_vi.c (esxVI_Context_Execute): Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationCookieXMLParseStr):
      Likewise.
      * src/security/virt-aa-helper.c (caps_mockup): Likewise.
      * src/test/test_driver.c (testOpenFromFile): Likewise.
      * tests/cputest.c (cpuTestLoadXML, cpuTestLoadMultiXML):
      Likewise.
      * tools/virsh.c (cmdFreecell, makeCloneXML, cmdVNCDisplay)
      (cmdTTYConsole, cmdDetachInterface, cmdDetachDisk)
      (cmdSnapshotCreate, cmdSnapshotCreateAs, cmdSnapshotCurrent)
      (cmdSnapshotList, cmdSnapshotParent): Likewise.
      d89dd42d
  5. 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
  6. 14 7月, 2011 1 次提交
    • E
      conf: prefer unsigned flags · e17d3e7f
      Eric Blake 提交于
      * src/conf/cpu_conf.h (virCPUDefFormat, virCPUDefFormatBuf):
      Change flags type.
      * src/conf/cpu_conf.c (virCPUDefFormat, virCPUDefFormatBuf):
      Likewise.
      * src/conf/storage_conf.c (_virStoragePoolOptions): Likewise.
      * src/datatypes.h (_virConnect, _virStream): Likewise.
      e17d3e7f
  7. 06 7月, 2011 1 次提交
    • M
      Fix return value semantic of virFileMakePath · e123e1ee
      Matthias Bolte 提交于
      Some callers expected virFileMakePath to set errno, some expected
      it to return an errno value. Unify this to return 0 on success and
      -1 on error. Set errno to report detailed error information.
      
      Also optimize virFileMakePath if stat fails with an errno different
      from ENOENT.
      e123e1ee
  8. 13 5月, 2011 2 次提交
  9. 06 5月, 2011 2 次提交
    • M
      Add warning message to XML definition files stored on disk · 5d09c314
      Michal Privoznik 提交于
      Users often edit XML file stored in configuration directory
      thinking of modifying a domain/network/pool/etc. Thus it is wise
      to let them know they are using the wrong way and give them hint.
      5d09c314
    • E
      maint: rename virBufferVSprintf to virBufferAsprintf · 68ea80cf
      Eric Blake 提交于
      We already have virAsprintf, so picking a similar name helps for
      seeing a similar purpose.  Furthermore, the prefix V before printf
      generally implies 'va_list', even though this variant was '...', and
      the old name got in the way of adding a new va_list version.
      
      global rename performed with:
      
      $ git grep -l virBufferVSprintf \
        | xargs -L1 sed -i 's/virBufferVSprintf/virBufferAsprintf/g'
      
      then revert the changes in ChangeLog-old.
      68ea80cf
  10. 27 4月, 2011 1 次提交
  11. 05 4月, 2011 1 次提交
  12. 16 3月, 2011 1 次提交
  13. 29 1月, 2011 1 次提交
  14. 19 1月, 2011 1 次提交
  15. 25 11月, 2010 1 次提交
    • E
      maint: prohibit most uses of xmlGetProp · 416c09bc
      Eric Blake 提交于
      Making this change makes it easier to spot the memory leaks
      that will be fixed in the next patch.
      
      * cfg.mk (sc_prohibit_xmlGetProp): New rule.
      * .x-sc_prohibit_xmlGetProp: New exception.
      * Makefile.am (EXTRA_DIST): Ship exception file.
      * tools/virsh.c (cmdDetachInterface, cmdDetachDisk): Adjust
      offenders.
      * src/conf/storage_conf.c (virStoragePoolDefParseSource):
      Likewise.
      * src/conf/network_conf.c (virNetworkDHCPRangeDefParseXML)
      (virNetworkIPParseXML): Likewise.
      416c09bc
  16. 23 11月, 2010 1 次提交
    • D
      Fix parsing of port attribute in storage XML configuration · b6e5a0a2
      Daniel P. Berrange 提交于
      The XML docs describe a 'port' attribute for the
      storage source <host> element, but the parser never
      handled it.
      
      * docs/schemas/storagepool.rng: Define port attribute
      * src/conf/storage_conf.c: Add missing parsing/formatting
        of host port number
      * src/conf/storage_conf.h: Remove bogus/unused 'protocol' field
      b6e5a0a2
  17. 19 10月, 2010 1 次提交
    • S
      Introduce VIR_CLOSE to be used rather than close() · f04de501
      Stefan Berger 提交于
      Since bugs due to double-closed file descriptors are difficult to track down in a multi-threaded system, I am introducing the VIR_CLOSE(fd) macro to help avoid mistakes here.
      
      There are lots of places where close() is being used. In this patch I am only cleaning up usage of close() in src/conf where the problems were.
      
      I also dare to declare close() as being deprecated in libvirt code base (HACKING).
      f04de501
  18. 20 8月, 2010 1 次提交
    • P
      storage: add support for Vendor and Model in XML · 20be699e
      Patrick Dignan 提交于
      I wrote a patch to add support for listing the Vendor and Model of a
      storage pool in the storage pool XML.  This would allow vendor
      extensions of specific devices.  The patch includes a test for the new
      attributes as well.
      
      Patrick Dignan
      20be699e
  19. 13 8月, 2010 1 次提交
  20. 09 6月, 2010 1 次提交
  21. 08 6月, 2010 1 次提交
    • D
      Storage pool duplicate UUID/name checking · e9364d9f
      Daniel P. Berrange 提交于
      The storage pool driver is not doing correct checking for
      duplicate UUID/name values. This introduces a new method
      virStoragePoolObjIsDuplicate, based on the previously
      written virDomainObjIsDuplicate.
      
      * src/conf/storage_conf.c, src/conf/storage_conf.c,
        src/libvirt_private.syms: Add virStoragePoolObjIsDuplicate,
      * src/storage/storage_driver.c: Call virStoragePoolObjIsDuplicate
        for checking uniqueness of uuid/names
      e9364d9f
  22. 26 5月, 2010 1 次提交
  23. 18 5月, 2010 2 次提交
    • J
      maint: add more free-like functions to the list and deal with fallout · a986892e
      Jim Meyering 提交于
      * cfg.mk (useless_free_options): Add many vir*Free* function names,
      and then remove the useless if-before-free tests exposed by running
      make syntax-check.
      * src/conf/interface_conf.c (virInterfaceDefFree): Remove useless "if".
      (virInterfaceAssignDef): Likewise.
      * src/conf/network_conf.c (virNetworkAssignDef): Likewise.
      * src/conf/storage_conf.c (virStoragePoolObjAssignDef): Likewise.
      * src/node_device/node_device_hal.c (dev_create): Likewise.
      * src/security/virt-aa-helper.c (vahDeinit): Likewise.
      * src/test/test_driver.c (testNodeDeviceCreateXML): Likewise.
      * src/util/conf.c (virConfSetValue): Likewise.
      a986892e
    • M
      Add CIFS to the list of network file systems · 61fb6979
      Matthias Bolte 提交于
      ESX supports NFS and CIFS. The ESX storage driver will reflect this.
      61fb6979
  24. 27 4月, 2010 1 次提交
    • D
      Fix indentation for storage conf XML · 1b9347b5
      David Allan 提交于
      * virStorageEncryptionFormat is called from both
        virDomainDiskDefFormat and virStorageVolTargetDefFormat.  The proper
        indentation in the generated XML depends on the caller.  My earlier
        patch to fix the incorrect indentation for the domain XML broke the
        indentation for the storage XML.  This patch adopts Laine's
        suggestion of requring the caller of virStorageEncryptionFormat to
        provide an unsigned int with the number of spaces the output should
        be indented.  The patch modifies both callers to provide the
        additional argument.
      
      * Add a regression test for the domain XML
      
      * src/conf/domain_conf.c src/conf/storage_conf.c
        src/conf/storage_encryption_conf.c src/conf/storage_encryption_conf.h:
        change the indentation code
      * tests/qemuxml2xmltest.c
        tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.args
        tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.xml: add a regression test
      1b9347b5
  25. 21 4月, 2010 1 次提交
  26. 23 3月, 2010 1 次提交
  27. 05 3月, 2010 1 次提交
    • L
      Change default for storage uid/gid from getuid()/getgid() to -1/-1 · 219305df
      Laine Stump 提交于
      This allows the config to have a setting that means "leave it alone",
      eg when building a pool where the directory already exists the user
      may want the current uid/gid of the directory left intact. This
      actually gets us back to older behavior - before recent changes to the
      pool building code, we weren't as insistent about honoring the uid/gid
      settings in the XML, and virt-manager was taking advantage of this
      behavior.
      
      As a side benefit, removing calls to getuid/getgid from the XML
      parsing functions also seems like a good idea. And having a default
      that is different from a common/useful value (0 == root) is a good
      thing in general, as it removes ambiguity from decisions (at least one
      place in the code was checking for (perms.uid == 0) to see if a
      special uid was requested).
      
      Note that this will only affect newly created pools and volumes. Due
      to the way that the XML is parsed, then formatted for newly created
      volumes, all existing pools/volumes already have an explicit uid and
      gid set.
      
      src/conf/storage_conf.c: Remove calls to setuid/setgid for default values
                               of uid/gid, and set them to -1 instead
      
      src/storage/storage_backend.c:
      src/storage/storage_backend_fs.c:
              Make account for the new default values of perms.uid
              and perms.gid.
      219305df
  28. 04 3月, 2010 1 次提交
    • D
      Fix parser checking of storage pool device · ce5ced1d
      Daniel P. Berrange 提交于
      The storage backend implementations all presume that the XML parser
      is validating correctness of the source specification. The check for
      a source device was lost at some point. This allowed for a potential
      crash in the disk backend. Re-introduce the sanity check
      
      * src/conf/storage_conf.c: Re-add check for source device
      ce5ced1d
  29. 23 2月, 2010 1 次提交
    • C
      storage: conf: Correctly calculate exabyte unit · 67b44811
      Cole Robinson 提交于
      We were using 'Y' to mean exabyte, when the correct abbreviation would be
      'E' ('Y' is yettabyte, which is exabyte * 1024 * 1024). While it isn't
      strictly backwards compatible, I highly doubt anyone was actually using
      this broken behavior, so I don't see any harm in in dropping 'Y' handling.
      67b44811
  30. 12 2月, 2010 1 次提交
    • J
      plug four virStoragePoolSourceFree-related leaks · 18e0cc7f
      Jim Meyering 提交于
      * src/conf/storage_conf.c (virStoragePoolDefParseSourceString):
      * src/storage/storage_backend_fs.c:
      (virStorageBackendFileSystemNetFindPoolSourcesFunc):
      (virStorageBackendFileSystemNetFindPoolSources):
      * src/test/test_driver.c (testStorageFindPoolSources):
      18e0cc7f
  31. 11 2月, 2010 1 次提交
  32. 10 2月, 2010 1 次提交
    • D
      Remove virConnectPtr from storage APIs & driver · 03136638
      Daniel P. Berrange 提交于
      The virConnectPtr is no longer required for error reporting since
      that is recorded in a thread local. Remove use of virConnectPtr
      from all APIs in storage_conf.{h,c} and storage_encryption_conf.{h,c}
      and update all callers to match
      03136638
  33. 09 2月, 2010 3 次提交
  34. 03 2月, 2010 1 次提交
  35. 21 1月, 2010 1 次提交
    • D
      Implement support for multi IQN · 6aabcb5b
      David Allan 提交于
      Allows the initiator to use a variety of IQNs rather than just the
      system IQN when creating iSCSI pools.
      * docs/schemas/storagepool.rng: extends the syntax with <iqn name="..."/>
      * src/conf/storage_conf.[ch]: read and stores the iqn name
      * src/storage/storage_backend_iscsi.[ch]: implement the IQN selection
        when detected
      6aabcb5b