1. 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
  2. 23 6月, 2011 1 次提交
  3. 16 5月, 2011 1 次提交
  4. 13 5月, 2011 1 次提交
    • M
      virFDStream: Add option for delete file after it's opening · 6a1f5f56
      Michal Privoznik 提交于
      This is needed if we want to transfer a temporary file. If the
      transfer is done with iohelper, we might run into a race condition,
      where we unlink() file before iohelper is executed.
      
      * src/fdstream.c, src/fdstream.h,
        src/util/iohelper.c: Add new option
      * src/lxc/lxc_driver.c, src/qemu/qemu_driver.c,
        src/storage/storage_driver.c, src/uml/uml_driver.c,
        src/xen/xen_driver.c: Expand existing function calls
      6a1f5f56
  5. 12 5月, 2011 1 次提交
    • E
      maint: omit translation for all VIR_INFO · cb84580a
      Eric Blake 提交于
      We were 31/73 on whether to translate; since less than 50% translated
      and since VIR_INFO is less than VIR_WARN which also doesn't translate,
      this makes sense.
      
      * cfg.mk (sc_prohibit_gettext_markup): Add VIR_INFO, since it
      falls between WARN and DEBUG.
      * daemon/libvirtd.c (qemudDispatchSignalEvent, remoteCheckAccess)
      (qemudDispatchServer): Adjust offenders.
      * daemon/remote.c (remoteDispatchAuthPolkit): Likewise.
      * src/network/bridge_driver.c (networkReloadIptablesRules)
      (networkStartNetworkDaemon, networkShutdownNetworkDaemon)
      (networkCreate, networkDefine, networkUndefine): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainDefine)
      (qemudDomainUndefine): Likewise.
      * src/storage/storage_driver.c (storagePoolCreate)
      (storagePoolDefine, storagePoolUndefine, storagePoolStart)
      (storagePoolDestroy, storagePoolDelete, storageVolumeCreateXML)
      (storageVolumeCreateXMLFrom, storageVolumeDelete): Likewise.
      * src/util/bridge.c (brProbeVnetHdr): Likewise.
      * po/POTFILES.in: Drop src/util/bridge.c.
      cb84580a
  6. 11 5月, 2011 1 次提交
    • M
      Rename internal DumpXML functions to GetXMLDesc · 9817604a
      Matthias Bolte 提交于
      This matches the public API and helps to get rid of some special
      case code in the remote generator.
      
      Rename driver API functions and XDR protocol structs.
      
      No functional change included outside of the remote generator.
      9817604a
  7. 05 5月, 2011 1 次提交
  8. 30 3月, 2011 1 次提交
    • N
      extend logging to record configuration-related changes · 343a27af
      Naoya Horiguchi 提交于
      Currently libvirt's default logging is limited and it is difficult to
      determine what was happening when a proglem occurred (especially on a
      machines where one don't know the detail.)  This patch helps to do that
      by making additional logging available for the following events:
      
        creating/defining/undefining domains
        creating/defining/undefining/starting/stopping networks
        creating/defining/undefining/starting/stopping storage pools
        creating/defining/undefining/starting/stopping storage volumes.
      
      * AUTHORS: add Naoya Horiguchi
      * src/network/bridge_driver.c src/qemu/qemu_driver.c
        src/storage/storage_driver.c: provide more VIR_INFO logging
      343a27af
  9. 29 3月, 2011 2 次提交
    • D
      Support volume data upload/download APIs in storage driver · 92563962
      Daniel P. Berrange 提交于
      Use generic FD streams to allow data upload/download to/from
      any storage volume
      
      * src/storage/storage_driver.c: Wire up upload/download APIs
      92563962
    • D
      Add public APIs for storage volume upload/download · 7300f68d
      Daniel P. Berrange 提交于
      New APIs are added allowing streaming of content to/from
      storage volumes.
      
      * include/libvirt/libvirt.h.in: Add virStorageVolUpload and
        virStorageVolDownload APIs
      * src/driver.h, src/libvirt.c, src/libvirt_public.syms: Stub
        code for new APIs
      * src/storage/storage_driver.c, src/esx/esx_storage_driver.c:
        Add dummy entries in driver table for new APIs
      7300f68d
  10. 19 1月, 2011 1 次提交
  11. 08 12月, 2010 1 次提交
    • E
      maint: update to latest gnulib · 8f636752
      Eric Blake 提交于
      * .gnulib: Update to latest, for at least a stdint.h fix
      * src/storage/storage_driver.c (storageVolumeZeroSparseFile)
      (storageWipeExtent): Use better type, although it still triggers
      spurious -Wformat warning on MacOS's gcc.
      8f636752
  12. 23 11月, 2010 2 次提交
    • D
      Fix error codes returned when a storage pool is inactive · e4c97a10
      Daniel P. Berrange 提交于
      Many operations are not valid on inactive storage pools. The
      storage driver is currently returning VIR_ERR_INTERNAL_ERROR
      in these cases, rather than the more suitable error code
      VIR_ERR_OPERATION_INVALID
      
      * src/storage/storage_driver.c: Fix error code when pool
        is not active
      e4c97a10
    • 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
  13. 17 11月, 2010 1 次提交
    • E
      maint: use gnulib configmake rather than open-coding things · 0d5f54bb
      Eric Blake 提交于
      * bootstrap.conf (gnulib_modules): Add configmake.
      * daemon/Makefile.am (libvirtd_CFLAGS): Drop defines provided by
      gnulib.
      * src/Makefile.am (INCLUDES): Likewise.
      * tests/Makefile.am (INCLUDES): Likewise.
      * tools/Makefile.am (virsh_CFLAGS): Likewise.
      * daemon/libvirtd.c (qemudInitPaths, usage, main): Update
      clients.
      * src/cpu/cpu_map.c (CPUMAPFILE): Likewise.
      * src/driver.c (DEFAULT_DRIVER_DIR): Likewise.
      * src/internal.h (_): Likewise.
      * src/libvirt.c (virInitialize): Likewise.
      * src/lxc/lxc_conf.h (LXC_CONFIG_DIR, LXC_STATE_DIR, LXC_LOG_DIR):
      Likewise.
      * src/lxc/lxc_conf.c (lxcCapsInit, lxcLoadDriverConfig):
      Likewise.
      * src/network/bridge_driver.c (NETWORK_PID_DIR)
      (NETWORK_STATE_DIR, DNSMASQ_STATE_DIR, networkStartup): Likewise.
      * src/nwfilter/nwfilter_driver.c (nwfilterDriverStartup):
      Likewise.
      * src/qemu/qemu_conf.c (qemudLoadDriverConfig): Likewise.
      * src/qemu/qemu_driver.c (qemudStartup): Likewise.
      * src/remote/remote_driver.h (LIBVIRTD_PRIV_UNIX_SOCKET)
      (LIBVIRTD_PRIV_UNIX_SOCKET_RO, LIBVIRTD_CONFIGURATION_FILE)
      (LIBVIRT_PKI_DIR): Likewise.
      * src/secret/secret_driver.c (secretDriverStartup): Likewise.
      * src/security/security_apparmor.c (VIRT_AA_HELPER): Likewise.
      * src/security/virt-aa-helper.c (main): Likewise.
      * src/storage/storage_backend_disk.c (PARTHELPER): Likewise.
      * src/storage/storage_driver.c (storageDriverStartup): Likewise.
      * src/uml/uml_driver.c (TEMPDIR, umlStartup): Likewise.
      * src/util/hooks.c (LIBVIRT_HOOK_DIR): Likewise.
      * tools/virsh.c (main): Likewise.
      * docs/hooks.html.in: Likewise.
      0d5f54bb
  14. 10 11月, 2010 1 次提交
    • 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
  15. 08 6月, 2010 2 次提交
    • D
      Fix error codes for missing storage pools · 627409d1
      Daniel P. Berrange 提交于
      The storage pool driver is mistakenly using the error code
      VIR_ERR_INVALID_STORAGE_POOL which is for diagnosing invalid
      pointers. This patch switches it to use VIR_ERR_NO_STORAGE_POOL
      which is the correct code for cases where the storage pool does
      not exist
      
      * src/storage/storage_driver.c: Replace VIR_ERR_INVALID_STORAGE_POOL
        with VIR_ERR_NO_STORAGE_POOL
      627409d1
    • 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
  16. 26 5月, 2010 1 次提交
  17. 21 5月, 2010 1 次提交
  18. 16 4月, 2010 1 次提交
  19. 06 4月, 2010 1 次提交
  20. 20 3月, 2010 1 次提交
  21. 10 3月, 2010 1 次提交
  22. 04 3月, 2010 1 次提交
  23. 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
  24. 09 2月, 2010 3 次提交
  25. 05 2月, 2010 1 次提交
  26. 21 1月, 2010 1 次提交
    • L
      Create storage volumes directly with desired uid/gid · e1f27784
      Laine Stump 提交于
      In order to avoid problems trying to chown files that were created by
      root on a root-squashing nfs server, fork a new process that setuid's
      to the desired uid before creating the file. (It's only done this way
      if the pool containing the new volume is of type 'netfs', otherwise
      the old method of creating the file followed by chown() is used.)
      
      This changes the semantics of the "create_func" slightly - previously
      it was assumed that this function just created the file, then the
      caller would chown it to the desired uid. Now, create_func does both
      operations.
      
      There are multiple functions that can take on the role of create_func:
      
      createFileDir - previously called mkdir(), now calls virDirCreate().
      virStorageBackendCreateRaw - previously called open(),
                                   now calls virFileCreate().
      virStorageBackendCreateQemuImg - use virRunWithHook() to setuid/gid.
      virStorageBackendCreateQcowCreate - same.
      virStorageBackendCreateBlockFrom - preserve old behavior (but attempt
                                         chown when necessary even if not root)
      
      * src/storage/storage_backend.[ch] src/storage/storage_backend_disk.c
        src/storage/storage_backend_fs.c src/storage/storage_backend_logical.c
        src/storage/storage_driver.c: change the create_func implementations,
        also propagate the pool information to be able to detect NETFS ones.
      e1f27784
  27. 18 12月, 2009 1 次提交
  28. 10 12月, 2009 1 次提交
    • M
      Add virBufferFreeAndReset() and replace free() · 1b9d0744
      Matthias Bolte 提交于
      Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
      Update documentation and replace all remaining calls to free() with
      calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
      and virReportOOMError() in OOM error cases.
      1b9d0744
  29. 11 11月, 2009 2 次提交
    • D
      Implmentation of new APIs to checking state/persistence of objects · cabc2cc9
      Daniel P. Berrange 提交于
      This implements the virConnectIsSecure, virConnectIsEncrypted,
      virDomainIsPersistent, virDomainIsActive, virNetworkIsActive,
      virNetworkIsPersistent, virStoragePoolIsActive,
      virStoragePoolIsPersistent, virInterfaceIsActive APIs in
      (nearly) all drivers. Exceptions are:
      
       phyp: missing domainIsActive/Persistent
       esx: missing domainIsPersistent
       opennebula: missing domainIsActive/Persistent
      
      * src/remote/remote_protocol.x: Define remote wire ABI for newly
        added APIs.
      * daemon/remote_dispatch*.h: Re-generated from remote_protocol.x
      * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/opennebula/one_driver.c, src/openvz/openvz_conf.c,
        src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
        src/remote/remote_driver.c, src/storage/storage_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/xen_driver.c, src/xen/xen_driver.h, src/xen/xen_inotify.c,
        src/xen/xen_inotify.h: Implement all the new APIs where possible
      cabc2cc9
    • D
      Various fixes following a code review · 52147a04
      Daniel Veillard 提交于
      * src/libvirt.c src/lxc/lxc_conf.c src/lxc/lxc_container.c
        src/lxc/lxc_controller.c src/node_device/node_device_hal.c
        src/openvz/openvz_conf.c src/qemu/qemu_driver.c
        src/qemu/qemu_monitor_text.c src/remote/remote_driver.c
        src/storage/storage_backend_disk.c src/storage/storage_driver.c
        src/util/logging.c src/xen/sexpr.c src/xen/xend_internal.c
        src/xen/xm_internal.c: Steve Grubb <sgrubb@redhat.com> sent a code
        review and those are the fixes correcting the problems
      52147a04
  30. 03 11月, 2009 1 次提交
    • D
      Fix return value in virStateInitialize impl for LXC · 979218cd
      Daniel P. Berrange 提交于
      The LXC driver was mistakenly returning -1 for lxcStartup()
      in scenarios that are not an error. This caused the libvirtd
      to quit for unprivileged users. This fixes the return code
      of LXC driver, and also adds a "name" field to the virStateDriver
      struct and logging to make it easier to find these problems
      in the future
      
      * src/driver.h: Add a 'name' field to state driver to allow
        easy identification during failures
      * src/libvirt.c: Log name of failed driver for virStateInit
        failures
      * src/lxc/lxc_driver.c: Don't return a failure code for
        lxcStartup() if LXC is not available on this host, simply
        disable the driver.
      * src/network/bridge_driver.c, src/node_device/node_device_devkit.c,
        src/node_device/node_device_hal.c, src/opennebula/one_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/secret/secret_driver.c, src/storage/storage_driver.c,
        src/uml/uml_driver.c, src/xen/xen_driver.c: Fill in name
        field in virStateDriver struct
      979218cd
  31. 13 10月, 2009 1 次提交
  32. 21 9月, 2009 1 次提交
  33. 10 9月, 2009 1 次提交
    • D
      Fix misc thread locking bugs / bogus warnings · 5c8d3d3b
      Daniel P. Berrange 提交于
      Fix all thread locking bugs reported by object-locking test
      case.
      
      NB, some of the driver locking is getting too coarse. Driver
      mutexes really need to be turned into RW locks instead to
      significantly increase concurrency.
      
      * src/lxc_driver.c: Fix useof driver when unlocked in the methods
        lxcDomainGetInfo, lxcSetSchedulerParameters, and
        lxcGetSchedulerParameters
      * src/opennebula/one_driver.c: Fix missing unlock in oneDomainUndefine.
        Fix use of driver when unlocked in oneDomainGetInfo,
        oneGetOSType, oneDomainShutdown
      * src/qemu_driver.c: Fix use of driver when unlocked in
        qemudDomainSavem, qemuGetSchedulerType, qemuSetSchedulerParameters
        and qemuGetSchedulerParameters
      * src/storage_driver.c: Re-work storagePoolCreate to avoid bogus
        lock checking warning. Re-work storageVolumeCreateXMLFrom to
        remove a potential NULL de-reference & avoid bogus lock check
        warnings
      * src/test.c: Remove testDomainAssignDef since it break lock chekc
        warnings.
      * tests/object-locking.ml: Add oneDriverLock, oneDriverUnlock
        and one_driver_t methods/types to allow lock checking on the
         OpenNebula drivers
      5c8d3d3b
  34. 07 9月, 2009 1 次提交