1. 25 6月, 2011 1 次提交
    • T
      vcpupin: introduce the new libvirt API (virDomainGetVcpupinInfo) · e261987c
      Taku Izumi 提交于
      This patch introduces a new libvirt API (virDomainGetVcpupinInfo),
      as a counterpart to virDomainPinVcpuFlags.
      
      We can use virDomainGetVcpus API to retrieve CPU affinity information,
      but can't use this API against inactive domains (at least in case of KVM),
      as it lacks a flags parameter.
      The usual thing is to add a new virDomainGetVcpusFlags, but that API name
      is already occupied by the counterpart to virDomainGetMaxVcpus, which
      has a completely different signature.
      
      The virDomainGetVcpupinInfo is the new API to retrieve CPU affinity
      information of active and inactive domains.  While the usual convention
      is to list an array before its length, this API violates that rule
      in order to be more like virDomainGetVcpus (where maxinfo was doing
      double-duty as the length of two different arrays).
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      e261987c
  2. 24 6月, 2011 1 次提交
  3. 17 6月, 2011 1 次提交
  4. 16 6月, 2011 1 次提交
    • E
      sendkey: use consistent API convention · 1d575629
      Eric Blake 提交于
      Even though rpc uses 'unsigned int' for the _len parameter that
      passes the length of item<length>, the public libvirt APIs all
      use 'int' and filter out lengths < 0, except for virDomainSendKey.
      
      * include/libvirt/libvirt.h.in (virDomainSendKey): All other APIs
      use int for array length.
      * src/libvirt.c (virDomainSendKey): Adjust.
      * src/driver.h (virDrvDomainSendKey): Likewise.
      * daemon/remote_generator.pl: Likewise.
      1d575629
  5. 15 6月, 2011 4 次提交
  6. 13 6月, 2011 1 次提交
  7. 29 5月, 2011 2 次提交
    • E
      sched: introduce virDomainGetSchedulerParametersFlags · bc4ee589
      Eric Blake 提交于
      If we can choose live or config when setting, then we need to
      be able to choose which one we are querying.
      
      Also, make the documentation clear that set must use a non-empty
      subset (some of the hypervisors fail if params is NULL).
      
      * include/libvirt/libvirt.h.in
      (virDomainGetSchedulerParametersFlags): New prototype.
      * src/libvirt.c (virDomainGetSchedulerParametersFlags): Implement
      it.
      * src/libvirt_public.syms: Export it.
      * python/generator.py (skip_impl): Don't auto-generate.
      * src/driver.h (virDrvDomainGetSchedulerParametersFlags): New
      callback.
      bc4ee589
    • E
      maint: prefer newer API names internally · 163e5f04
      Eric Blake 提交于
      Rather mechanical in nature.
      
      * src/driver.h: Use newer virTypedParameter API names.
      * src/libvirt.c: Likewise.
      * daemon/remote.c: Likewise.
      * src/esx/esx_driver.c: Likewise.
      * src/libxl/libxl_driver.c: Likewise.
      * src/lxc/lxc_driver.c: Likewise.
      * src/qemu/qemu_driver.c: Likewise.
      * src/remote/remote_driver.c: Likewise.
      * src/test/test_driver.c: Likewise.
      * src/xen/xen_driver.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      * src/xen/xen_hypervisor.h: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * tools/virsh.c: Likewise.
      163e5f04
  8. 28 5月, 2011 1 次提交
  9. 26 5月, 2011 1 次提交
    • M
      Fix sign mismatches between public API, driver API and XDR protocol · 1ff2b6f6
      Matthias Bolte 提交于
      In most cases this affects flags parameters that are unsigned in the
      public and driver API but signed in the XDR protocol. Switch the
      XDR protocol to unsigned for those.
      
      A counterexample is virNWFilterGetXMLDesc. Its flags parameter is signed
      in the public API and XDR protocol, but unsigned in the driver API.
      1ff2b6f6
  10. 25 5月, 2011 3 次提交
    • D
      Fix the signature of virDomainMigrateFinish3 for error reporting · 2593f969
      Daniel P. Berrange 提交于
      The current virDomainMigrateFinish3 method signature attempts to
      distinguish two types of errors, by allowing return with ret== 0,
      but ddomain == NULL, to indicate a failure to start the guest.
      This is flawed, because when ret == 0, there is no way for the
      virErrorPtr details to be sent back to the client.
      
      Change the signature of virDomainMigrateFinish3 so it simply
      returns a virDomainPtr, in the same way as virDomainMigrateFinish2
      The disk locking code will protect against the only possible
      failure mode this doesn't account for (loosing conenctivity to
      libvirtd after Finish3 starts the CPUs, but before the client
      sees the reply for Finish3).
      
      * src/driver.h, src/libvirt.c, src/libvirt_internal.h: Change
        virDomainMigrateFinish3 to return a virDomainPtr instead of int
      * src/remote/remote_driver.c, src/remote/remote_protocol.x,
        daemon/remote.c, src/qemu/qemu_driver.c, src/qemu/qemu_migration.c:
        Update for API change
      2593f969
    • D
      Add a second URI parameter to virDomainMigratePerform3 method · f9f2d4e1
      Daniel P. Berrange 提交于
      The virDomainMigratePerform3 currently has a single URI parameter
      whose meaning varies. It is either
      
       - A QEMU migration URI (normal migration)
       - A libvirtd connection URI (peer2peer migration)
      
      Unfortunately when using peer2peer migration, without also
      using tunnelled migration, it is possible that both URIs are
      required.
      
      This adds a second URI parameter to the virDomainMigratePerform3
      method, to cope with this scenario. Each parameter how has a fixed
      meaning.
      
      NB, there is no way to actually take advantage of this yet,
      since virDomainMigrate/virDomainMigrateToURI do not have any
      way to provide the 2 separate URIs
      
      * daemon/remote.c, src/remote/remote_driver.c,
        src/remote/remote_protocol.x, src/remote_protocol-structs: Add
        the second URI parameter to perform3 message
      * src/driver.h, src/libvirt.c, src/libvirt_internal.h: Add
        the second URI parameter to Perform3 method
      * src/libvirt_internal.h, src/qemu/qemu_migration.c,
        src/qemu/qemu_migration.h: Update to handle URIs correctly
      f9f2d4e1
    • D
      Extend v3 migration protocol to allow app supplied XML for target · 7ad4b6b9
      Daniel P. Berrange 提交于
      This extends the v3 migration protocol such that the
      virDomainMigrateBegin3 and virDomainMigratePerform3
      methods accept an application supplied XML config for
      the target VM.
      
      If the 'xmlin' parameter is NULL, then Begin3 uses the
      current guest XML as normal. A driver implementing the
      Begin3 method should either reject all non-NULL 'xmlin'
      parameters, or strictly validate that the app supplied
      XML does not change guest ABI.
      
      The Perform3 method also needed the xmlin parameter to
      cope with the Peer2Peer migration sequence.
      
      NB it is not yet possible to use this capability since
      neither of the public virDomainMigrate/virDomainMigrateToURI
      methods have a way to pass in XML.
      
      * daemon/remote.c, src/remote/remote_driver.c,
        src/remote/remote_protocol.x, src/remote_protocol-structs:
        Add 'remote_string xmlin' parameter to begin3/perform3
        RPC messages
      * src/libvirt.c, src/driver.h, src/libvirt_internal.h: Add
        'const char *xmlin' parameter to Begin3/Perform3 methods
      * src/qemu/qemu_driver.c, src/qemu/qemu_migration.c,
        src/qemu/qemu_migration.h: Pass xmlin parameter around
        migration methods
      7ad4b6b9
  11. 17 5月, 2011 1 次提交
  12. 16 5月, 2011 3 次提交
    • D
      Introduce yet another migration version in API. · 65043d2d
      Daniel P. Berrange 提交于
      Migration just seems to go from bad to worse. We already had to
      introduce a second migration protocol when adding the QEMU driver,
      since the one from Xen was insufficiently flexible to cope with
      passing the data the QEMU driver required.
      
      It turns out that this protocol still has some flaws that we
      need to address. The current sequence is
      
       *  Src: DumpXML
                - Generate XML to pass to dst
      
       *  Dst: Prepare
                - Get ready to accept incoming VM
                - Generate optional cookie to pass to src
      
       *  Src: Perform
                - Start migration and wait for send completion
                - Kill off VM if successful, resume if failed
      
       *  Dst: Finish
                - Wait for recv completion and check status
                - Kill off VM if unsuccessful
      
      The problems with this are:
      
       - Since the first step is a generic 'DumpXML' call, we can't
         add in other migration specific data. eg, we can't include
         any VM lease data from lock manager plugins
       - Since the first step is a generic 'DumpXML' call, we can't
         emit any 'migration begin' event on the source, or have
         any hook that runs right at the start of the process
       - Since there is no final step on the source, if the Finish
         method fails to receive all migration data & has to kill
         the VM, then there's no way to resume the original VM
         on the source
      
      This patch attempts to introduce a version 3 that uses the
      improved 5 step sequence
      
       *  Src: Begin
                - Generate XML to pass to dst
                - Generate optional cookie to pass to dst
      
       *  Dst: Prepare
                - Get ready to accept incoming VM
                - Generate optional cookie to pass to src
      
       *  Src: Perform
                - Start migration and wait for send completion
                - Generate optional cookie to pass to dst
      
       *  Dst: Finish
                - Wait for recv completion and check status
                - Kill off VM if failed, resume if success
                - Generate optional cookie to pass to src
      
       *  Src: Confirm
                - Kill off VM if success, resume if failed
      
      The API is designed to allow both input and output cookies
      in all methods where applicable. This lets us pass around
      arbitrary extra driver specific data between src & dst during
      migration. Combined with the extra 'Begin' method this lets
      us pass lease information from source to dst at the start of
      migration
      
      Moving the killing of the source VM out of Perform and
      into Confirm, means we can now recover if the dst host
      can't successfully Finish receiving migration data.
      65043d2d
    • D
      Tweak driver naming for consistency with public API · 360df019
      Daniel P. Berrange 提交于
      Fix some driver names:
      
        s/virDrvCPUCompare/virDrvCompareCPU/
        s/virDrvCPUBaseline/virDrvBaselineCPU/
        s/virDrvQemuDomainMonitorCommand/virDrvDomainQemuMonitorCommand/
        s/virDrvSecretNumOfSecrets/virDrvNumOfSecrets/
        s/virDrvSecretListSecrets/virDrvListSecrets/
      
      And some driver struct field names:
      
        s/getFreeMemory/nodeGetFreeMemory/
      360df019
    • J
      Internal driver API for virDomainGetState · 6feb1341
      Jiri Denemark 提交于
      6feb1341
  13. 13 5月, 2011 1 次提交
    • M
      screenshot: Defining the internal API · 3c386643
      Michal Privoznik 提交于
      * src/driver.h: Stub code for new API
      * src/esx/esx_driver.c, src/libxl/libxl_driver.c,
        src/lxc/lxc_driver.c, src/openvz/openvz_driver.c,
        src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
        rc/remote/remote_driver.c, rc/test/test_driver.c,
        src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/vmware/vmware_driver.c, src/xen/xen_driver.c,
        src/xen/xen_driver.h, src/xen/xen_hypervisor.c,
        src/xen/xen_inotify.c, src/xen/xend_internal.c,
        src/xen/xm_internal.c, src/xen/xs_internal.c,
        src/xenapi/xenapi_driver.c: Add dummy entries in driver
        table for new APIs
      3c386643
  14. 12 5月, 2011 1 次提交
    • E
      nwfilter: drop unused flag argument · 88d03d4f
      Eric Blake 提交于
      The public API and RPC over-the-wire format have no flags argument,
      so neither should the internal callback API.  This simplifies the
      RPC generator.
      
      * src/driver.h (virDrvNWFilterDefineXML): Drop argument that does
      not match public API.
      * src/nwfilter/nwfilter_driver.c (nwfilterDefine): Likewise.
      * src/libvirt.c (virNWFilterDefineXML): Likewise.
      * daemon/remote_generator.pl: Drop special case.
      88d03d4f
  15. 11 5月, 2011 2 次提交
  16. 12 4月, 2011 1 次提交
    • E
      maint: fix grammar errors · 99fa3080
      Eric Blake 提交于
      Jim Meyering recently improved gnulib to catch various grammar
      errors during 'make syntax-check'.
      
      * .gnulib: Update to latest, for syntax-check improvements.
      * include/libvirt/libvirt.h.in (virConnectAuthCallbackPtr): Use
      cannot rather than two words.
      * src/driver.c: Likewise.
      * src/driver.h (VIR_SECRET_GET_VALUE_INTERNAL_CALL): Likewise.
      * src/remote/remote_driver.c (initialize_gnutls): Likewise.
      * src/util/pci.c (pciBindDeviceToStub): Likewise.
      * src/storage/storage_backend.c (virStorageBackendCreateQemuImg):
      Likewise.
      (virStorageBackendUpdateVolTargetInfoFD): Avoid doubled word.
      * docs/formatdomain.html.in: Likewise.
      * src/qemu/qemu_process.c (qemuProcessStart): Likewise.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_can_not)
      (exclude_file_name_regexp--sc_prohibit_doubled_word): Exclude
      existing translation problems.
      99fa3080
  17. 29 3月, 2011 1 次提交
    • 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
  18. 22 3月, 2011 1 次提交
    • D
      Add public API for setting migration speed on the fly · cb4aba9b
      Daniel P. Berrange 提交于
      It is possible to set a migration speed limit when starting
      migration. This new API allows the speed limit to be changed
      on the fly to adjust to changing conditions
      
      * src/driver.h, src/libvirt.c, src/libvirt_public.syms,
        include/libvirt/libvirt.h.in: Add virDomainMigrateSetMaxSpeed
      * 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/vmware/vmware_driver.c, src/xen/xen_driver.c,
        src/libxl/libxl_driver.c: Stub new API
      cb4aba9b
  19. 18 3月, 2011 1 次提交
    • J
      Add libxenlight driver · 2b84e445
      Jim Fehlig 提交于
      Add a new xen driver based on libxenlight [1], which is the primary
      toolstack starting with Xen 4.1.0.  The driver is stateful and runs
      privileged only.
      
      Like the existing xen-unified driver, the libxenlight driver is
      accessed with xen:// URI.  Driver selection is based on the status
      of xend.  If xend is running, the libxenlight driver will not load
      and xen:// connections are handled by xen-unified.  If xend is not
      running *and* the libxenlight driver is available, xen://
      connections are deferred to the libxenlight driver.
      
      V6:
       - Address several code style issues noted by Daniel Veillard
       - Make drive work with xen:/// URI
       - Hold domain object reference while domain is injected in
         libvirt event loop.  Race found and fixed by Markus Groß.
      
      V5:
       - Ensure events are unregistered when domain private data
         is destroyed.  Discovered and fixed by Markus Groß.
      
      V4:
       - Handle restart of libvirtd, reconnecting to previously
         started domains
       - Rebased to current master
       - Tested against Xen 4.1 RC7-pre (c/s 22961:c5d121fd35c0)
      
      V3:
        - Reserve vnc port within driver when autoport=yes
      
      V2:
        - Update to Xen 4.1 RC6-pre (c/s 22940:5a4710640f81)
        - Rebased to current master
        - Plug memory leaks found by Stefano Stabellini and valgrind
        - Handle SHUTDOWN_crash domain death event
      
      [1] http://lists.xensource.com/archives/html/xen-devel/2009-11/msg00436.html
      2b84e445
  20. 11 3月, 2011 2 次提交
  21. 24 2月, 2011 1 次提交
  22. 09 2月, 2011 1 次提交
    • E
      sysinfo: define internal driver API · dec13a5a
      Eric Blake 提交于
      * src/driver.h (virDrvGetSysinfo): New typedef.
      (_virDriver): New callback member.
      * src/esx/esx_driver.c (esxDriver): Add stub for driver.
      * src/lxc/lxc_driver.c (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDriver): Likewise.
      * src/phyp/phyp_driver.c (phypDriver): Likewise.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/test/test_driver.c (testDriver): Likewise.
      * src/uml/uml_driver.c (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (Driver): Likewise.
      * src/vmware/vmware_driver.c (vmwareDriver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.
      dec13a5a
  23. 19 1月, 2011 1 次提交
    • M
      Simplify "NWFilterPool" to "NWFilter" · 2c0db5b5
      Matthias Bolte 提交于
      The public object is called NWFilter but the corresponding private
      object is called NWFilterPool. I don't see compelling reasons for this
      Pool suffix. One might argue that an NWFilter is a "pool" of rules, etc.
      
      Remove the Pool suffix from NWFilterPool. No functional change included.
      2c0db5b5
  24. 18 12月, 2010 1 次提交
  25. 06 12月, 2010 1 次提交
    • J
      Change return value of VIR_DRV_SUPPORTS_FEATURE to bool · 4186f929
      Jiri Denemark 提交于
      virDrvSupportsFeature API is allowed to return -1 on error while all but
      one uses of VIR_DRV_SUPPORTS_FEATURE only check for (non)zero return
      value. Let's make this macro return zero on error, which is what
      everyone expects anyway.
      4186f929
  26. 24 11月, 2010 1 次提交
    • O
      define internal driver API · 37a02efd
      Osier Yang 提交于
      * src/driver.h (new typedef, new callback member for "_virDriver")
      * 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
      37a02efd
  27. 12 11月, 2010 1 次提交
    • D
      Introduce a virDomainOpenConsole API · 88a9b382
      Daniel P. Berrange 提交于
      To enable virsh console (or equivalent) to be used remotely
      it is necessary to provide remote access to the /dev/pts/XXX
      pseudo-TTY associated with the console/serial/parallel device
      in the guest. The virStream API provide a bi-directional I/O
      stream capability that can be used for this purpose. This
      patch thus introduces a virDomainOpenConsole API that uses
      the stream APIs.
      
      * src/libvirt.c, src/libvirt_public.syms,
        include/libvirt/libvirt.h.in, src/driver.h: Define the
        new virDomainOpenConsole 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: Stub
        API entry point
      88a9b382
  28. 20 10月, 2010 1 次提交
    • E
      vcpu: define internal driver API · dd255d64
      Eric Blake 提交于
      * src/driver.h (virDrvDomainSetVcpusFlags)
      (virDrvDomainGetVcpusFlags): New typedefs.
      (_virDriver): New callback members.
      * src/esx/esx_driver.c (esxDriver): Add stub for driver.
      * src/lxc/lxc_driver.c (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDriver): Likewise.
      * src/phyp/phyp_driver.c (phypDriver): Likewise.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/test/test_driver.c (testDriver): Likewise.
      * src/uml/uml_driver.c (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (Driver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.
      dd255d64
  29. 13 10月, 2010 1 次提交
    • N
      Adding virDomainSetMemoryParameters and virDomainGetMemoryParameters API · 0cd78232
      Nikunj A. Dadhania 提交于
      Public api to set/get memory tunables supported by the hypervisors.
      
      dv:
      * some cleanups in libvirt.c
      * adding extra checks in libvirt.c new entry points
      
      v4:
      * Move exporting public API to this patch
      * Add unsigned int flags to the public api for future extensions
      
      v3:
      * Add domainGetMemoryParamters and NULL in all the driver interface
      
      v2:
      * Initialize domainSetMemoryParameters to NULL in all the driver
        interface structure.
      0cd78232
  30. 24 7月, 2010 1 次提交
    • C
      Qemu Monitor API entry point. · 21adf03c
      Chris Lalancette 提交于
      Add the library entry point for the new virDomainQemuMonitorCommand()
      entry point.  Because this is not part of the "normal" libvirt API,
      it gets its own header file, library file, and will eventually
      get its own over-the-wire protocol later in the series.
      
      Changes since v1:
       - Go back to using the virDriver table for qemuDomainMonitorCommand, due to
         linking issues
       - Added versioning information to the libvirt-qemu.so
      
      Changes since v2:
       - None
      
      Changes since v3:
       - Add LGPL header to libvirt-qemu.c
       - Make virLibConnError and virLibDomainError macros instead of function calls
      
      Changes since v4:
       - Move exported symbols to libvirt_qemu.syms
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      21adf03c