1. 31 1月, 2013 1 次提交
    • J
      Enforce return check on virAsprintf() calls · 46b1d8cf
      John Ferlan 提交于
      Way back when I started making changes for Coverity messages my first set
      were to a bunch of CHECKED_RETURN errors.  In particular virAsprintf() had
      a few callers that Coverity noted didn't check their return (although some
      did check if the buffer being printed to was NULL or not).
      
      It was suggested at the time as a further patch an ATTRIBUTE_RETURN_CHECK
      should be added to virAsprintf(), see:
      
      https://www.redhat.com/archives/libvir-list/2013-January/msg00120.html
      
      This patch does that and fixes a few more instances not found by Coverity
      that failed the check.
      46b1d8cf
  2. 21 12月, 2012 5 次提交
  3. 01 12月, 2012 1 次提交
  4. 15 11月, 2012 1 次提交
    • M
      Add a metadata parameter to virLog{, V}Message · c780e9b8
      Miloslav Trmač 提交于
      ... and update all users.  No change in functionality, the parameter
      will be used later.
      
      The metadata representation is as minimal as possible, but requires
      the caller to allocate an array on stack explicitly.
      
      The alternative of using varargs in the virLogMessage() callers:
      * Would not allow the caller to optionally omit some metadata elements,
        except by having two calls to virLogMessage.
      * Would not be as type-safe (e.g. using int vs. size_t), and the compiler
        wouldn't be able to do type checking
      * Depending on parameter order:
        a) virLogMessage(..., message format, message params...,
                         metadata..., NULL)
           can not be portably implemented (parse_printf_format() is a glibc
           function)
        b) virLogMessage(..., metadata..., NULL,
                         message format, message params...)
           would prevent usage of ATTRIBUTE_FMT_PRINTF and the associated
           compiler checking.
      Signed-off-by: NMiloslav Trmač <mitr@redhat.com>
      c780e9b8
  5. 02 11月, 2012 1 次提交
  6. 16 10月, 2012 1 次提交
    • D
      Introduce an internal API for handling file based lockspaces · eca72d47
      Daniel P. Berrange 提交于
      The previously introduced virFile{Lock,Unlock} APIs provide a
      way to acquire/release fcntl() locks on individual files. For
      unknown reason though, the POSIX spec says that fcntl() locks
      are released when *any* file handle referring to the same path
      is closed. In the following sequence
      
        threadA: fd1 = open("foo")
        threadB: fd2 = open("foo")
        threadA: virFileLock(fd1)
        threadB: virFileLock(fd2)
        threadB: close(fd2)
      
      you'd expect threadA to come out holding a lock on 'foo', and
      indeed it does hold a lock for a very short time. Unfortunately
      when threadB does close(fd2) this releases the lock associated
      with fd1. For the current libvirt use case for virFileLock -
      pidfiles - this doesn't matter since the lock is acquired
      at startup while single threaded an never released until
      exit.
      
      To provide a more generally useful API though, it is necessary
      to introduce a slightly higher level abstraction, which is to
      be referred to as a "lockspace".  This is to be provided by
      a virLockSpacePtr object in src/util/virlockspace.{c,h}. The
      core idea is that the lockspace keeps track of what files are
      already open+locked. This means that when a 2nd thread comes
      along and tries to acquire a lock, it doesn't end up opening
      and closing a new FD. The lockspace just checks the current
      list of held locks and immediately returns VIR_ERR_RESOURCE_BUSY.
      
      NB, the API as it stands is designed on the basis that the
      files being locked are not being otherwise opened and used
      by the application code. One approach to using this API is to
      acquire locks based on a hash of the filepath.
      
      eg to lock /var/lib/libvirt/images/foo.img the application
      might do
      
         virLockSpacePtr lockspace = virLockSpaceNew("/var/lib/libvirt/imagelocks");
         lockname = md5sum("/var/lib/libvirt/images/foo.img");
         virLockSpaceAcquireLock(lockspace, lockname);
      
      NB, in this example, the caller should ensure that the path
      is canonicalized before calculating the checksum.
      
      It is also possible to do locks directly on resources by
      using a NULL lockspace directory and then using the file
      path as the lock name eg
      
         virLockSpacePtr lockspace = virLockSpaceNew(NULL);
         virLockSpaceAcquireLock(lockspace, "/var/lib/libvirt/images/foo.img");
      
      This is only safe to do though if no other part of the process
      will be opening the files. This will be the case when this
      code is used inside the soon-to-be-reposted virlockd daemon
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      eca72d47
  7. 28 9月, 2012 2 次提交
  8. 21 9月, 2012 1 次提交
  9. 28 8月, 2012 1 次提交
    • M
      Introduce new VIR_ERR_AGENT_UNRESPONSIVE error code · aa3e8bd4
      Michal Privoznik 提交于
      Currently, when guest agent is configured but not responsive
      (e.g. due to appropriate service not running in the guest)
      we return VIR_ERR_INTERNAL_ERROR. Both are wrong. Therefore
      we need to introduce new error code to reflect this case.
      aa3e8bd4
  10. 21 8月, 2012 1 次提交
    • P
      libssh2_transport: add main libssh2 transport implementation · 1193fc5f
      Peter Krempa 提交于
      This patch adds helper functions that enable us to use libssh2 in
      conjunction with libvirt's virNetSockets for ssh transport instead of
      spawning "ssh" client process.
      
      This implemetation supports tunneled plaintext, keyboard-interactive,
      private key, ssh agent based and null authentication. Libvirt's Auth
      callback is used for interaction with the user. (Keyboard interactive
      authentication, adding of host keys, private key passphrases). This
      enables seamless integration into the application using libvirt. No
      helpers as "ssh-askpass" are needed.
      
      Reading and writing of OpenSSH style "known_hosts" files is supported.
      
      Communication is done using SSH exec channel, where the user may specify
      arbitrary command to be executed on the remote side and reads and writes
      to/from stdin/out are sent through the ssh channel. Usage of stderr is
      not (yet) supported.
      1193fc5f
  11. 18 8月, 2012 1 次提交
  12. 11 8月, 2012 1 次提交
    • P
      virterror: Add error message for unsupported operations. · e9a24e3e
      Peter Krempa 提交于
      This patch introduces a new error code VIR_ERR_OPERATION_UNSUPPORTED to
      mark error messages regarding operations that failed due to lack of
      support on the hypervisor or other than libvirt issues.
      
      The code is first used in reporting error if qemu does not support block
      IO tuning variables yielding error message:
      error: Unable to get block I/O throttle parameters
      error: Operation not supported: block_io_throttle field
      'total_bytes_sec' missing in qemu's output
      
      instead of:
      error: Unable to get block I/O throttle parameters
      error: internal error cannot read total_bytes_sec
      e9a24e3e
  13. 01 8月, 2012 1 次提交
  14. 27 7月, 2012 1 次提交
    • O
      maint: Use consistent copyright. · a4bcefbc
      Osier Yang 提交于
      This is a follow up patch of commit f9ce7dad, it modifies all
      the files which declare the copyright like "See COPYING.LIB for
      the License of this software" to use the detailed/consistent one.
      
      And deserts the outdated comments like:
      
       * libvirt-qemu.h:
       * Summary: qemu specific interfaces
       * Description: Provides the interfaces of the libvirt library to handle
       *              qemu specific methods
       *
       * Copy:  Copyright (C) 2010, 2012 Red Hat, Inc.
      
      Uses the more compact style like:
      
       * libvirt-qemu.h: Interfaces specific for QEMU/KVM driver
       *
       * Copyright (C) 2010, 2012 Red Hat, Inc.
      a4bcefbc
  15. 21 7月, 2012 1 次提交
    • D
      Report 'errno' in int1 field of virErrorPtr · 2ef6f69a
      Daniel P. Berrange 提交于
      When reporting a system error (VIR_ERR_SYSTEM_ERROR) via
      virReportSystemError, we should copy the errno value into
      the 'int1' field of the virErrorPtr struct. This allows
      callers to detect certain errno conditions & discard the
      error
      
      * src/util/virterror.c: Place errno value in int1 field
      2ef6f69a
  16. 24 5月, 2012 1 次提交
    • D
      Add sentinel for virErrorDomain enum · 1cc2034a
      Daniel P. Berrange 提交于
      Add a VIR_ERR_DOMAIN_LAST sentinel for virErrorDomain and
      replace the virErrorDomainName function by a VIR_ENUM_IMPL
      
      In the process the naming of error domains is sanitized
      
      * src/util/virterror.c: Use VIR_ENUM_IMPL for converting
        error domains to strings
      * include/libvirt/virterror.h: Add VIR_ERR_DOMAIN_LAST
      1cc2034a
  17. 23 4月, 2012 1 次提交
    • E
      blockjob: add new API flags · 36484692
      Eric Blake 提交于
      This patch introduces a new block job, useful for live storage
      migration using pre-copy streaming.  Justification for including
      this under virDomainBlockRebase rather than adding a new command
      includes: 1) there are now two possible block jobs in qemu, with
      virDomainBlockRebase starting either type of command, and
      virDomainBlockJobInfo and virDomainBlockJobAbort working to end
      either type; 2) reusing this command allows distros to backport
      this feature to the libvirt 0.9.10 API without a .so bump.
      
      Note that a future patch may add a more powerful interface named
      virDomainBlockJobCopy, dedicated to just the block copy job, in
      order to expose even more options (such as setting an arbitrary
      format type for the destination without having to probe it from a
      pre-existing destination file); adding a new command for targetting
      just block copy would be similar to how we already have
      virDomainBlockPull for targetting just the block pull job.
      
      Using a live VM with the backing chain:
        base <- snap1 <- snap2
      as the starting point, we have:
      
      - virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
          VIR_DOMAIN_BLOCK_REBASE_COPY)
      creates /path/to/copy with the same format as snap2, with no backing
      file, so entire chain is copied and flattened
      
      - virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
          VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
      creates /path/to/copy as a raw file, so entire chain is copied and
      flattened
      
      - virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
          VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
      creates /path/to/copy with the same format as snap2, but with snap1 as
      a backing file, so only snap2 is copied.
      
      - virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
          VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT)
      reuse existing /path/to/copy (must have empty contents, and format is
      probed[*] from the metadata), and copy the full chain
      
      - virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
          VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
          VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
      reuse existing /path/to/copy (contents must be identical to snap1,
      and format is probed[*] from the metadata), and copy only the contents
      of snap2
      
      - virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
          VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
          VIR_DOMAIN_BLOCK_REBASE_SHALLOW|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
      reuse existing /path/to/copy (must be raw volume with contents
      identical to snap1), and copy only the contents of snap2
      
      Less useful combinations:
      
      - virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
          VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW|
          VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
      fail if source is not raw, otherwise create /path/to/copy as raw and
      the single file is copied (no chain involved)
      
      - virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
          VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
          VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
      makes little sense: the destination must be raw but have no contents,
      meaning that it is an empty file, so there is nothing to reuse
      
      The other three flags are rejected without VIR_DOMAIN_BLOCK_COPY.
      
      [*] Note that probing an existing file for its format can be a security
      risk _if_ there is a possibility that the existing file is 'raw', in
      which case the guest can manipulate the file to appear like some other
      format.  But, by virtue of the VIR_DOMAIN_BLOCK_REBASE_COPY_RAW flag,
      it is possible to avoid probing of raw files, at which point, probing
      of any remaining file type is no longer a security risk.
      
      It would be nice if we could issue an event when pivoting from phase 1
      to phase 2, but qemu hasn't implemented that, and we would have to poll
      in order to synthesize it ourselves.  Meanwhile, qemu will give us a
      distinct job info and completion event when we either cancel or pivot
      to end the job.  Pivoting is accomplished via the new:
      
      virDomainBlockJobAbort(dom, disk, VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT)
      
      Management applications can pre-create the copy with a relative
      backing file name, and use the VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT
      flag to have qemu reuse the metadata; if the management application
      also copies the backing files to a new location, this can be used
      to perform live storage migration of an entire backing chain.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_JOB_TYPE_COPY):
      New block job type.
      (virDomainBlockJobAbortFlags, virDomainBlockRebaseFlags): New enums.
      * src/libvirt.c (virDomainBlockRebase): Document the new flags,
      and implement general restrictions on flag combinations.
      (virDomainBlockJobAbort): Document the new flag.
      (virDomainSaveFlags, virDomainSnapshotCreateXML)
      (virDomainRevertToSnapshot, virDomainDetachDeviceFlags): Document
      restrictions.
      * include/libvirt/virterror.h (VIR_ERR_BLOCK_COPY_ACTIVE): New
      error.
      * src/util/virterror.c (virErrorMsg): Define it.
      36484692
  18. 20 4月, 2012 1 次提交
    • D
      The policy kit and HAL node device drivers both require a · 2223ea98
      Daniel P. Berrange 提交于
      DBus connection. The HAL device code further requires that
      the DBus connection is integrated with the event loop and
      provides such glue logic itself.
      
      The forthcoming FirewallD integration also requires a
      dbus connection with event loop integration. Thus we need
      to pull the current event loop glue out of the HAL driver.
      
      Thus we create src/util/virdbus.{c,h} files. This contains
      just one method virDBusGetSystemBus() which obtains a handle
      to the single shared system bus instance, with event glue
      automagically setup.
      2223ea98
  19. 30 3月, 2012 1 次提交
  20. 27 3月, 2012 1 次提交
    • M
      Cleanup for a return statement in source files · 9943276f
      Martin Kletzander 提交于
      Return statements with parameter enclosed in parentheses were modified
      and parentheses were removed. The whole change was scripted, here is how:
      
      List of files was obtained using this command:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$'
      
      Found files were modified with this command:
      sed -i -e                                                                 \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      
      Then checked for nonsense.
      
      The whole command looks like this:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      9943276f
  21. 23 3月, 2012 2 次提交
  22. 08 3月, 2012 1 次提交
    • E
      api: add overflow error · 239fb8c4
      Eric Blake 提交于
      Overflow can be user-induced, so it deserves more than being called
      an internal error.  Note that in general, 32-bit platforms have
      far more places to trigger this error (anywhere the public API
      used 'unsigned long' but the other side of the connection is a
      64-bit server); but some are possible on 64-bit platforms (where
      the public API computes the product of two numbers).
      
      * include/libvirt/virterror.h (VIR_ERR_OVERFLOW): New error.
      * src/util/virterror.c (virErrorMsg): Translate it.
      * src/libvirt.c (virDomainSetVcpusFlags, virDomainGetVcpuPinInfo)
      (virDomainGetVcpus, virDomainGetCPUStats): Use it.
      * daemon/remote.c (HYPER_TO_TYPE): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainBlockResize): Likewise.
      239fb8c4
  23. 24 2月, 2012 1 次提交
    • B
      virterror: Misleading error message when name is missing · cff5573d
      Benjamin Cama 提交于
      [forwarding this here from RH bug #796732]
      
      When creating a network (virsh net-create) with an erroneous XML
      containing an empty <name> element, the error message is misleading:
      
      error: Failed to create network from foo.xml
      error: missing domain name information
      
      It took me a bit of time to figure out that it was the *network* name
      that was missing (I generate this xml and didn't look at it, first).
      
      I realized that the same message is used for missing name when creating
      a domain, network, or device node.
      cff5573d
  24. 22 2月, 2012 1 次提交
    • J
      Add support for unsafe migration · 7808844d
      Jiri Denemark 提交于
      This patch adds VIR_MIGRATE_UNSAFE flag for migration APIs and new
      VIR_ERR_MIGRATION_UNSAFE error code.  The error code should be returned
      whenever migrating a domain is considered unsafe (e.g., it's configured
      in a way that does not ensure data integrity once it is migrated).
      VIR_MIGRATE_UNSAFE flag may be used to force migration even though it
      would normally be considered unsafe and forbidden.
      7808844d
  25. 04 2月, 2012 1 次提交
  26. 02 2月, 2012 1 次提交
    • P
      API: Add api to set and get domain metadata · c471e55e
      Peter Krempa 提交于
      This patch adds API to modify domain metadata for running and stopped
      domains. The api supports changing description, title as well as the
      newly added <metadata> element. The API has support for storing data in
      the metadata element using xml namespaces.
      
      * include/libvirt/libvirt.h.in
      * src/libvirt_public.syms
              - add function headers
              - add enum to select metadata to operate on
              - export functions
      * src/libvirt.c
              - add public api implementation
      * src/driver.h
              - add driver support
      * src/remote/remote_driver.c
      * src/remote/remote_protocol.x
              - wire up the remote protocol
      * include/libvirt/virterror.h
      * src/util/virterror.c
              - add a new error message note that metadata for domain are
              missing
      c471e55e
  27. 28 1月, 2012 1 次提交
    • C
      Add new error code VIR_ERROR_AUTH_CANCELLED · bb2eddc6
      Cole Robinson 提交于
      And hook it up for policykit auth. This allows virt-manager to detect
      that the user clicked the policykit 'cancel' button and not throw
      an 'authentication failed' error message at the user.
      bb2eddc6
  28. 26 1月, 2012 1 次提交
  29. 20 1月, 2012 2 次提交
    • E
      error: drop old-style error reporting · c2551bea
      Eric Blake 提交于
      While we still don't want to enable gcc's new -Wformat-literal
      warning, I found a rather easy case where the warning could be
      reduced, by getting rid of obsolete error-reporting practices.
      This is the last place where we were passing the (unused) net
      and conn arguments for constructing an error.
      
      * src/util/virterror_internal.h (virErrorMsg): Delete prototype.
      (virReportError): Delete macro.
      * src/util/virterror.c (virErrorMsg): Make static.
      * src/libvirt_private.syms (virterror_internal.h): Drop export.
      * src/util/conf.c (virConfError): Convert to macro.
      (virConfErrorHelper): New function, and adjust error calls.
      * src/xen/xen_hypervisor.c (virXenErrorFunc): Delete.
      (xenHypervisorGetSchedulerType)
      (xenHypervisorGetSchedulerParameters)
      (xenHypervisorSetSchedulerParameters)
      (xenHypervisorDomainBlockStats)
      (xenHypervisorDomainInterfaceStats)
      (xenHypervisorDomainGetOSType)
      (xenHypervisorNodeGetCellsFreeMemory, xenHypervisorGetVcpus):
      Update callers.
      c2551bea
    • E
      threads: check for failure to set thread-local value · 927cfaf4
      Eric Blake 提交于
      We had a memory leak on a very arcane OOM situation (unlikely to ever
      hit in practice, but who knows if libvirt.so would ever be linked
      into some other program that exhausts all thread-local storage keys?).
      I found it by code inspection, while analyzing a valgrind report
      generated by Alex Jia.
      
      * src/util/threads.h (virThreadLocalSet): Alter signature.
      * src/util/threads-pthread.c (virThreadHelper): Reduce allocation
      lifetime.
      (virThreadLocalSet): Detect failure.
      * src/util/threads-win32.c (virThreadLocalSet): Likewise.
      (virCondWait): Fix caller.
      * src/util/virterror.c (virLastErrorObject): Likewise.
      927cfaf4
  30. 16 12月, 2011 1 次提交
    • P
      migration: Add more specific error code/message on migration abort · 8fb2aeb6
      Peter Krempa 提交于
      A generic error code was returned, if the user aborted a migration job.
      This made it hard to distinguish between a user requested abort and an
      error that might have occured. This patch introduces a new error code,
      which is returned in the specific case of a user abort, while leaving
      all other failures with their existing code. This makes it easier to
      distinguish between failure while mirgrating and an user requested
      abort.
      
       * include/libvirt/virterror.h: - add new error code
       * src/util/virterror.c: - add message for the new error code
       * src/qemu/qemu_migration.h: - Emit operation aborted error instead of
                                      operation failed, on migration abort
      8fb2aeb6
  31. 22 11月, 2011 1 次提交
    • S
      Export KVM Host Power Management capabilities · e352b164
      Srivatsa S. Bhat 提交于
      This patch exports KVM Host Power Management capabilities as XML so that
      higher-level systems management software can make use of these features
      available in the host.
      
      The script "pm-is-supported" (from pm-utils package) is run to discover if
      Suspend-to-RAM (S3) or Suspend-to-Disk (S4) is supported by the host.
      If either of them are supported, then a new tag "<power_management>" is
      introduced in the XML under the <host> tag.
      
      However in case the query to check for power management features succeeded,
      but the host does not support any such feature, then the XML will contain
      an empty <power_management/> tag. In the event that the PM query itself
      failed, the XML will not contain any "power_management" tag.
      
      To use this, new APIs could be implemented in libvirt to exploit power
      management features such as S3/S4.
      e352b164
  32. 06 10月, 2011 1 次提交
    • E
      snapshot: add REVERT_FORCE to API · 3c797404
      Eric Blake 提交于
      Although reverting to a snapshot is a form of data loss, this is
      normally expected.  However, there are two cases where additional
      surprises (failure to run the reverted state, or a break in
      connectivity to the domain) can come into play.  Requiring extra
      acknowledgment in these cases will make it less likely that
      someone can get into an unrecoverable state due to a default revert.
      
      Also create a new error code, so users can distinguish when forcing
      would make a difference, rather than having to blindly request force.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_REVERT_FORCE):
      New flag.
      * src/libvirt.c (virDomainRevertToSnapshot): Document it.
      * include/libvirt/virterror.h (VIR_ERR_SNAPSHOT_REVERT_RISKY): New
      error value.
      * src/util/virterror.c (virErrorMsg): Implement it.
      * tools/virsh.c (cmdDomainSnapshotRevert): Add --force to virsh.
      * tools/virsh.pod (snapshot-revert): Document it.
      3c797404
  33. 02 9月, 2011 1 次提交
    • O
      storage: Add fs pool formatting · 27758859
      Osier Yang 提交于
      This patch adds the ability to make the filesystem for a filesystem
      pool during a pool build.
      
      The patch adds two new flags, no overwrite and overwrite, to control
      when mkfs gets executed.  By default, the patch preserves the
      current behavior, i.e., if no flags are specified, pool build on a
      filesystem pool only makes the directory on which the filesystem
      will be mounted.
      
      If the no overwrite flag is specified, the target device is checked
      to determine if a filesystem of the type specified in the pool is
      present.  If a filesystem of that type is already present, mkfs is
      not executed and the build call returns an error.  Otherwise, mkfs
      is executed and any data present on the device is overwritten.
      
      If the overwrite flag is specified, mkfs is always executed, and any
      existing data on the target device is overwritten unconditionally.
      27758859