1. 31 5月, 2011 1 次提交
  2. 29 5月, 2011 13 次提交
    • D
      Issue full error messages when processing QEMU monitor I/O · 80d2038d
      Daniel P. Berrange 提交于
      Currently the QEMU monitor I/O handler code uses errno values
      to report errors. This results in a sub-optimal error messages
      on certain conditions, in particular when parsing JSON strings
      malformed data simply results in 'EINVAL'.
      
      This changes the code to use the standard libvirt error reporting
      APIs. The virError is stored against the qemuMonitorPtr struct,
      and when a monitor API is run, any existing stored error is copied
      into that thread's error local
      
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Use
        virError APIs for all monitor I/O handling code
      80d2038d
    • D
      Don't kill QEMU process when a monitor I/O parsing error occurs · 4454a9ef
      Daniel P. Berrange 提交于
      Currently whenever there is any failure with parsing the monitor,
      this is treated in the same was as end-of-file (ie QEMU quit).
      The domain is terminated, if not already dead.
      
      With this change, failures in parsing the monitor stream do not
      result in the death of QEMU. The guest continues running unchanged,
      but all further use of the monitor will be disabled.
      
      The VMM_FAILURE event will be emitted, and the mgmt application
      can decide when to kill/restart the guest to re-gain control
      
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Run a
        different callback for monitor EOF vs error conditions.
      * src/qemu/qemu_process.c: Emit VMM_FAILURE event when monitor
        fails
      4454a9ef
    • D
      Introduce a new event emitted when a virtualization failure occurs · a6135ec1
      Daniel P. Berrange 提交于
      This introduces a new domain
      
        VIR_DOMAIN_EVENT_ID_CONTROL_ERROR
      
      Which uses the existing generic callback
      
      typedef void (*virConnectDomainEventGenericCallback)(virConnectPtr conn,
                                                           virDomainPtr dom,
                                                           void *opaque);
      
      This event is intended to be emitted when there is a failure in
      some part of the domain virtualization system. Whether the domain
      continues to run/exist after the failure is an implementation
      detail specific to the hypervisor.
      
      The idea is that with some types of failure, hypervisors may
      prefer to leave the domain running in a "degraded" mode of
      operation. For example, if something goes wrong with the QEMU
      monitor, it is possible to leave the guest OS running quite
      happily. The mgmt app will simply loose the ability todo various
      tasks. The mgmt app can then choose how/when to deal with the
      failure that occured.
      * daemon/remote.c: Dispatch of new event
      * examples/domain-events/events-c/event-test.c: Demo catch
        of event
      * include/libvirt/libvirt.h.in: Define event ID and callback
      * src/conf/domain_event.c, src/conf/domain_event.h: Internal
        event handling
      * src/remote/remote_driver.c: Receipt of new event from daemon
      * src/remote/remote_protocol.x: Wire protocol for new event
      * src/remote_protocol-structs: add new event for checks
      a6135ec1
    • E
      sched: provide new API shims for remaining drivers · bb6cb66f
      Eric Blake 提交于
      Well, the remaining drivers that already had the get/set
      scheduler parameter functionality to begin with.
      
      For now, this blindly treats VIR_DOMAIN_SCHEDINFO_CURRENT as
      the only supported operation for these 5 domains; it will
      take domain-specific patches if more specific behavior is
      preferred.
      
      * src/esx/esx_driver.c (esxDomainGetSchedulerParameters)
      (esxDomainSetSchedulerParameters): Move guts...
      (esxDomainGetSchedulerParametersFlags)
      (esxDomainSetSchedulerParametersFlags): ...to new functions.
      * src/libxl/libxl_driver.c (libxlDomainGetSchedulerParameters)
      (libxlDomainSetSchedulerParameters)
      (libxlDomainGetSchedulerParametersFlags)
      (libxlDomainSetSchedulerParametersFlags): Likewise.
      * src/lxc/lxc_driver.c (lxcGetSchedulerParameters)
      (lxcSetSchedulerParameters, lxcGetSchedulerParametersFlags)
      (lxcSetSchedulerParametersFlags): Likewise.
      * src/test/test_driver.c (testDomainGetSchedulerParams)
      (testDomainSetSchedulerParams, testDomainGetSchedulerParamsFlags)
      (testDomainSetSchedulerParamsFlags): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainGetSchedulerParameters)
      (xenUnifiedDomainSetSchedulerParameters)
      (xenUnifiedDomainGetSchedulerParametersFlags)
      (xenUnifiedDomainSetSchedulerParametersFlags): Likewise.
      bb6cb66f
    • E
      virsh: improve schedinfo querying ability · 97f63513
      Eric Blake 提交于
      Since we can now set just --live or --config, we also need to be
      able to query that back.
      
      In the case of setting both --live and --config, it shouldn't matter
      which value we read back; otherwise, since querying treats the two
      flags as mutually exclusive, so does this patch.
      
      * tools/virsh.c (cmdSchedinfo): Use new API where appropriate.
      97f63513
    • E
      remote: introduce remoteGetSchedulerParametersFlags · baa371ec
      Eric Blake 提交于
      * daemon/remote.c (remoteDispatchDomainGetSchedulerParameters):
      New function.
      * src/remote/remote_driver.c (remoteDomainGetSchedulerParameters):
      Likewise.
      * src/remote/remote_protocol.x
      (remote_domain_get_scheduler_parameters_flags_args)
      (remote_domain_get_scheduler_parameters_flags_ret): New types.
      (remote_procedure): New RPC.
      * src/remote_protocol-structs: Likewise.
      baa371ec
    • E
      qemu: introduce qemuGetSchedulerParametersFlags · 8432170f
      Eric Blake 提交于
      * src/qemu/qemu_driver.c (qemuGetSchedulerParameters): Move
      guts...
      (qemuGetSchedulerParametersFlags): ...to new callback, and honor
      flags more accurately.
      8432170f
    • 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
      remote: consolidate typed parameter handling · 8a47ed29
      Eric Blake 提交于
      * src/remote/remote_protocol.x (remote_typed_param_value)
      (remote_typed_param):  New types.
      (remote_sched_param_value, remote_sched_param)
      (remote_blkio_param_value, remote_blkio_param)
      (remote_memory_param_value, remote_memory_param): Delete.
      (remote_domain_get_scheduler_parameters_ret)
      (remote_domain_set_scheduler_parameters_args)
      (remote_domain_set_scheduler_parameters_flags_args)
      (remote_domain_set_blkio_parameters_args)
      (remote_domain_get_blkio_parameters_ret)
      (remote_domain_set_memory_parameters_args)
      (remote_domain_get_memory_parameters_ret): Update clients.
      * src/remote_protocol-structs: Likewise.
      * src/remote/remote_driver.c (remoteSerializeTypedParameters)
      (remoteDeserializeTypedParameters): New functions.
      (remoteDomainSetMemoryParameters)
      (remoteDomainGetMemoryParameters, remoteDomainSetBlkioParameters)
      (remoteDomainGetBlkioParameters)
      (remoteDomainGetSchedulerParameters)
      (remoteDomainSetSchedulerParameters)
      (remoteDomainSetSchedulerParametersFlags): Update clients.
      * daemon/remote.c (remoteSerializeTypedParameters)
      (remoteDeserializeTypedParameters): New functions.
      (remoteDispatchDomainGetSchedulerParameters)
      (remoteDispatchDomainSetSchedulerParameters)
      (remoteDispatchDomainSetSchedulerParametersFlags)
      (remoteDispatchDomainSetMemoryParameters)
      (remoteDispatchDomainGetMemoryParameters)
      (remoteDispatchDomainSetBlkioParameters)
      (remoteDispatchDomainGetBlkioParameters): Update clients.
      8a47ed29
    • 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
    • E
      libvirt.h: avoid regression, and document preferred name · a9b3a78f
      Eric Blake 提交于
      Commit 824dcaff was a regression (thankfully unreleased) for any
      client code that used 'struct _virSchedParameter' directly rather
      than the preferred virSchedParameter typedef.  Adding a #define
      avoids even that API change, while rearranging the file makes it
      clear what the old vs. new API is.
      
      * include/libvirt/libvirt.h.in: Rearrange older names to the
      bottom and improve documentation on preferred names.
      (virDomainGetSchedulerParameters, virDomainSetSchedulerParameters)
      (virDomainSetSchedulerParametersFlags)
      (virDomainSetBlkioParameters, virDomainGetBlkioParameters)
      (virDomainSetMemoryParameters, virDomainGetMemoryParameters):
      Use newer type names.
      * python/libvirt-override.c: Adjust code generation to cope.
      Suggested by Daniel P. Berrange.
      a9b3a78f
    • D
      Fix a make check error · a9a95cb1
      Daniel Veillard 提交于
      Apparently introdunced in commit 376e1d94
      the generator produces u_int flags not unsigned int flags.
      
      * src/remote_protocol-structs: fix to the actual expected type and
        alignment
      a9a95cb1
    • R
      Fix virExecWithHook Prototype · 4996c314
      Richard Laager 提交于
      This was necessary to get libvirt to build on Solaris 11 Express and
      seems correct (as it makes this match the definition in util.c):
      4996c314
  3. 28 5月, 2011 9 次提交
  4. 27 5月, 2011 14 次提交
    • M
      openvz: Fix regression in openvzGetVPSUUID · 89fcf6f3
      Matthias Bolte 提交于
      Commit f0443765 replaced openvz_readline with getline and
      changed EOF-handling in the openvzGetVPSUUID.
      
      This patch restores original EOF-handling.
      
      Reported by Jean-Baptiste Rouault.
      89fcf6f3
    • M
      Add sexpr.c to the list of file with translatable messages · 971267c6
      Matthias Bolte 提交于
      This should have been in the last commit.
      971267c6
    • M
      sexpr: Improve serialization error reporting · bf9aa214
      Matthias Bolte 提交于
      bf9aa214
    • M
      Fix build with --with-driver-modules enabled · a07d1784
      Matthias Bolte 提交于
      Export a bunch of missing symbols and link the remote driver to gnulib.
      a07d1784
    • H
      qemu: implement the new flags for setting memory parameters · 4b997daa
      Hu Tao 提交于
      * src/qemu/qemu_driver.c: update qemuDomainSetMemoryParameters to
        look at the flag parameter and depending on it save the config
        or the live amount
      4b997daa
    • H
      qemu: implement the new flags for getting memory parameters · 7639d1ef
      Hu Tao 提交于
      * src/qemu/qemu_driver.c: update qemuDomainGetMemoryParameters to
        look at the flag parameter and depending on it read the config
        or the live amount
      7639d1ef
    • H
      Add new flags for setting memory parameters · 118eac37
      Hu Tao 提交于
      The new flags allow to pick current state, config or the live
      parameter, with current being the existing API default (0).
      This also hooks this to --config, --live, --current parameters for
      the memtune virsh command
      
      * include/libvirt/libvirt.h.in: defines the new flags
      * tools/virsh.c: adds support at virsh level
      * tools/virsh.pod: updates virsh documentation
      118eac37
    • K
      qemu : support persistent add/delete network interface · 9c26d6f0
      KAMEZAWA Hiroyuki 提交于
      This patch allows to modify interfaces of domain(qemu)
      * src/conf/domain_conf.c src/conf/domain_conf.h src/libvirt_private.syms:
        (virDomainNetInsert)     : Insert a network device to domain definition.
        (virDomainNetIndexByMac) : Returns an index of net device in array.
        (virDomainNetRemoveByMac): Remove a NIC of passed MAC address.
      * src/qemu/qemu_driver.c
        (qemuDomainAttachDeviceConfig): add codes for NIC.
        (qemuDomainDetachDeviceConfig): add codes for NIC.
      9c26d6f0
    • M
      esx: Fix regression in absolute file name handling · 8357d91b
      Matthias Bolte 提交于
      Before commit 145d6cb0 (in August 2010) absolute file names
      in VMX and domain XML configs were handled correctly. But this got
      lost during the refactoring. The test cases didn't highlight this
      problem because they have their own set of file name handling
      functions. The actual ones require a real connection to an ESX
      server. Also the test case functions always worked correctly.
      
      Fix the regression and add a new in-the-wild VMX file that contains
      such a problematic absolute path. Even though this test case won't
      protect against new regressions.
      
      Reported by lofic (IRC nick)
      8357d91b
    • M
      openvz: Add simple testcase for config file parsing function · 4a3a0290
      Matthias Bolte 提交于
      This testcase passes before the regression is added in f0443765, fails
      after that commit and passes again after the regression was fixed.
      4a3a0290
    • H
      don't check flags in virDomainSetSchedulerParametersFlags · 83ea7c1b
      Hu Tao 提交于
      drivers implementing domainSetSchedulerParametersFlags should check
      flags themselves.
      83ea7c1b
    • T
      openvz: Fix regression in config file parsing · 3aab7f2d
      Taisuke Yamada 提交于
      As reported by Diego Blanco in
      
        https://bugzilla.redhat.com/show_bug.cgi?id=702602
      
      commit f0443765 which replaced openvz_readline to getline(3)
      broke OpenVZ driver as it changed semantics of EOF-handling
      when parsing OpenVZ configuration.
      
      There're several other issues reported with current OpenVZ driver:
      
       #1: unclear error message when parsing "CPUS=" line
       #2: openvz driver goes into crashing loop
       #3: "NETIF=" line in configuration is not parsed correctly
       #4: aborts even when optional parameter is missing
       #5: there's a potential memory leak
      
      This updated patch to fix #[145]. This patch does not fix #[23]
      as I haven't verified these yet, but this at least got me to run
      OpenVZ on libvirt once again.
      3aab7f2d
    • E
      audit: fix minor off-by-one · 59953c38
      Eric Blake 提交于
      Coverity spotted this off-by-one.  Thankfully, no one in libvirt
      was ever calling virAuditSend with an argument of 3.
      
      * src/util/virtaudit.c (virAuditSend): Use correct comparison.
      59953c38
    • F
      qemu: allow blkstat/blkinfo calls during migration · 18c2a592
      Federico Simoncelli 提交于
      Originally most of libvirt domain-specific calls were blocking
      during a migration.
      A new mechanism to allow specific calls (blkstat/blkinfo) to be
      executed in such condition has been implemented.
      In the long term it'd be desirable to get a more general
      solution to mark further APIs as migration safe, without needing
      special case code.
      
       * src/qemu/qemu_migration.c: add some additional job signal
         flags for doing blkstat/blkinfo during a migration
       * src/qemu/qemu_domain.c: add a condition variable that can be
         used to efficiently wait for the migration code to clear the
         signal flag
       * src/qemu/qemu_driver.c: execute blkstat/blkinfo using the
         job signal flags during migration
      18c2a592
  5. 26 5月, 2011 3 次提交
    • M
      Add disk attach/detach support to libxl driver · fffea7fe
      Markus Groß 提交于
      Based on the device attach/detach code from the QEMU driver,
      but using the new functions to create the structures associated.
      * src/libxl/libxl_driver.c: implements domainAttachDevice,
        domainAttachDeviceFlags, domainDetachDevice, domainDetachDeviceFlags
        and domainUpdateDeviceFlags
      fffea7fe
    • M
      Fix libxl vm def handling on domU cleanup · 685753a3
      Markus Groß 提交于
      * src/libxl/libxl_driver.c: in libxlVmCleanup, free up the
        newDef definition if present overwise it would be leaked.
      685753a3
    • M
      Refactored libxl datastructure instantiation · f59b71ac
      Markus Groß 提交于
      Create 3 new function refactored from previous list ones and
      exports them internally to the driver
      
      * src/libxl/libxl_conf.c src/libxl/libxl_conf.h: create libxlMakeDisk,
        libxlMakeNic libxlMakeVfb out of the exsting static List functions
        and exports them
      f59b71ac