1. 10 3月, 2011 2 次提交
  2. 04 2月, 2011 1 次提交
    • J
      qemu: Add shortcut for HMP pass through · 2169472a
      Jiri Denemark 提交于
      Currently users who want to use virDomainQemuMonitorCommand() API or
      it's virsh equivalent has to use the same protocol as libvirt uses for
      communication to qemu. Since the protocol is QMP with current qemu and
      HMP much more usable for humans, one ends up typing something like the
      following:
      
          virsh qemu-monitor-command DOM \
      '{"execute":"human-monitor-command","arguments":{"command-line":"info kvm"}}'
      
      which is not a very convenient way of debugging qemu.
      
      This patch introduces --hmp option to qemu-monitor-command, which says
      that the provided command is in HMP. If libvirt uses QMP to talk with
      qemu, the command will automatically be converted into QMP. So the
      example above is simplified to just
      
          virsh qemu-monitor-command --hmp DOM "info kvm"
      
      Also the result is converted from
      
          {"return":"kvm support: enabled\r\n"}
      
      to just plain HMP:
      
          kvm support: enabled
      
      If libvirt talks to qemu in HMP, --hmp flag is obviously a noop.
      2169472a
  3. 15 1月, 2011 2 次提交
    • M
      4d099bc0
    • E
      qemu: move monitor device out of domain_conf common code · 30b9e608
      Eric Blake 提交于
      * src/conf/domain_conf.h (virDomainChrDeviceType): Drop monitor.
      * src/conf/domain_conf.c (virDomainChrDevice)
      (virDomainChrDefParseTargetXML, virDomainChrDefFormat): Drop
      monitor support.
      * src/qemu/qemu_command.h (qemuBuildCommandLine): Alter signature.
      * src/qemu/qemu_monitor.h (qemuMonitorOpen): Likewise.
      * src/qemu/qemu_domain.h (_qemuDomainObjPrivate): Change type of
      monConfig.
      * src/qemu/qemu_domain.c (qemuDomainObjPrivateFree)
      (qemuDomainObjPrivateXMLFormat, qemuDomainObjPrivateXMLParse):
      Adjust to type change.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
      * src/qemu/qemu_driver.c (qemuPrepareMonitorChr)
      (qemudStartVMDaemon, qemuDomainXMLToNative, qemuConnectMonitor)
      (qemudShutdownVMDaemon): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorOpen): Likewise.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Likewise.
      30b9e608
  4. 22 12月, 2010 1 次提交
    • E
      maint: avoid space-tab · 831aaf4a
      Eric Blake 提交于
      * daemon/Makefile.am: Avoid spurious space before tabs.
      * src/Makefile.am: Likewise.
      * examples/dominfo/Makefile.am: Likewise.
      * examples/domsuspend/Makefile.am: Likewise.
      * tools/Makefile.am: Likewise.
      * src/datatypes.h (VIR_CONNECT_MAGIC): Likewise.
      * src/internal.h (TODO): Likewise.
      * src/qemu/qemu_monitor.h (QEMU_MONITOR_MIGRATE): Likewise.
      * src/xen/xen_hypervisor.c (XEN_V2_OP_GETAVAILHEAP): Likewise.
      * src/xen/xs_internal.h: Likewise.
      831aaf4a
  5. 09 12月, 2010 2 次提交
    • R
      qemu: call drive_del in DetachPciDiskDevice · aefaeb3d
      Ryan Harper 提交于
      Currently libvirt doesn't confirm whether the guest has responded to the
      disk removal request.  In some cases this can leave the guest with
      continued access to the device while the mgmt layer believes that it has
      been removed.  With a recent qemu monitor command[1] we can
      deterministically revoke a guests access to the disk (on the QEMU side)
      to ensure no futher access is permitted.
      
      This patch adds support for the drive_del() command and introduces it
      in the disk removal paths.  If the guest is running in a QEMU without this
      command we currently explicitly check for unknown command/CommandNotFound
      and log the issue.
      
      If QEMU supports the command we issue the drive_del command after we attempt
      to remove the device.  The guest may respond and remove the block device
      before we get to attempt to call drive_del.  In that case, we explicitly check
      for 'Device not found' from the monitor indicating that the target drive
      was auto-deleted upon guest responds to the device removal notification.
      
      1. http://thread.gmane.org/gmane.comp.emulators.qemu/84745Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      aefaeb3d
    • R
      qemu: call drive_unplug in DetachPciDiskDevice · 0cdc9829
      Ryan Harper 提交于
      Currently libvirt doesn't confirm whether the guest has responded to the
      disk removal request.  In some cases this can leave the guest with
      continued access to the device while the mgmt layer believes that it has
      been removed.  With a recent qemu monitor command[1] we can
      deterministically revoke a guests access to the disk (on the QEMU side)
      to ensure no futher access is permitted.
      
      This patch adds support for the drive_unplug() command and introduces it
      in the disk removal paths.  There is some discussion to be had about how
      to handle the case where the guest is running in a QEMU without this
      command (and the fact that we currently don't have a way of detecting
      what monitor commands are available).
      
      Changes since v2:
       - use VIR_ERROR to report when unplug command not found
      Changes since v1:
       - return > 0 when command isn't present, < 0 on command failure
       - detect when drive_unplug command isn't present and log error
         instead of failing entire command
      Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      0cdc9829
  6. 11 11月, 2010 1 次提交
  7. 26 10月, 2010 1 次提交
    • E
      qemu: work around dash 0.5.5 bug in managed save · f22e670b
      Eric Blake 提交于
      Older dash mistakenly truncates regular files when using <> redirection;
      this kills our use of double dd to reduce storage overhead when
      saving qemu images.  But qemu insists on running a command through
      /bin/sh, so we work around it by having qemu run $sh -c 'real command'
      when we have a replacement $sh in mind.
      
      * configure.ac (VIR_WRAPPER_SHELL): Define to a replacement shell,
      if /bin/sh is broken on <> redirection.
      * src/qemu/qemu_monitor.h (VIR_WRAPPER_SHELL_PREFIX)
      (VIR_WRAPPER_SHELL_SUFFIX): New macros.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrateToFile): Use
      them.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONMigrateToFile):
      Likewise.
      f22e670b
  8. 24 7月, 2010 1 次提交
    • C
      Qemu arbitrary monitor commands. · 057e8553
      Chris Lalancette 提交于
      Implement the qemu driver's virDomainQemuMonitorCommand
      and hook it into the API entry point.
      
      Changes since v1:
       - Rename the (external) qemuMonitorCommand to qemuDomainMonitorCommand
       - Add virCheckFlags to qemuDomainMonitorCommand
      
      Changes since v2:
       - Drop ATTRIBUTE_UNUSED from the flags
      
      Changes since v3:
       - Add a flag to priv so we only print out monitor command warning once.  Note
         that this has not been plumbed into qemuDomainObjPrivateXMLFormat or
         qemuDomainObjPrivateXMLParse, which means that if you run a monitor command,
         restart libvirtd, and then run another monitor command, you may get an
         an erroneous VIR_INFO.  It's a pretty minor matter, and I didn't think it
         warranted the additional code.
       - Add BeginJob/EndJob calls around EnterMonitor/ExitMonitor
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      057e8553
  9. 25 6月, 2010 1 次提交
    • D
      Fix migration in text mode and shared storage migration in json mode · 28e96d72
      Daniel P. Berrange 提交于
      The patches for shared storage migration were not correctly written
      for json mode. Thus the 'blk' and 'inc' parameters were never being
      set. In addition they didn't set the QEMU_MONITOR_MIGRATE_BACKGROUND
      so migration was synchronous. Due to multiple bugs in QEMU's JSON
      impl this wasn't noticed because it treated the sync migration requst
      as asynchronous anyway. Finally 'background' parameter was converted
      to take arbitrary flags but not renamed, and not all uses were changed
      to unsigned int.
      
      * src/qemu/qemu_driver.c: Set QEMU_MONITOR_MIGRATE_BACKGROUND in
        doNativeMigrate
      * src/qemu/qemu_monitor_json.c: Process QEMU_MONITOR_MIGRATE_NON_SHARED_DISK
        and QEMU_MONITOR_MIGRATE_NON_SHARED_INC flags
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.h, src/qemu/qemu_monitor_text.c,
        src/qemu/qemu_monitor_text.h: change 'int background' to
        'unsigned int flags' in migration APIs. Add logging of flags
        parameter
      28e96d72
  10. 23 6月, 2010 1 次提交
    • D
      Fix reference handling leak on qemuMonitor · c2121602
      Daniel P. Berrange 提交于
      The current code pattern requires that callers of qemuMonitorClose
      check for the return value == 0, and if so, set priv->mon = NULL
      and release the reference held on the associated virDomainObjPtr
      
      The change d84bb6d6 violated that
      requirement, meaning that priv->mon never gets set to NULL, and
      a reference count is leaked on virDomainObjPtr.
      
      This design was a bad one, so remove the need to check the return
      valueof qemuMonitorClose(). Instead allow registration of a
      callback that's invoked just when the last reference on qemuMonitorPtr
      is released.
      
      Finally there was a potential reference leak in qemuConnectMonitor
      in the failure path.
      
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a destroy
        callback invoked from qemuMonitorFree
      * src/qemu/qemu_driver.c: Use the destroy callback to release the
        reference on virDomainObjPtr when the monitor is freed. Fix other
        potential reference count leak in connecting to monitor
      c2121602
  11. 18 6月, 2010 1 次提交
    • E
      qemu: reduce file padding requirements · 322b1fd4
      Eric Blake 提交于
      Followup to https://bugzilla.redhat.com/show_bug.cgi?id=599091,
      commit 20206a4b, to reduce disk waste in padding.
      
      * src/qemu/qemu_monitor.h (QEMU_MONITOR_MIGRATE_TO_FILE_BS): Drop
      back to 4k.
      (QEMU_MONITOR_MIGRATE_TO_FILE_TRANSFER_SIZE): New macro.
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Update comment.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrateToFile): Use
      two invocations of dd to output non-aligned large blocks.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONMigrateToFile):
      Likewise.
      322b1fd4
  12. 05 6月, 2010 1 次提交
  13. 25 5月, 2010 1 次提交
    • D
      Query block allocation extent from QEMU monitor · ebb0c19c
      Daniel P. Berrange 提交于
      The virDomainGetBlockInfo API allows query physical block
      extent and allocated block extent. These are normally the
      same value unless storing a special format like qcow2
      inside a block device. In this scenario we can query QEMU
      to get the actual allocated extent.
      
      Since last time:
      
       - Return fatal error in text monitor
       - Only invoke monitor command for block devices
       - Fix error handling JSON code
      
      * src/qemu/qemu_driver.c: Fill in block aloction extent when VM
        is running
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        API to query the highest block extent via info blockstats
      ebb0c19c
  14. 14 5月, 2010 1 次提交
    • D
      Add support for NIC hotplug using netdev_add in QEMU · ff45b4c2
      Daniel P. Berrange 提交于
      QEMU is gaining a new monitor command netdev_add for hotplugging
      NICs using the netdev backend code. We already support this on
      the command this, though it is disabled. This adds support for
      hotplug too, also to remain disabled until 0.13 QEMU is released
      
      * src/qemu/qemu_driver.c: Support netdev hotplug for NICs
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        support for netdev_add and netdev_remove commands
      ff45b4c2
  15. 05 5月, 2010 1 次提交
    • K
      qemu: live migration with non-shared storage for kvm · b0a3f8b6
      Kenneth Nagin 提交于
      Support for live migration between hosts that do not share storage was
      added to qemu-kvm release 0.12.1.
      It supports two flags:
      -b migration without shared storage with full disk copy
      -i migration without shared storage with incremental copy (same base image
      shared between source and destination).
      
      I tested the live migration without shared storage (both flags) for native
      and p2p with and without tunnelling.  I also verified that the fix doesn't
      affect normal migration with shared storage.
      b0a3f8b6
  16. 30 4月, 2010 1 次提交
    • D
      Add support for another explicit IO error event · 34dcbbb4
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
      
      This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR
      event, but also includes a string describing the cause of
      the event.
      
      Thus there is a new callback definition for this event type
      
      typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
                                                                 virDomainPtr dom,
                                                                 const char *srcPath,
                                                                 const char *devAlias,
                                                                 int action,
                                                                 const char *reason,
                                                                 void *opaque);
      
      This is currently wired up to the QEMU block IO error events
      
      * daemon/remote.c: Dispatch IO error events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        IO error events
      * include/libvirt/libvirt.h.in: Define new IO error event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle IO error events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for block IO errors and emit a libvirt IO error event
      * src/remote/remote_driver.c: Receive and dispatch IO error
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        IO error events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
        from QEMU monitor
      34dcbbb4
  17. 28 4月, 2010 1 次提交
    • D
      Fix QEMU save/restore with block devices · 93e0b3c8
      Daniel P. Berrange 提交于
      The save process was relying on use of the shell >> append
      operator to ensure the save data was placed after the libvirt
      header + XML. This doesn't work for block devices though.
      Replace this code with use of 'dd' and its 'seek' parameter.
      This means that we need to pad the header + XML out to a
      multiple of dd block size (in this case we choose 512).
      
      The qemuMonitorMigateToCommand() monitor API is used for both
      save/coredump, and migration via UNIX socket. We can't simply
      switch this to use 'dd' since this causes problems with the
      migration usage. Thus, create a dedicated qemuMonitorMigateToFile
      which can accept an filename + offset, and remove the filename
      from the current qemuMonitorMigateToCommand() API
      
      * src/qemu/qemu_driver.c: Switch to qemuMonitorMigateToFile
        for save and core dump
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Create
        a new qemuMonitorMigateToFile, separate from the existing
        qemuMonitorMigateToCommand to allow handling file offsets
      93e0b3c8
  18. 16 4月, 2010 2 次提交
    • D
      Rename parameter in qemuMonitorDeviceDel · fde060b8
      Daniel P. Berrange 提交于
      The parameter for the qemuMonitorDeviceDel() is a device alias,
      not a device config string. Rename the parameter reflect this
      and avoid confusion to readers.
      
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Rename devicestr to devalias in qemuMonitorDeviceDel()
      fde060b8
    • D
      Fix QEMU memory stats JSON mode · 4f81919a
      Daniel P. Berrange 提交于
      The QEMU driver is mistakenly calling directly into the text
      mode monitor for the domain memory stats query.
      
      * src/qemu/qemu_driver.c: Replace qemuMonitorTextGetMemoryStats with
        qemuMonitorGetMemoryStats
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add the new
        wrapper for qemuMonitorGetMemoryStats
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
        qemuMonitorJSONGetMemoryStats implementation
      4f81919a
  19. 05 4月, 2010 1 次提交
  20. 26 3月, 2010 4 次提交
    • D
      Add domain events for graphics network clients · 987e31ed
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_GRAPHICS
      
      The same event can be emitted in 3 scenarios
      
        typedef enum {
            VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
            VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
            VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
        } virDomainEventGraphicsPhase;
      
      Connect/disconnect are triggered at socket accept/close.
      The initialize phase is immediately after the protocol
      setup and authentication has completed. ie when the
      client is authorized and about to start interacting with
      the graphical desktop
      
      This event comes with *a lot* of potential information
      
       - IP address, port & address family of client
       - IP address, port & address family of server
       - Authentication scheme (arbitrary string)
       - Authenticated subject identity. A subject may have
         multiple identities with some authentication schemes.
         For example, vencrypt+sasl results in a x509dname
         and saslUsername identities.
      
      This results in a very complicated callback :-(
      
         typedef enum {
            VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
            VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
         } virDomainEventGraphicsAddressType;
      
         struct _virDomainEventGraphicsAddress {
             int family;
             const char *node;
             const char *service;
         };
         typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
         typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;
      
         struct _virDomainEventGraphicsSubject {
            int nidentity;
            struct {
                const char *type;
                const char *name;
            } *identities;
         };
         typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
         typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;
      
         typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
                                                               virDomainPtr dom,
                                                               int phase,
                                                               virDomainEventGraphicsAddressPtr local,
                                                               virDomainEventGraphicsAddressPtr remote,
                                                               const char *authScheme,
                                                               virDomainEventGraphicsSubjectPtr subject,
                                                               void *opaque);
      
      The wire protocol is similarly complex
      
         struct remote_domain_event_graphics_address {
           int family;
           remote_nonnull_string node;
           remote_nonnull_string service;
         };
      
         const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;
      
         struct remote_domain_event_graphics_identity {
           remote_nonnull_string type;
           remote_nonnull_string name;
         };
      
         struct remote_domain_event_graphics_msg {
           remote_nonnull_domain dom;
           int phase;
           remote_domain_event_graphics_address local;
           remote_domain_event_graphics_address remote;
           remote_nonnull_string authScheme;
           remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
         };
      
      This is currently implemented in QEMU for the VNC graphics
      protocol, but designed to be usable with SPICE graphics in
      the future too.
      
      * daemon/remote.c: Dispatch graphics events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        graphics events
      * include/libvirt/libvirt.h.in: Define new graphics event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle graphics events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for VNC events and emit a libvirt graphics event
      * src/remote/remote_driver.c: Receive and dispatch graphics
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        graphics events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
        VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor
      987e31ed
    • D
      Add support for an explicit IO error event · 71d793fa
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_IO_ERROR
      
      This event includes the action that is about to be taken
      as a result of the watchdog triggering
      
        typedef enum {
           VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0,
           VIR_DOMAIN_EVENT_IO_ERROR_PAUSE,
           VIR_DOMAIN_EVENT_IO_ERROR_REPORT,
        } virDomainEventIOErrorAction;
      
      In addition it has the source path of the disk that had the
      error and its unique device alias. It does not include the
      target device name (/dev/sda), since this would preclude
      triggering IO errors from other file backed devices (eg
      serial ports connected to a file)
      
      Thus there is a new callback definition for this event type
      
      typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
                                                           virDomainPtr dom,
                                                           const char *srcPath,
                                                           const char *devAlias,
                                                           int action,
                                                           void *opaque);
      
      This is currently wired up to the QEMU block IO error events
      
      * daemon/remote.c: Dispatch IO error events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        IO error events
      * include/libvirt/libvirt.h.in: Define new IO error event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle IO error events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for block IO errors and emit a libvirt IO error event
      * src/remote/remote_driver.c: Receive and dispatch IO error
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        IO error events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
        from QEMU monitor
      71d793fa
    • D
      Add support for an explicit watchdog event · c5728cd6
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_WATCHDOG
      
      This event includes the action that is about to be taken
      as a result of the watchdog triggering
      
       typedef enum {
           VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0,
           VIR_DOMAIN_EVENT_WATCHDOG_PAUSE,
           VIR_DOMAIN_EVENT_WATCHDOG_RESET,
           VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF,
           VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN,
           VIR_DOMAIN_EVENT_WATCHDOG_DEBUG,
       } virDomainEventWatchdogAction;
      
      Thus there is a new callback definition for this event type
      
       typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn,
                                                             virDomainPtr dom,
                                                             int action,
                                                             void *opaque);
      
      * daemon/remote.c: Dispatch watchdog events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        watchdog events
      * include/libvirt/libvirt.h.in: Define new watchdg event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle watchdog events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for watchdogs and emit a libvirt watchdog event
      * src/remote/remote_driver.c: Receive and dispatch watchdog
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        watchdog events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for WATCHDOG event
        from QEMU monitor
      c5728cd6
    • D
      Add support for an explicit RTC change event · 32e6ac9c
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_RTC_CHANGE
      
      This event includes the new UTC offset measured in seconds.
      Thus there is a new callback definition for this event type
      
       typedef void (*virConnectDomainEventRTCChangeCallback)(virConnectPtr conn,
                                                              virDomainPtr dom,
                                                              long long utcoffset,
                                                              void *opaque);
      
      If the guest XML configuration for the <clock> is set to
      offset='variable', then the XML will automatically be
      updated with the new UTC offset value. This ensures that
      during migration/save/restore the new offset is preserved.
      
      * daemon/remote.c: Dispatch RTC change events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        RTC change events
      * include/libvirt/libvirt.h.in: Define new RTC change event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle RTC change events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for RTC changes and emit a libvirt RTC change event
      * src/remote/remote_driver.c: Receive and dispatch RTC change
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        RTC change events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for RTC_CHANGE event
        from QEMU monitor
      32e6ac9c
  21. 20 3月, 2010 1 次提交
  22. 10 3月, 2010 1 次提交
  23. 04 3月, 2010 1 次提交
    • D
      Support VCPU hotplug in QEMU guests · e8d6c289
      Daniel P. Berrange 提交于
      QEMU has a monitor command 'set_cpu' which allows a specific
      CPU to be toggled between online& offline state. libvirt CPU
      hotplug does not work in terms of individual indexes CPUs.
      Thus to support this, we iteratively toggle the online state
      when the total number of vCPUs is adjusted via libvirt
      
      NB, currently untested since QEMU segvs when running this!
      
      * src/qemu/qemu_driver.c: Toggle online state for CPUs when
        doing hotplug
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        monitor API for toggling a CPU's online status via 'set_cpu
      e8d6c289
  24. 02 3月, 2010 1 次提交
    • W
      Use device_del to remove SCSI controllers · 8540dadb
      Wolfgang Mauerer 提交于
      when the underlying qemu supports the drive/device model and the
      controller has been added this way.
      * src/qemu/qemu_driver.c: use qemuMonitorDelDevice() when detaching
        PCI controller and if supported
      * src/qemu/qemu_monitor.[ch]: add new qemuMonitorDelDevice() function
      * src/qemu/qemu_monitor_json.[ch]: JSON backend for DelDevice command
      * src/qemu/qemu_monitor_text.[ch]: Text backend for DelDevice command
      8540dadb
  25. 16 2月, 2010 1 次提交
    • D
      Run 'qmp_capabilities' command at QEMU monitor startup · 5d72a894
      Daniel P. Berrange 提交于
      When in JSON mode, QEMU requires that 'qmp_capabilities' is run as
      the first command in the monitor. This is a no-op when run in the
      text mode monitor
      
      * src/qemu/qemu_driver.c: Run capabilities negotiation when
        connecting to the monitor
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
        support for the 'qmp_capabilities' command, no-op in text mode.
      5d72a894
  26. 13 2月, 2010 1 次提交
    • D
      Support 'block_passwd' command for QEMU disk encryption · c31a116b
      Daniel P. Berrange 提交于
      The old text mode monitor prompts for a password when disks are
      encrypted. This interactive approach doesn't work for JSON mode
      monitor. Thus there is a new 'block_passwd' command that can be
      used.
      
      * src/qemu/qemu_driver.c: Split out code for looking up a disk
        secret from findVolumeQcowPassphrase, into a new method
        getVolumeQcowPassphrase. Enhance qemuInitPasswords() to also
        set the disk encryption password via the monitor
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        support for the 'block_passwd' monitor command.
      c31a116b
  27. 03 2月, 2010 1 次提交
    • D
      Introduce internal QEMU monitor APIs for drive + device hotadd · 5ec6cf7f
      Daniel P. Berrange 提交于
      The way QEMU is started has been changed to use '-device' and
      the new style '-drive' syntax. This needs to be mirrored in
      the hotplug code, requiring addition of two new APIs.
      
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Define APIs
        qemuMonitorAddDevice() and qemuMonitorAddDrive()
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Implement the new monitor APIs
      5ec6cf7f
  28. 18 1月, 2010 3 次提交
    • D
      Detect PCI addresses at QEMU startup · 989051a8
      Daniel P. Berrange 提交于
      Hotunplug of devices requires that we know their PCI address. Even
      hotplug of SCSI drives, required that we know the PCI address of
      the SCSI controller to attach the drive to. We can find this out
      by running 'info pci' and then correlating the vendor/product IDs
      with the devices we booted with.
      
      Although this approach is somewhat fragile, it is the only viable
      option with QEMU < 0.12, since there is no way for libvirto set
      explicit PCI addresses when creating devices in the first place.
      For QEMU > 0.12, this code will not be used.
      
      * src/qemu/qemu_driver.c: Assign all dynamic PCI addresses on
        startup of QEMU VM, matching vendor/product IDs
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        API for fetching PCI device address mapping
      989051a8
    • D
      Properly support SCSI drive hotplug · 3a6bf1bb
      Daniel P. Berrange 提交于
      The current SCSI hotplug support attaches a brand new SCSI controller
      for every disk. This is broken because the semantics differ from those
      used when starting the VM initially. In the latter case, each SCSI
      controller is filled before a new one is added.
      
      If the user specifies an high drive index (sdazz) then at initial
      startup, many intermediate SCSI controllers may be added with no
      drives.
      
      This patch changes SCSI hotplug so that it exactly matches the
      behaviour of initial startup. First the SCSI controller number is
      determined for the drive to be hotplugged. If any controller upto
      and including that controller number is not yet present, it is
      attached. Then finally the drive is attached to the last controller.
      
      NB, this breaks SCSI hotunplug, because there is no 'drive_del'
      command in current QEMU. Previous SCSI hotunplug was broken in
      any case because it was unplugging the entire controller, not
      just the drive in question.
      
      A future QEMU will allow proper SCSI hotunplug of a drive.
      
      This patch is derived from work done by Wolfgang Mauerer on disk
      controllers.
      
      * src/qemu/qemu_driver.c: Fix SCSI hotplug to add a drive to
       the correct controller, instead of just attaching a new
        controller.
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        support for 'drive_add' command
      3a6bf1bb
    • W
      Implement SCSI controller hotplug/unplug for QEMU · da9d937b
      Wolfgang Mauerer 提交于
      This patch allows for explicit hotplug/unplug of SCSI controllers.
      Ordinarily this is not required, since QEMU/libvirt will attach
      a new SCSI controller whenever one is required. Allowing explicit
      hotplug of controllers though, enables the caller to specify a
      static PCI address, instead of auto-assigning the next available
      PCI slot. Or it will when we have static PCI addressing.
      
      This patch is derived from Wolfgang Mauerer's disk controller
      patch series.
      
      * src/qemu/qemu_driver.c: Support hotplug & unplug of SCSI
        controllers
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        new API for attaching PCI SCSI controllers
      da9d937b
  29. 16 1月, 2010 1 次提交
    • D
      Convert monitor over to use virDomainDeviceAddress · ab0da52b
      Daniel P. Berrange 提交于
      Convert the QEMU monitor APIs over to use virDomainDeviceAddress
      structs for passing addresses in/out, instead of individual bits.
      This makes the number of parameters smaller & easier to deal with.
      No functional change
      
      * src/qemu/qemu_driver.c, src/qemu/qemu_monitor.c,
        src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_text.c,
        src/qemu/qemu_monitor_text.h: Change monitor hotplug APIs to
        take an explicit address ptr for all host/guest addresses
      ab0da52b
  30. 14 12月, 2009 1 次提交
    • M
      Get QEMU pty paths from the monitor · 60e8977f
      Matthew Booth 提交于
      This change makes the QEMU driver get pty paths from the output of the
      monitor 'info chardev' command. This output is structured, and contains
      both the name of the device and the path on the same line. This is
      considerably more reliable than parsing the startup log output, which
      requires the parsing code to know which order QEMU will print pty
      information in.
      
      Note that we still need to parse the log output as the monitor itself
      may be on a pty. This should be rare, however, and the new code will
      replace all pty paths parsed by the log output method once the monitor
      is available.
      
      * src/qemu/qemu_monitor.(c|h) src/qemu_monitor_text.(c|h): Implement
        qemuMonitorGetPtyPaths().
      * src/qemu/qemu_driver.c: Get pty path information using
        qemuMonitorGetPtyPaths().
      60e8977f
  31. 08 12月, 2009 1 次提交