1. 09 8月, 2012 1 次提交
    • P
      Allow rbd backing stores · 16d3ab86
      Peter Feiner 提交于
      Prevents libvirt from treating RBD backing stores as files. Without this
      patch, creating a domain with a qcow2 overlay on an RBD would fail.
      
      This patch essentially extends 9c7c4a4f,
      which allows nbd backing stores, to allow rbd backing stores.
      16d3ab86
  2. 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
  3. 30 3月, 2012 1 次提交
  4. 23 2月, 2012 1 次提交
  5. 09 2月, 2012 1 次提交
  6. 01 2月, 2012 1 次提交
  7. 30 11月, 2011 1 次提交
  8. 03 8月, 2011 1 次提交
    • E
      build: silence coverity false positives · 44ebb18e
      Eric Blake 提交于
      Coverity complained that 395 out of 409 virAsprintf calls are
      checked, and therefore assumed that the remaining cases are bugs
      waiting to happen.  But in each of these cases, a failed virAsprintf
      will properly set the target string to NULL, and pass on that
      failure to the caller, without wasting efforts to check the call.
      Adding the ignore_value silences Coverity.
      
      * src/conf/domain_audit.c (virDomainAuditGetRdev): Ignore
      virAsprintf return value, when it behaves like we need.
      * src/network/bridge_driver.c (networkDnsmasqLeaseFileNameDefault)
      (networkRadvdConfigFileName, networkBridgeDummyNicName)
      (networkRadvdPidfileBasename): Likewise.
      * src/util/storage_file.c (absolutePathFromBaseFile): Likewise.
      * src/openvz/openvz_driver.c (openvzGenerateContainerVethName):
      Likewise.
      * src/util/command.c (virCommandTranslateStatus): Likewise.
      44ebb18e
  9. 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
  10. 14 7月, 2011 1 次提交
    • M
      storage: Avoid memory leak on metadata fetching · 85aa40e2
      Michal Privoznik 提交于
      Getting metadata on storage allocates a memory (path) which need to
      be freed after use otherwise it gets leaked. This means after use of
      virStorageFileGetMetadataFromFD or virStorageFileGetMetadata one
      must call virStorageFileFreeMetadata to free it. This function frees
      structure internals and structure itself.
      85aa40e2
  11. 08 6月, 2011 1 次提交
    • E
      storage: avoid mishandling backing store > 2GB · 54456cc0
      Eric Blake 提交于
      Detected by Coverity.  The code was doing math on shifted unsigned
      char (which promotes to int), then promoting that to unsigned long
      during assignment to size.  On 64-bit platforms, this risks sign
      extending values of size > 2GiB.  Bug present since commit
      489fd3 (v0.6.0).
      
      I'm not sure if a specially-crafted bogus qcow2 image could
      exploit this, although it's probably not possible, since we
      were already checking for the computed results being within
      range of our fixed-size buffer.
      
      * src/util/storage_file.c (qcowXGetBackingStore): Avoid sign
      extension.
      54456cc0
  12. 03 6月, 2011 1 次提交
    • E
      storage: avoid memory leak on stat failure · f515bab7
      Eric Blake 提交于
      Spotted by coverity.  Triggers on failed stat, although I'm not sure
      how easy that condition is, so I'm not sure if this is a runtime
      memory hog.  Regression introduced in commit 8077d64f (unreleased).
      
      * src/util/storage_file.c (virStorageFileGetMetadataFromFD):
      Reduce need for malloc, avoiding a leak.
      f515bab7
  13. 01 6月, 2011 1 次提交
    • C
      storage: List directory volumes for dir/fs/netfs pools · 8077d64f
      Cole Robinson 提交于
      Since directories can be used for <filesystem> passthrough, they are
      basically storage volumes.
      
      v2:
          Skip ., .., lost+found dirs
      
      v3:
          Use gnulib last_component
      
      v4:
          Use gnulib "dirname.h", not system <dirname.h>
          Don't skip lost+found
      8077d64f
  14. 05 3月, 2011 1 次提交
  15. 25 2月, 2011 1 次提交
  16. 23 11月, 2010 2 次提交
  17. 20 11月, 2010 4 次提交
  18. 10 11月, 2010 2 次提交
    • A
      Allow non-file disk backingStores · 9c7c4a4f
      Adam Litke 提交于
      I am trying to use a qcow image with libvirt where the backing 'file' is a
      qemu-nbd server.  Unfortunately virDomainDiskDefForeachPath() assumes that
      backingStore is always a real file so something like 'nbd:0:3333' is rejected
      because a file with that name cannot be accessed.  Note that I am not worried
      about directly using nbd images.  That would require a new disk type with XML
      markup, etc.  I only want it to be permitted as a backingStore
      
      The following patch implements danpb's suggestion:
      > I think I'm inclined to push the logic for skipping NBD one stage higher.
      > I'd rather expect virStorageFileGetMetadata() to return all backing
      > stores, even if not files. The virDomainDiskDefForeachPath() method
      > should definitely ignore non-file backing stores though.
      >
      > So what I'm thinking is to extend the virStorageFileMetadata struct and
      > just add a 'bool isFile' field to it. Default this field to true, unless
      > you see the prefix of nbd: in which case set it to false. The
      > virDomainDiskDefForeachPath() method can then skip over any backing
      > store with isFile == false
      Signed-off-by: NAdam Litke <agl@us.ibm.com>
      Cc: Daniel P. Berrange <berrange@redhat.com>
      9c7c4a4f
    • S
      bye to close(), welcome to VIR_(FORCE_)CLOSE() · 60ae1c34
      Stefan Berger 提交于
      Using automated replacement with sed and editing I have now replaced all
      occurrences of close() with VIR_(FORCE_)CLOSE() except for one, of
      course. Some replacements were straight forward, others I needed to pay
      attention. I hope I payed attention in all the right places... Please
      have a look. This should have at least solved one more double-close
      error.
      60ae1c34
  19. 02 11月, 2010 1 次提交
    • D
      Treat failure to relabel stdin_path as non-fatal on NFS · 93a18bba
      Daniel P. Berrange 提交于
      NFS does not support file labelling, so ignore this error
      for stdin_path when on NFS.
      
      * src/security/security_selinux.c: Ignore failures on labelling
        stdin_path on NFS
      * src/util/storage_file.c, src/util/storage_file.h: Refine
        virStorageFileIsSharedFS() to allow it to check for a
        specific FS type.
      93a18bba
  20. 20 7月, 2010 1 次提交
    • D
      Require format to be passed into virStorageFileGetMetadata · bf80fc68
      Daniel P. Berrange 提交于
      Require the disk image to be passed into virStorageFileGetMetadata.
      If this is set to VIR_STORAGE_FILE_AUTO, then the format will be
      resolved using probing. This makes it easier to control when
      probing will be used
      
      * src/qemu/qemu_driver.c, src/qemu/qemu_security_dac.c,
        src/security/security_selinux.c, src/security/virt-aa-helper.c:
        Set VIR_STORAGE_FILE_AUTO when calling virStorageFileGetMetadata.
      * src/storage/storage_backend_fs.c: Probe for disk format before
        calling virStorageFileGetMetadata.
      * src/util/storage_file.h, src/util/storage_file.c: Remove format
        from virStorageFileMeta struct & require it to be passed into
        method.
      bf80fc68
  21. 19 7月, 2010 3 次提交
    • D
      Refactor virStorageFileGetMetadataFromFD to separate functionality · c70cb0f4
      Daniel P. Berrange 提交于
      The virStorageFileGetMetadataFromFD did two jobs in one. First
      it probed for storage type, then it extracted metadata for the
      type. It is desirable to be able to separate these jobs, allowing
      probing without querying metadata, and querying metadata without
      probing.
      
      To prepare for this, split out probing code into a new pair of
      methods
      
        virStorageFileProbeFormatFromFD
        virStorageFileProbeFormat
      
      * src/util/storage_file.c, src/util/storage_file.h,
        src/libvirt_private.syms: Introduce virStorageFileProbeFormat
        and virStorageFileProbeFormatFromFD
      c70cb0f4
    • D
      Remove 'type' field from FileTypeInfo struct · 779b6ea7
      Daniel P. Berrange 提交于
      Instead of including a field in FileTypeInfo struct for the
      disk format, rely on the array index matching the format.
      Use verify() to assert the correct number of elements in the
      array.
      
      * src/util/storage_file.c: remove type field from FileTypeInfo
      779b6ea7
    • D
      Extract the backing store format as well as name, if available · a93402d4
      Daniel P. Berrange 提交于
      When QEMU opens a backing store for a QCow2 file, it will
      normally auto-probe for the format of the backing store,
      rather than assuming it has the same format as the referencing
      file. There is a QCow2 extension that allows an explicit format
      for the backing store to be embedded in the referencing file.
      This closes the auto-probing security hole in QEMU.
      
      This backing store format can be useful for libvirt users
      of virStorageFileGetMetadata, so extract this data and report
      it.
      
      QEMU does not require disk image backing store files to be in
      the same format the file linkee. It will auto-probe the disk
      format for the backing store when opening it. If the backing
      store was intended to be a raw file this could be a security
      hole, because a guest may have written data into its disk that
      then makes the backing store look like a qcow2 file. If it can
      trick QEMU into thinking the raw file is a qcow2 file, it can
      access arbitrary files on the host by adding further backing
      store links.
      
      To address this, callers of virStorageFileGetMeta need to be
      told of the backing store format. If no format is declared,
      they can make a decision whether to allow format probing or
      not.
      a93402d4
  22. 28 6月, 2010 1 次提交
    • L
      Enhance virStorageFileIsSharedFS · fb457c5c
      Laine Stump 提交于
      virStorageFileIsSharedFS would previously only work if the entire path
      in question was stat'able by the uid of the libvirtd process. This
      patch changes it to crawl backwards up the path retrying the statfs
      call until it gets to a partial path that *can* be stat'ed.
      
      This is necessary to use the function to learn the fstype for files
      stored as a different user (and readable only by that user) on a
      root-squashed remote filesystem.
      fb457c5c
  23. 08 6月, 2010 1 次提交
    • D
      Enable probing of VPC disk format type · f4365c73
      Daniel P. Berrange 提交于
      A look at the QEMU source revealed the missing bits of info about
      the VPC file format, so we can enable this now
      
      * src/util/storage_file.c: Enable VPC format, providing version
        and disk size offset fields
      f4365c73
  24. 19 5月, 2010 1 次提交
    • J
      initialize "meta" in virStorageFileGetMetadata, not in each caller · dcf30d9c
      Jim Meyering 提交于
      Do not require each caller of virStorageFileGetMetadata and
      virStorageFileGetMetadataFromFD to first clear the storage of the
      "meta" buffer.  Instead, initialize that storage in
      virStorageFileGetMetadataFromFD.
      * src/util/storage_file.c (virStorageFileGetMetadataFromFD): Clear
      "meta" here, not before each of the following callers.
      * src/qemu/qemu_driver.c (qemuSetupDiskCgroup): Don't clear "meta" here.
      (qemuTeardownDiskCgroup): Likewise.
      * src/qemu/qemu_security_dac.c (qemuSecurityDACSetSecurityImageLabel):
      Likewise.
      * src/security/security_selinux.c (SELinuxSetSecurityImageLabel):
      Likewise.
      * src/security/virt-aa-helper.c (get_files): Likewise.
      dcf30d9c
  25. 17 5月, 2010 1 次提交
  26. 14 5月, 2010 1 次提交
    • D
      Don't reset user/group/security label on shared filesystems during migrate · 02ddaddf
      Daniel P. Berrange 提交于
      When QEMU runs with its disk on NFS, and as a non-root user, the
      disk is chownd to that non-root user. When migration completes
      the last step is shutting down the QEMU on the source host. THis
      normally resets user/group/security label. This is bad when the
      VM was just migrated because the file is still in use on the dest
      host. It is thus neccessary to skip the reset step for any files
      found to be on a shared filesystem
      
      * src/libvirt_private.syms: Export virStorageFileIsSharedFS
      * src/util/storage_file.c, src/util/storage_file.h: Add a new
        method virStorageFileIsSharedFS() to determine if a file is
        on a shared filesystem (NFS, GFS, OCFS2, etc)
      * src/qemu/qemu_driver.c: Tell security driver not to reset
        disk labels on migration completion
      * src/qemu/qemu_security_dac.c, src/qemu/qemu_security_stacked.c,
        src/security/security_selinux.c, src/security/security_driver.h,
        src/security/security_apparmor.c: Add ability to skip disk
        restore step for files on shared filesystems.
      02ddaddf
  27. 10 2月, 2010 2 次提交
    • J
      virAsprintf: remove its warn_unused_result attribute · 658952a3
      Jim Meyering 提交于
      * src/util/util.h (virAsprintf): Remove ATTRIBUTE_RETURN_CHECK, since
      it is perfectly fine to ignore the return value, now that the pointer
      is guaranteed to be set to NULL upon failure.
      * src/util/storage_file.c (absolutePathFromBaseFile): Remove now-
      unnecessary use of ignore_value.
      658952a3
    • J
      absolutePathFromBaseFile: avoid an unnecessary use of assert · e3042683
      Jim Meyering 提交于
      * src/util/storage_file.c (absolutePathFromBaseFile): While this use
      of virAsprintf is slightly cleaner than using stpncpy(stpcpy(...,
      it does impose an artificial limitation on the length of the base_file
      name.  Rather than asserting that it does not exceed INT_MAX, return
      NULL when it does.
      e3042683
  28. 09 2月, 2010 3 次提交
  29. 05 2月, 2010 2 次提交
    • J
      (absolutePathFromBaseFile): fix up preceding commit · c3e73528
      Jim Meyering 提交于
      When configured with --enable-gcc-warnings, it didn't even compile.
      * src/util/storage_file.c: Include <assert.h>.
      (absolutePathFromBaseFile): Assert that converting size_t to int is valid.
      Reverse length/string args to match "%.*s".
      Explicitly ignore the return value of virAsprintf.
      c3e73528
    • J
      absolutePathFromBaseFile: don't leak when first arg contains no "/" · 53b7dae1
      Jim Meyering 提交于
      * src/util/storage_file.c: Include "dirname.h".
      (absolutePathFromBaseFile): Rewrite not to leak, and to require
      fewer allocations.
      * bootstrap (modules): Add dirname-lgpl.
      * .gnulib: Update submodule to the latest.
      53b7dae1