1. 23 2月, 2013 4 次提交
  2. 08 2月, 2013 1 次提交
  3. 01 2月, 2013 1 次提交
    • E
      qemu: expose qemu 1.3 add-fd monitor command · 7b2c5893
      Eric Blake 提交于
      Add entry points for calling the qemu 'add-fd' and 'remove-fd'
      monitor commands.  There is no entry point for 'query-fdsets';
      the assumption is that a developer can use
       virsh qemu-monitor-command domain '{"execute":"query-fdsets"}'
      when debugging issues, and that meanwhile, libvirt is responsible
      enough to remember what fds it associated with what fdsets.
      Likewise, on the 'add-fd' command, it is assumed that libvirt
      will always pass a set id, rather than letting qemu autogenerate
      the next available id number.
      
      * src/qemu/qemu_monitor.c (qemuMonitorAddFd, qemuMonitorRemoveFd):
      New functions.
      * src/qemu/qemu_monitor.h (qemuMonitorAddFd, qemuMonitorRemoveFd):
      New prototypes.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONAddFd)
      (qemuMonitorJSONRemoveFd): New functions.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONAddFd)
      (qemuMonitorJSONRemoveFd): New prototypes.
      7b2c5893
  4. 16 1月, 2013 2 次提交
  5. 09 1月, 2013 1 次提交
  6. 21 12月, 2012 3 次提交
  7. 15 12月, 2012 1 次提交
    • E
      build: minor build fixes for BSD · 70743dae
      Eric Blake 提交于
      Noticed these while building on FreeBSD.
      
      * src/qemu/qemu_monitor.c (qemuMonitorBlockInfoLookup): Rename
      variable to avoid 'devname' collision.
      * src/qemu/qemu_driver.c (qemuDomainInterfaceStats): Mark unused
      variable.
      70743dae
  8. 05 12月, 2012 2 次提交
    • E
      qemu: improve error for failed JSON commands · 149fa591
      Eric Blake 提交于
      Only one error in qemu_monitor was already using the relatively
      new OPERATION_UNSUPPORTED error, even though it is a better fit
      for all of the messages related to options that are unsupported
      due to the version of qemu in use rather than due to a user's
      XML or .conf file choice.  Suggested by Osier Yang.
      
      * src/qemu/qemu_monitor.c (qemuMonitorSendFileHandle)
      (qemuMonitorAddHostNetwork, qemuMonitorRemoveHostNetwork)
      (qemuMonitorAttachDrive, qemuMonitorDiskSnapshot)
      (qemuMonitorDriveMirror, qemuMonitorTransaction)
      (qemuMonitorBlockCommit, qemuMonitorDrivePivot)
      (qemuMonitorBlockJob, qemuMonitorSystemWakeup)
      (qemuMonitorGetVersion, qemuMonitorGetMachines)
      (qemuMonitorGetCPUDefinitions, qemuMonitorGetCommands)
      (qemuMonitorGetEvents, qemuMonitorGetKVMState)
      (qemuMonitorGetObjectTypes, qemuMonitorGetObjectProps)
      (qemuMonitorGetTargetArch): Use better error category.
      149fa591
    • E
      qemu: nicer error message if live disk snapshot unsupported · 3bef4adf
      Eric Blake 提交于
      Without this patch, attempts to create a disk snapshot when qemu
      is too old results in a cryptic message:
      
      virsh # snapshot-create 23 --disk-only
      error: operation failed: Failed to take snapshot: unknown command: 'snapshot_blkdev'
      
      Now it reports:
      
      virsh # snapshot-create 23 --disk-only
      error: unsupported configuration: live disk snapshot not supported with this QEMU binary
      
      All versions of qemu that support live disk snapshot also support
      QMP (basically upstream qemu 1.1 and later, and backports to RHEL 6.2).
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_DISK_SNAPSHOT): New
      capability.
      * src/qemu/qemu_capabilities.c (qemuCaps): Track it.
      (qemuCapsProbeQMPCommands): Set it.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive): Use
      it.
      * src/qemu/qemu_monitor.c (qemuMonitorDiskSnapshot): Simplify.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot):
      Likewise.
      * src/qemu/qemu_monitor_text.h (qemuMonitorTextDiskSnapshot):
      Delete.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextDiskSnapshot):
      Likewise.
      3bef4adf
  9. 01 12月, 2012 2 次提交
    • G
    • E
      qemu: don't attempt undefined QMP commands · 3d7f6649
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=872292
      
      Libvirt should not attempt to call a QMP command that has not been
      documented in qemu.git - if future qemu introduces a command by the
      same name but with subtly different semantics, then libvirt will be
      broken when trying to use that command.
      
      We also had some code that could never be reached - some of our
      commands have an alternate for new vs. old qemu HMP commands; but
      if we are new enough to support QMP, we only need a fallback to
      the new HMP counterpart, and don't need to try for a QMP counterpart
      for the old HMP version.
      
      See also this attempt to convert the three snapshot commands to QMP:
      https://lists.gnu.org/archive/html/qemu-devel/2012-07/msg01597.html
      although it looks like that will still not happen before qemu 1.3.
      That thread eventually decided that qemu would use the name
      'save-vm' rather than 'savevm', which mitigates the fact that
      libvirt's attempt to use a QMP 'savevm' would be broken, but we
      might not be as lucky on the other commands.
      
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONSetCPU)
      (qemuMonitorJSONAddDrive, qemuMonitorJSONDriveDel)
      (qemuMonitorJSONCreateSnapshot, qemuMonitorJSONLoadSnapshot)
      (qemuMonitorJSONDeleteSnapshot): Use only HMP fallback for now.
      (qemuMonitorJSONAddHostNetwork, qemuMonitorJSONRemoveHostNetwork)
      (qemuMonitorJSONAttachDrive, qemuMonitorJSONGetGuestDriveAddress):
      Delete; QMP implies QEMU_CAPS_DEVICE, which prefers AddNetdev,
      RemoveNetdev, and AddDrive anyways (qemu_hotplug.c has all callers).
      * src/qemu/qemu_monitor.c (qemuMonitorAddHostNetwork)
      (qemuMonitorRemoveHostNetwork, qemuMonitorAttachDrive): Reflect
      deleted commands.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONAddHostNetwork)
      (qemuMonitorJSONRemoveHostNetwork, qemuMonitorJSONAttachDrive):
      Likewise.
      3d7f6649
  10. 29 11月, 2012 1 次提交
  11. 28 11月, 2012 1 次提交
  12. 02 11月, 2012 1 次提交
  13. 31 10月, 2012 1 次提交
    • M
      Make non-KVM machines work with QMP probing · 037a49dc
      Martin Kletzander 提交于
      When there is no 'qemu-kvm' binary and the emulator used for a machine
      is, for example, 'qemu-system-x86_64' that, by default, runs without
      kvm enabled, libvirt still supplies '-no-kvm' option to this process,
      even though it does not recognize such option (making the start of a
      domain fail in that case).
      
      This patch fixes building a command-line for QEMU machines without KVM
      acceleration and is based on following assumptions:
      
       - QEMU_CAPS_KVM flag means that QEMU is running KVM accelerated
         machines by default (without explicitly requesting that using a
         command-line option).  It is the closest to the truth according to
         the code with the only exception being the comment next to the
         flag, so it's fixed in this patch as well.
      
       - QEMU_CAPS_ENABLE_KVM flag means that QEMU is, by default, running
         without KVM acceleration and in case we need KVM acceleration it
         needs to be explicitly instructed to do so.  This is partially
         true for the past (this option essentially means that QEMU
         recognizes the '-enable-kvm' option, even though it's almost the
         same).
      037a49dc
  14. 27 10月, 2012 1 次提交
    • E
      blockjob: add qemu capabilities related to block jobs · 6d264c91
      Eric Blake 提交于
      Upstream qemu 1.3 is adding two new monitor commands, 'drive-mirror'
      and 'block-job-complete'[1], which can drive live block copy and
      storage migration.  [Additionally, RHEL 6.3 had backported an earlier
      version of most of the same functionality, but under the names
      '__com.redhat_drive-mirror' and '__com.redhat_drive-reopen' and with
      slightly different JSON arguments, and has been using patches similar
      to these upstream patches for several months now.]
      
      The libvirt API virDomainBlockRebase as already committed for 0.9.12
      is flexible enough to expose the basics of block copy, but some
      additional features in the 'drive-mirror' qemu command, such as
      setting error policy, setting granularity, or using a persistent
      bitmap, may later require a new libvirt API virDomainBlockCopy.  I
      will wait to add that API until we know more about what qemu 1.3
      will finally provide.
      
      This patch caters only to the upstream qemu 1.3 interface, although
      I have proven that the changes for RHEL 6.3 can be isolated to
      just qemu_monitor_json.c, and the rest of this series will
      gracefully handle either interface once the JSON differences are
      papered over in a downstream patch.
      
      For consistency with other block job commands, libvirt must handle
      the bandwidth argument as MiB/sec from the user, even though qemu
      exposes the speed argument as bytes/sec; then again, qemu rounds
      up to cluster size internally, so using MiB hides the worst effects
      of that rounding if you pass small numbers.
      
      [1]https://lists.gnu.org/archive/html/qemu-devel/2012-10/msg04123.html
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_DRIVE_MIRROR)
      (QEMU_CAPS_DRIVE_REOPEN): New bits.
      * src/qemu/qemu_capabilities.c (qemuCaps): Name them.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONCheckCommands): Set
      them.
      (qemuMonitorJSONDriveMirror, qemuMonitorDrivePivot): New functions.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONDriveMirror)
      (qemuMonitorDrivePivot): Declare them.
      * src/qemu/qemu_monitor.c (qemuMonitorDriveMirror)
      (qemuMonitorDrivePivot): New passthroughs.
      * src/qemu/qemu_monitor.h (qemuMonitorDriveMirror)
      (qemuMonitorDrivePivot): Declare them.
      6d264c91
  15. 20 10月, 2012 1 次提交
    • E
      blockjob: manage qemu block-commit monitor command · 3f38c7e3
      Eric Blake 提交于
      qemu 1.3 will be adding a 'block-commit' monitor command, per
      qemu.git commit ed61fc1.  It matches nicely to the libvirt API
      virDomainBlockCommit.
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_BLOCK_COMMIT): New bit.
      * src/qemu/qemu_capabilities.c (qemuCapsProbeQMPCommands): Set it.
      * src/qemu/qemu_monitor.h (qemuMonitorBlockCommit): New prototype.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockCommit):
      Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorBlockCommit): Implement it.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockCommit):
      Likewise.
      (qemuMonitorJSONHandleBlockJobImpl)
      (qemuMonitorJSONGetBlockJobInfoOne): Handle new event type.
      3f38c7e3
  16. 15 10月, 2012 1 次提交
    • M
      Add support for SUSPEND_DISK event · 7ba5defb
      Martin Kletzander 提交于
      This patch adds support for SUSPEND_DISK event; both lifecycle and
      separated.  The support is added for QEMU, machines are changed to
      PMSUSPENDED, but as QEMU sends SHUTDOWN afterwards, the state changes
      to shut-off.  This and much more needs to be done in order for libvirt
      to work with transient devices, wake-ups etc.  This patch is not
      aiming for that functionality.
      7ba5defb
  17. 28 9月, 2012 2 次提交
  18. 27 9月, 2012 10 次提交
  19. 26 9月, 2012 3 次提交
  20. 21 9月, 2012 1 次提交