1. 27 3月, 2010 1 次提交
  2. 26 3月, 2010 2 次提交
    • D
      Introduce a new virDomainUpdateDeviceFlags public API · 46a2ea36
      Daniel P. Berrange 提交于
      The current virDomainAttachDevice API can be (ab)used to change
      the media of an existing CDROM/Floppy device. Going forward there
      will be more devices that can be configured on the fly and overloading
      virDomainAttachDevice for this is not too pleasant. This patch adds
      a new virDomainUpdateDeviceFlags() explicitly just for modifying
      existing devices.
      
      * include/libvirt/libvirt.h.in: Add virDomainUpdateDeviceFlags
      * src/driver.h: Internal API for virDomainUpdateDeviceFlags
      * src/libvirt.c, src/libvirt_public.syms: Glue public API to
        driver API
      * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
        src/openvz/openvz_driver.c, src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
        src/remote/remote_driver.c, src/test/test_driver.c, src/uml/uml_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Add
        stubs for new driver entry point
      46a2ea36
    • D
      Introduce a new public API for domain events · 44457238
      Daniel P. Berrange 提交于
      The current API for domain events has a number of problems
      
       - Only allows for domain lifecycle change events
       - Does not allow the same callback to be registered multiple times
       - Does not allow filtering of events to a specific domain
      
      This introduces a new more general purpose domain events API
      
        typedef enum {
           VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0,       /* virConnectDomainEventCallback */
            ...more events later..
        }
      
        int virConnectDomainEventRegisterAny(virConnectPtr conn,
                                             virDomainPtr dom, /* Optional, to filter */
                                             int eventID,
                                             virConnectDomainEventGenericCallback cb,
                                             void *opaque,
                                             virFreeCallback freecb);
      
        int virConnectDomainEventDeregisterAny(virConnectPtr conn,
                                               int callbackID);
      
      Since different event types can received different data in the callback,
      the API is defined with a generic callback. Specific events will each
      have a custom signature for their callback. Thus when registering an
      event it is neccessary to cast the callback to the generic signature
      
      eg
      
        int myDomainEventCallback(virConnectPtr conn,
                                  virDomainPtr dom,
                                  int event,
                                  int detail,
                                  void *opaque)
        {
          ...
        }
      
        virConnectDomainEventRegisterAny(conn, NULL,
                                         VIR_DOMAIN_EVENT_ID_LIFECYCLE,
                                         VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback)
                                         NULL, NULL);
      
      The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast
      to the generic signature
      
      * include/libvirt/libvirt.h.in: Define new APIs for registering
        domain events
      * src/driver.h: Internal driver entry points for new events APIs
      * src/libvirt.c: Wire up public API to driver API for events APIs
      * src/libvirt_public.syms: Export new APIs
      * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
        src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
        src/xenapi/xenapi_driver.c: Stub out new API entries
      44457238
  3. 20 3月, 2010 2 次提交
  4. 15 3月, 2010 1 次提交
  5. 10 3月, 2010 1 次提交
  6. 08 3月, 2010 1 次提交
    • E
      build: consistently use C99 varargs macros · 2e56fb2b
      Eric Blake 提交于
      Prior to this patch, there was an inconsistent mix between GNU and C99.
      
      For consistency, and potential portability to other compilers, stick
      with the C99 vararg macro syntax.
      
      * src/conf/cpu_conf.c (virCPUReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/conf/domain_conf.c (virDomainReportError): Likewise.
      * src/conf/domain_event.c (eventReportError): Likewise.
      * src/conf/interface_conf.c (virInterfaceReportError): Likewise.
      * src/conf/network_conf.c (virNetworkReportError): Likewise.
      * src/conf/node_device_conf.h (virNodeDeviceReportError): Likewise.
      * src/conf/secret_conf.h (virSecretReportError): Likewise.
      * src/conf/storage_conf.h (virStorageReportError): Likewise.
      * src/esx/esx_device_monitor.c (ESX_ERROR): Use C99 rather than
        GNU vararg macro syntax.
      * src/esx/esx_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_interface_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_network_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_secret_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_storage_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_util.c (ESX_ERROR): Likewise.
      * src/esx/esx_vi.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vi_methods.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vi_types.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vmx.c (ESX_ERROR): Likewise.
      * src/util/hostusb.c (usbReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/util/json.c (virJSONError): Likewise.
      * src/util/macvtap.c (ReportError): Likewise.
      * src/util/pci.c (pciReportError): Likewise.
      * src/util/stats_linux.c (virStatsError): Likewise.
      * src/util/util.c (virUtilError): Likewise.
      * src/util/xml.c (virXMLError): Likewise.
      * src/xen/proxy_internal.c (virProxyError): Use C99 rather than
        GNU vararg macro syntax.
      * src/xen/sexpr.c (virSexprError): Likewise.
      * src/xen/xen_driver.c (xenUnifiedError): Likewise.
      * src/xen/xen_hypervisor.c (virXenError): Likewise.
      * src/xen/xen_inotify.c (virXenInotifyError): Likewise.
      * src/xen/xend_internal.c (virXendError): Likewise.
      * src/xen/xm_internal.c (xenXMError): Likewise.
      * src/xen/xs_internal.c (virXenStoreError): Likewise.
      * src/cpu/cpu.h (virCPUReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/datatypes.c (virLibConnError): Likewise.
      * src/interface/netcf_driver.c (interfaceReportError): Likewise.
      * src/libvirt.c (virLibStreamError): Likewise.
      * src/lxc/lxc_conf.h (lxcError): Likewise.
      * src/network/bridge_driver.c (networkReportError): Likewise.
      * src/nodeinfo.c (nodeReportError): Likewise.
      * src/opennebula/one_conf.h (oneError): Likewise.
      * src/openvz/openvz_conf.h (openvzError): Likewise.
      * src/phyp/phyp_driver.c (PHYP_ERROR): Likewise.
      * src/qemu/qemu_conf.h (qemuReportError): Likewise.
      * src/remote/remote_driver.c (errorf): Likewise.
      * src/security/security_driver.h (virSecurityReportError): Likewise.
      * src/test/test_driver.c (testError): Likewise.
      * src/uml/uml_conf.h (umlReportError): Likewise.
      * src/vbox/vbox_driver.c (vboxError): Likewise.
      * src/vbox/vbox_tmpl.c (vboxError): Likewise.
      2e56fb2b
  7. 03 3月, 2010 2 次提交
    • D
      Wire up internal entry points for virDomainAbortJob API · 0d8aa35f
      Daniel P. Berrange 提交于
      This provides the internal glue for the driver API
      
      * src/driver.h: Internal API contract
      * src/libvirt.c, src/libvirt_public.syms: Connect public API
        to driver API
      * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
        src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/test/test_driver.c src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/xen_driver.c: Stub out entry points
      0d8aa35f
    • D
      Stub out internal driver entry points for job processing · 92bd859a
      Daniel P. Berrange 提交于
      The internal glue layer for the new pubic API
      
      * src/driver.h: Define internal driver API contract
      * src/libvirt.c, src/libvirt_public.syms: Wire up public
        API to internal driver API
      * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
        src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/xen_driver.c: Stub new entry point
      92bd859a
  8. 26 2月, 2010 1 次提交
    • C
      Use standard spacing for user/pass prompt · 8ac0334e
      Cole Robinson 提交于
      Kind of minor, but it annoys me that the default auth callback
      doesn't put a space between the prompt and the input, like a typical
      terminal, ssh, etc. This patch changes the current prompt:
      
      Please enter your authentication name:myuser
      
      to
      
      Please enter your authentication name: myuser
      8ac0334e
  9. 18 2月, 2010 1 次提交
  10. 12 2月, 2010 1 次提交
  11. 09 2月, 2010 3 次提交
  12. 01 2月, 2010 1 次提交
  13. 27 1月, 2010 1 次提交
  14. 12 1月, 2010 2 次提交
    • C
      libvirt.c: Preserve MigratePerform failure · e85065b8
      Cole Robinson 提交于
      e85065b8
    • D
      Ensure error handling callback functions are called from safe context · 3a80f2f7
      Daniel P. Berrange 提交于
      The virRaiseErrorFull() may invoke the error handler callback
      functions an application has registered. This is not good
      because the connection object may not be available at this
      point, and the caller may be holding locks. This creates a
      problem if the error handler calls back into libvirt.
      
      The solutuon is to move invocation of the handler into the
      final cleanup code in the public API entry points, where it
      is guarenteed to have safe state.
      
      * src/libvirt.c: Invoke virDispatchError() in all error paths
      * src/util/virterror.c: Remove virSetConnError/virSetGlobalError,
        replacing with virDispatchError(). Move invocation of the
        error callbacks into virDispatchError() instead of the
        virRaiseErrorFull function which is not in a safe context
      3a80f2f7
  15. 20 12月, 2009 1 次提交
  16. 19 12月, 2009 1 次提交
    • M
      Fix compilation with gcrypt < 1.4.2 · 1c5c6333
      Matthias Bolte 提交于
      Commit 33a198c1 increased the gcrypt
      version requirement to 1.4.2 because the GCRY_THREAD_OPTION_VERSION
      define was added in this version.
      
      The configure script doesn't check for the gcrypt version. To support
      gcrypt versions < 1.4.2 change the virTLSThreadImpl initialization
      to use GCRY_THREAD_OPTION_VERSION only if it's defined.
      1c5c6333
  17. 18 12月, 2009 2 次提交
    • J
      Public API implementation · 0b7d2ae6
      Jiri Denemark 提交于
      * src/libvirt.c: adds the public entry point virConnectCompareCPU()
      0b7d2ae6
    • D
      Initialize gcrypt threading · 33a198c1
      Daniel P. Berrange 提交于
      GNUTLS uses gcrypt for its crypto functions. gcrypt requires
      that the app/library initializes threading before using it.
      We don't want to force apps using libvirt to know about
      gcrypt, so we make virInitialize init threading on their
      behalf. This location also ensures libvirtd has initialized
      it correctly. This initialization is required even if libvirt
      itself were only using one thread, since another non-libvirt
      library (eg GTK-VNC) could also be using gcrypt from another
      thread
      
      * src/libvirt.c: Register thread functions for gcrypt
      * configure.in: Add -lgcrypt to linker flags
      33a198c1
  18. 16 12月, 2009 1 次提交
  19. 11 12月, 2009 2 次提交
    • P
      retrieve paused/running state at migration start · 5de41c06
      Paolo Bonzini 提交于
      This patch fixes the bug where paused/running state is not
      transmitted during migration.  As a result, in the QEMU driver
      for example the machine was always started on the destination
      end.
      
      In order to do so, just read the state and if it is appropriate and
      set the VIR_MIGRATE_PAUSED flag.
      
      * src/libvirt.c (virDomainMigrateVersion1, virDomainMigrateVersion2):
        Automatically add VIR_MIGRATE_PAUSED when appropriate.
      * src/xen/xend_internal.c (xenDaemonDomainMigratePerform): Give a nicer
        error message when migration of paused domains is attempted.
      5de41c06
    • P
      add virsh --suspend arg to migrate command · edc9e78b
      Paolo Bonzini 提交于
      This adds a new flag, VIR_MIGRATE_PAUSED, that mandates pausing
      the migrated VM before starting it.
      
      * include/libvirt/libvirt.h.in (virDomainMigrateFlags): Add VIR_MIGRATE_PAUSED.
      * src/qemu/qemu_driver.c (qemudDomainMigrateFinish2): Handle VIR_MIGRATE_PAUSED.
      * tools/virsh.c (opts_migrate): Add --suspend. (cmdMigrate): Handle it.
      * tools/virsh.pod (migrate): Document it.
      edc9e78b
  20. 12 11月, 2009 1 次提交
    • C
      Add virConnectGetLibvirtVersion API · ce4c0bf5
      Cole Robinson 提交于
      There is currently no way to determine the libvirt version of a remote
      libvirtd we are connected to. This is a useful piece of data to enable
      feature detection.
      ce4c0bf5
  21. 11 11月, 2009 2 次提交
    • D
      New APIs for checking some object properties · c04498b3
      Daniel P. Berrange 提交于
      Introduce a number of new APIs to  expose some boolean properties
      of objects, which cannot otherwise reliably determined, nor are
      aspects of the XML configuration.
      
       * virDomainIsActive: Checking virDomainGetID is not reliable
         since it is not possible to distinguish between error condition
         and inactive domain for ID of -1.
       * virDomainIsPersistent: Check whether a persistent config exists
         for the domain
      
       * virNetworkIsActive: Check whether the network is active
       * virNetworkIsPersistent: Check whether a persistent config exists
         for the network
      
       * virStoragePoolIsActive: Check whether the storage pool is active
       * virStoragePoolIsPersistent: Check whether a persistent config exists
         for the storage pool
      
       * virInterfaceIsActive: Check whether the host interface is active
      
       * virConnectIsSecure: whether the communication channel to the
         hypervisor is secure
       * virConnectIsEncrypted: whether any network based commnunication
         channels are encrypted
      
      NB, a channel can be secure, even if not encrypted, eg if it does
      not involve the network, like a UNIX socket, or pipe.
      
       * include/libvirt/libvirt.h.in: Define public API
       * src/driver.h: Define internal driver API
       * src/libvirt.c: Implement public API entry point
       * src/libvirt_public.syms: Export API symbols
       * src/esx/esx_driver.c, src/lxc/lxc_driver.c,
         src/interface/netcf_driver.c, src/network/bridge_driver.c,
         src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
         src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
         src/remote/remote_driver.c, src/test/test_driver.c,
         src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
         src/xen/xen_driver.c: Stub out driver tables
      c04498b3
    • 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
  22. 04 11月, 2009 1 次提交
    • L
      Support reporting live interface IP/netmask · 753c6c9c
      Laine Stump 提交于
      This patch adds the flag VIR_INTERFACE_XML_INACTIVE to
      virInterfaceGetXMLDesc's flags. When it is*not* set (the default), the
      live interface info will be returned in the XML (in particular, the IP
      address(es) and netmask(s) will be retrieved by querying the interface
      directly, rather than  reporting what's in the config file). The
      backend of this is in netcf's ncf_if_xml_state() function.
      
      * configure.in libvirt.spec.in: requires netcf >= 0.1.3
      * include/libvirt/libvirt.h.in: adds flag VIR_INTERFACE_XML_INACTIVE
      * src/conf/interface_conf.c src/interface/netcf_driver.c src/libvirt.c:
        update the parsing and backend routines accordingly
      * tools/virsh.c: change interface edit to inactive definition and
        adds the inactive flag for interface dump
      753c6c9c
  23. 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
  24. 28 10月, 2009 2 次提交
  25. 27 10月, 2009 1 次提交
  26. 26 10月, 2009 1 次提交
  27. 19 10月, 2009 1 次提交
  28. 14 10月, 2009 1 次提交
    • C
      Finer grained migration control · 2d8d9b10
      Chris Lalancette 提交于
      Normally, when you migrate a domain from host A to host B,
      the domain on host A remains defined but shutoff and the domain
      on host B remains running but is a "transient".  Add a new
      flag to virDomainMigrate() to allow the original domain to be
      undefined on source host A, and a new flag to virDomainMigrate() to
      allow the new domain to be persisted on the destination host B.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      2d8d9b10
  29. 09 10月, 2009 2 次提交
    • D
      Support a new peer-to-peer migration mode & public API · fae0da5c
      Daniel P. Berrange 提交于
      Introduces several new public API options for migration
      
       - VIR_MIGRATE_PEER2PEER: With this flag the client only
         invokes the virDomainMigratePerform method, expecting
         the source host driver to do whatever is required to
         complete the entire migration process.
       - VIR_MIGRATE_TUNNELLED: With this flag the actual data
         for migration will be tunnelled over the libvirtd RPC
         channel. This requires that VIR_MIGRATE_PEER2PEER is
         also set.
       - virDomainMigrateToURI: This is variant of the existing
         virDomainMigrate method which does not require any
         virConnectPtr for the destination host. Given suitable
         driver support, this allows for all the same modes as
         virDomainMigrate()
      
      The URI for VIR_MIGRATE_PEER2PEER must be a valid libvirt
      URI. For non-p2p migration a hypervisor specific migration
      URI is used.
      
      virDomainMigrateToURI without a PEER2PEER flag is only
      support for Xen currently, and it involves XenD talking
      directly to XenD, no libvirtd involved at all.
      
      * include/libvirt/libvirt.h.in: Add VIR_MIGRATE_PEER2PEER
        flag for migration
      * src/libvirt_internal.h: Add feature flags for peer to
        peer migration (VIR_FEATURE_MIGRATE_P2P) and direct
        migration (VIR_MIGRATE_PEER2PEER mode)
      * src/libvirt.c: Implement support for VIR_MIGRATE_PEER2PEER
        and virDomainMigrateToURI APIs.
      * src/xen/xen_driver.c: Advertise support for DIRECT migration
      * src/xen/xend_internal.c: Add TODO item for p2p migration
      * src/libvirt_public.syms: Export virDomainMigrateToURI
        method
      * src/qemu/qemu_driver.c: Add support for PEER2PEER and
        migration, and adapt TUNNELLED migration.
      * tools/virsh.c: Add --p2p and --direct args and use the
        new virDomainMigrateToURI method where possible.
      fae0da5c
    • D
      Don't force dconn to be NULL in virDomainMigrate · 543e013a
      Daniel P. Berrange 提交于
      The code for tunnelled migration wierdly required the app to pass
      a  NULL 'dconn' parameter, only to have to use virConnectOpen
      itself shortly thereafter to get a 'dconn' object. Remove this
      bogus check & require the app to always pas 'dconn' as before
      
      * src/libvirt.c: Require 'dconn' for virDomainMigrate calls again
        and remove call to virConnectOpen
      543e013a