1. 23 10月, 2012 1 次提交
    • A
      Rename target_phys_addr_t to hwaddr · a8170e5e
      Avi Kivity 提交于
      target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
      reserved) and its purpose doesn't match the name (most target_phys_addr_t
      addresses are not target specific).  Replace it with a finger-friendly,
      standards conformant hwaddr.
      
      Outstanding patchsets can be fixed up with the command
      
        git rebase -i --exec 'find -name "*.[ch]"
                              | xargs s/target_phys_addr_t/hwaddr/g' origin
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a8170e5e
  2. 05 10月, 2012 2 次提交
  3. 29 9月, 2012 1 次提交
    • P
      block: introduce block job error · 32c81a4a
      Paolo Bonzini 提交于
      The following behaviors are possible:
      
      'report': The behavior is the same as in 1.1.  An I/O error,
      respectively during a read or a write, will complete the job immediately
      with an error code.
      
      'ignore': An I/O error, respectively during a read or a write, will be
      ignored.  For streaming, the job will complete with an error and the
      backing file will be left in place.  For mirroring, the sector will be
      marked again as dirty and re-examined later.
      
      'stop': The job will be paused and the job iostatus will be set to
      failed or nospace, while the VM will keep running.  This can only be
      specified if the block device has rerror=stop and werror=stop or enospc.
      
      'enospc': Behaves as 'stop' for ENOSPC errors, 'report' for others.
      
      In all cases, even for 'report', the I/O error is reported as a QMP
      event BLOCK_JOB_ERROR, with the same arguments as BLOCK_IO_ERROR.
      
      It is possible that while stopping the VM a BLOCK_IO_ERROR event will be
      reported and will clobber the event from BLOCK_JOB_ERROR, or vice versa.
      This is not really avoidable since stopping the VM completes all pending
      I/O requests.  In fact, it is already possible now that a series of
      BLOCK_IO_ERROR events are reported with rerror=stop, because vm_stop
      calls bdrv_drain_all and this can generate further errors.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      32c81a4a
  4. 26 9月, 2012 2 次提交
  5. 07 9月, 2012 1 次提交
  6. 06 9月, 2012 5 次提交
  7. 05 9月, 2012 1 次提交
    • Y
      spice migration: add QEVENT_SPICE_MIGRATE_COMPLETED · 2fdd16e2
      Yonit Halperin 提交于
      When migrating, libvirt queries the migration status, and upon migration
      completions, it closes the migration src. On the other hand, when
      migration is completed, spice transfers data from the src to destination
      via the client. This data is required for keeping the spice session
      after migration, without suffering from data loss and inconsistencies.
      In order to allow this data transfer, we add QEVENT for signaling
      libvirt that spice migration has completed, and libvirt needs to wait
      for this event before quitting the src process.
      Signed-off-by: NYonit Halperin <yhalperi@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      2fdd16e2
  8. 24 8月, 2012 1 次提交
  9. 23 8月, 2012 1 次提交
    • A
      monitor: move json init from OPEN event to init · 58617a79
      Anthony Liguori 提交于
      At some point in the past, the OPEN event was changed to be issued from a
      bottom half.  This creates a small window whereas a data callback registered in
      init may be invoked before the OPEN event has been issued.
      
      This is reproducible with:
      
       echo "{'execute': 'qmp_capabilities'}" | qemu-system-x86_64 -M none -qmp stdio
      
      We can fix this for the monitor by moving the parser initialization to init.
      
      The remaining state that is set in OPEN appears harmless.
      Reported-by: NDaniel Berrange <berrange@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      58617a79
  10. 21 8月, 2012 1 次提交
  11. 15 8月, 2012 3 次提交
    • C
      monitor: Clean up fd sets on monitor disconnect · efb87c16
      Corey Bryant 提交于
      Fd sets are shared by all monitor connections.  Fd sets are considered
      to be in use while at least one monitor is connected.  When the last
      monitor disconnects, all fds that are members of an fd set with no
      outstanding dup references are closed.  This prevents any fd leakage
      associated with a client disconnect prior to using a passed fd.
      Signed-off-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      efb87c16
    • C
      block: Enable qemu_open/close to work with fd sets · adb696f3
      Corey Bryant 提交于
      When qemu_open is passed a filename of the "/dev/fdset/nnn"
      format (where nnn is the fdset ID), an fd with matching access
      mode flags will be searched for within the specified monitor
      fd set.  If the fd is found, a dup of the fd will be returned
      from qemu_open.
      Signed-off-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      adb696f3
    • C
      qapi: Introduce add-fd, remove-fd, query-fdsets · ba1c048a
      Corey Bryant 提交于
      This patch adds support that enables passing of file descriptors
      to the QEMU monitor where they will be stored in specified file
      descriptor sets.
      
      A file descriptor set can be used by a client like libvirt to
      store file descriptors for the same file.  This allows the
      client to open a file with different access modes (O_RDWR,
      O_WRONLY, O_RDONLY) and add/remove the passed fds to/from an fd
      set as needed.  This will allow QEMU to (in a later patch in this
      series) "open" and "reopen" the same file by dup()ing the fd in
      the fd set that corresponds to the file, where the fd has the
      matching access mode flag that QEMU requests.
      
      The new QMP commands are:
        add-fd: Add a file descriptor to an fd set
        remove-fd: Remove a file descriptor from an fd set
        query-fdsets: Return information describing all fd sets
      
      Note: These commands are not compatible with the existing getfd
      and closefd QMP commands.
      Signed-off-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      ba1c048a
  12. 14 8月, 2012 3 次提交
    • L
      qmp: add SUSPEND_DISK event · 25df49f6
      Luiz Capitulino 提交于
      Emitted when the guest makes a request to enter S4 state.
      
      There are three possible ways of having this event, as described here:
      
       http://lists.gnu.org/archive/html/qemu-devel/2012-07/msg02307.html
      
      I've decided to add a new event and make it indepedent of SHUTDOWN.
      This means that the SHUTDOWN event will eventually follow the
      SUSPEND_DISK event.
      
      I've choosen this way because of two reasons:
      
       1. Having an indepedent event makes it possible to query for its
          existence by using query-events
      
       2. In the future, we may allow the user to change what QEMU should
          do as a result of the guest entering S4. So it's a good idea to
          keep both events separated
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      25df49f6
    • L
      qmp: switch to the new error format on the wire · de253f14
      Luiz Capitulino 提交于
      IMPORTANT: this BREAKS QMP's compatibility for the error response.
      
      This commit changes QMP's wire protocol to make use of the simpler
      error format introduced by previous commits.
      
      There are two important (and mostly incompatible) changes:
      
       1. Almost all error classes have been replaced by GenericError. The
          only classes that are still supported for compatibility with
          libvirt are: CommandNotFound, DeviceNotActive, KVMMissingCap,
          DeviceNotFound and MigrationExpected
      
       2. The 'data' field of the error dictionary is gone
      
      As an example, an error response like:
      
        { "error": { "class": "DeviceNotRemovable",
                     "data": { "device": "virtio0" },
                     "desc": "Device 'virtio0' is not removable" } }
      
      Will now be emitted as:
      
        { "error": { "class": "GenericError",
                     "desc": "Device 'virtio0' is not removable" } }
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      de253f14
    • L
      monitor: drop unused monitor debug code · 74ee59a8
      Luiz Capitulino 提交于
      In the old QMP days, this code was used to find out QMP commands that
      might be calling monitor_printf() down its call chain.
      
      This is almost impossible to happen today, because the qapi converted
      commands don't even have a monitor object. Besides, it's been more than
      a year since I used this last time.
      
      Let's just drop it.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      74ee59a8
  13. 08 8月, 2012 2 次提交
  14. 19 7月, 2012 1 次提交
  15. 14 7月, 2012 2 次提交
  16. 16 6月, 2012 2 次提交
    • D
      Add rate limiting of RTC_CHANGE, BALLOON_CHANGE & WATCHDOG events · afeecec2
      Daniel P. Berrange 提交于
      Allow certain event types to be rate limited to avoid flooding
      monitor clients. The monitor_protocol_event() method is changed
      such that instead of immediately emitting the event to Monitor
      instances, it will call a new monitor_protocol_event_queue()
      method.
      
      This will check to see if the rate limit for the event has been
      exceeded, and if so schedule a timer to wakeup at the end of the
      rate limit period. If further events arrive before the timer fires,
      the previously queued event will be discarded in favour of the new
      event. The event will eventually be emitted when the timer fires.
      
      This logic is applied to RTC_CHANGE, BALLOON_CHANGE & WATCHDOG
      events, since the data associated with these events is stateless
      
       * monitor.c: Add support for rate limiting
       * monitor.h: Define monitor_global_init for one-time setup tasks
       * vl.c: Invoke monitor_global_init
       * trace-events: Add hooks for monitor event tracing
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Acked-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      afeecec2
    • D
      Add event notification for guest balloon changes · 973603a8
      Daniel P. Berrange 提交于
      After setting a balloon target value, applications have to
      continually poll 'query-balloon' to determine whether the
      guest has reacted to this request. The virtio-balloon backend
      knows exactly when the guest has reacted though, and thus it
      is possible to emit a JSON event to tell the mgmt application
      whenever the guest balloon changes.
      
      This introduces a new 'qemu_balloon_changed()' API which is
      to be called by balloon driver backends, whenever they have
      a change in balloon value. This takes the 'actual' balloon
      value, as would be found in the BalloonInfo struct.
      
      The qemu_balloon_change API emits a JSON monitor event which
      looks like:
      
        {"timestamp": {"seconds": 1337162462, "microseconds": 814521},
         "event": "BALLOON_CHANGE", "data": {"actual": 944766976}}
      
      * balloon.c, balloon.h: Introduce qemu_balloon_changed() for
        emitting balloon change events on the monitor
      * hw/virtio-balloon.c: Invoke qemu_balloon_changed() whenever
        the guest changes the balloon actual value
      * monitor.c, monitor.h: Define QEVENT_BALLOON_CHANGE
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Acked-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      973603a8
  17. 05 6月, 2012 1 次提交
    • D
      Add 'query-events' command to QMP to query async events · 4860853d
      Daniel P. Berrange 提交于
      Sometimes it is neccessary for an application to determine
      whether a particular QMP event is available, so they can
      decide whether to use compatibility code instead. This
      introduces a new 'query-events' command to QMP to do just
      that
      
       { "execute": "query-events" }
       {"return": [{"name": "WAKEUP"},
                   {"name": "SUSPEND"},
                   {"name": "DEVICE_TRAY_MOVED"},
                   {"name": "BLOCK_JOB_CANCELLED"},
                   {"name": "BLOCK_JOB_COMPLETED"},
                   ...snip...
                   {"name": "SHUTDOWN"}]}
      
      * monitor.c: Turn MonitorEvent -> string conversion
        into a lookup from a static table of constant strings.
        Add impl of qmp_query_events monitor command handler
      * qapi-schema.json, qmp-commands.hx: Define contract of
        query-events command
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      4860853d
  18. 09 5月, 2012 2 次提交
  19. 27 3月, 2012 1 次提交
  20. 19 3月, 2012 2 次提交
  21. 15 3月, 2012 2 次提交
  22. 25 2月, 2012 1 次提交
  23. 23 2月, 2012 1 次提交
  24. 21 2月, 2012 1 次提交