1. 17 12月, 2012 1 次提交
    • G
      qemu: add qemu vga devices caps and one cap to mark them usable · 4c993d8a
      Guannan Ren 提交于
      QEMU_CAPS_DEVICE_QXL          -device qxl
      QEMU_CAPS_DEVICE_VGA          -device VGA
      QEMU_CAPS_DEVICE_CIRRUS_VGA   -device cirrus-vga
      QEMU_CAPS_DEVICE_VMWARE_SVGA  -device vmware-svga
      
      QEMU_CAPS_DEVICE_VIDEO_PRIMARY  /* safe to use -device XXX
                                       for primary video device */
      
      Fix a typo in qemuCapsObjectTypes, the string 'qxl' here
      should be -device qxl rather than -vga [...|qxl|..]
      4c993d8a
  2. 13 12月, 2012 1 次提交
  3. 12 12月, 2012 1 次提交
    • J
      qemu: assume seccomp sandbox is supported since qemu 1.2 · 6543a459
      Ján Tomko 提交于
      Currently there is no way to detect it via QMP and requesting "-sandbox
      off" works correctly even if it was compiled out, so this will work
      unless someone both requests the sandbox in qemu.conf and builds QEMU
      without the support for it.
      6543a459
  4. 08 12月, 2012 1 次提交
  5. 05 12月, 2012 1 次提交
    • 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
  6. 01 12月, 2012 1 次提交
  7. 29 11月, 2012 1 次提交
  8. 28 11月, 2012 2 次提交
    • V
      qemu: Add QEMU version computation to QMP probing · 856a4822
      Viktor Mihajlovski 提交于
      With QMP capability probing, the version was not set.
      virsh version returns:
      ...
      Cannot extract running QEMU hypervisor version
      
      This is fixed by computing caps->version from QMP major,
      minor, micro values.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      856a4822
    • V
      qemu: Fix QMP Capabability Probing Failure · 1a50ba2c
      Viktor Mihajlovski 提交于
      QMP Capability probing will fail if QEMU cannot bind to the
      QMP monitor socket in the qemu_driver->libDir directory.
      That's because the child process is stripped of all
      capabilities and this directory is chown'ed to the configured
      QEMU user/group (normally qemu:qemu) by the QEMU driver.
      
      To prevent this from happening, the driver startup will now pass
      the QEMU uid and gid down to the capability probing code.
      All capability probing invocations of QEMU will be run with
      the configured QEMU uid instead of libvirtd's.
      
      Furter, the pid file handling is moved to libvirt, as QEMU
      cannot write to the qemu_driver->runDir (root:root). This also
      means that the libvirt daemonizing must be used.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      1a50ba2c
  9. 15 11月, 2012 1 次提交
  10. 10 11月, 2012 1 次提交
    • V
      capabilities: defaultConsoleTargetType can depend on architecture · b1c88c14
      Viktor Mihajlovski 提交于
      For S390, the default console target type cannot be of type 'serial'.
      It is necessary to at least interpret the 'arch' attribute
      value of the os/type element to produce the correct default type.
      
      Therefore we need to extend the signature of defaultConsoleTargetType
      to account for architecture. As a consequence all the drivers
      supporting this capability function must be updated.
      
      Despite the amount of changed files, the only change in behavior is
      that for S390 the default console target type will be 'virtio'.
      
      N.B.: A more future-proof approach could be to to use hypervisor
      specific capabilities to determine the best possible console type.
      For instance one could add an opaque private data pointer to the
      virCaps structure (in case of QEMU to hold capsCache) which could
      then be passed to the defaultConsoleTargetType callback to determine
      the console target type.
      Seems to be however a bit overengineered for the use case...
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      b1c88c14
  11. 02 11月, 2012 3 次提交
  12. 01 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. 23 10月, 2012 1 次提交
  16. 22 10月, 2012 2 次提交
    • D
      qemu: Don't blindly assume VNC is supported · 2da776b1
      Doug Goldstein 提交于
      Currently it's assumed that qemu always supports VNC, however it is
      definitely possible to compile qemu without VNC support so we should at
      the very least check for it and handle that correctly.
      2da776b1
    • M
      qemu: set seamless migration capability · 508451e4
      Michal Privoznik 提交于
      As we switched to setting capabilities based on QMP communication,
      qemu seamless-migration capability was not set. In the -help output
      this knob is called seamless-migration=[on|off]. The equivalent in
      QMP world is SPICE_MIGRATE_COMPLETED event (qemu upstream commit
      2fdd16e2).
      508451e4
  17. 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
  18. 19 10月, 2012 1 次提交
    • G
      qemu: Set arch to i686 if qemu-system-i386 is found · c324bad9
      Guido Günther 提交于
      If we can't probe the architecture from QMP we parse the architecture
      from the qemu binaries name. This results in the architecture being i386
      instead of i686 which then results in QEMU_CAPS_PCI_MULTIBUS being unset
      which gives a broken qemu command line.
      
      This probably didn't show up earlier since most of the time there's also
      a /usr/bin/qemu around which results in i686 capabilities.
      c324bad9
  19. 18 10月, 2012 2 次提交
  20. 12 10月, 2012 1 次提交
  21. 09 10月, 2012 1 次提交
    • J
      qemu: Fix QMP detection of QXL graphics · 844cdf22
      Jiri Denemark 提交于
      With the recent introduction of QMP capabilities probing, libvirt failed
      to detect support for QXL graphics in QEMU 1.2 and newer. In addition to
      fixing that, this patch also causes libvirt to detect QXL support for
      qemu-kvm-0.13.0, which doesn't advertise it in -help output but mentions
      it in device list. Since qemu-kvm-0.13.0 supported -spice, it looks like
      not having qxl in -help was a bug.
      844cdf22
  22. 02 10月, 2012 2 次提交
    • E
      build: fix typo in debug message · 2b804cfa
      Eric Blake 提交于
      Introduced in commit 0caccb58.
      
        CC     libvirt_driver_qemu_impl_la-qemu_capabilities.lo
      ../../src/qemu/qemu_capabilities.c: In function 'qemuCapsInitQMP':
      ../../src/qemu/qemu_capabilities.c:2327:13: error: format '%d' expects argument of type 'int', but argument 8 has type 'const char *' [-Werror=format]
      
      * src/qemu/qemu_capabilities.c (qemuCapsInitQMP): Use correct format.
      2b804cfa
    • J
      qemu: Kill processes used for QMP caps probing · 0caccb58
      Jiri Denemark 提交于
      Since libvirt switched to QMP capabilities probing recently, it starts
      QEMU process used for this probing with -daemonize, which means
      virCommandAbort can no longer reach these processes. As a result of
      that, restarting libvirtd will leave several new QEMU processes behind.
      Let's use QEMU's -pidfile and use it to kill the process when QMP caps
      probing is done.
      0caccb58
  23. 28 9月, 2012 3 次提交
    • D
      Add support for detecting capablities using QMP commands · 43e23c73
      Daniel P. Berrange 提交于
      Start a QEMU process using
      
         $QEMU -S -no-user-config -nodefaults \
               -nographic -M none -qmp unix:/some/path,server,nowait
      
      and talk QMP over stdio to discover what capabilities the
      binary supports. This works for QEMU 1.2.0 or later and
      for older QEMU automatically fallback to the old approach
      of parsing -help and related command line args.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      43e23c73
    • D
      Fix QEMU test with 1.2.0 help output · 72574808
      Daniel P. Berrange 提交于
      The help output for QEMU 1.2.0 changed 'pci-assign' to 'kvm-pci-assign'.
      Since the new capabilities code does exact device name matching
      instead of substring matching, this caused the capabilities to go
      missing.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      72574808
    • D
      Refactor qemuCapsParseDeviceStr to work from data tables · b073fe40
      Daniel P. Berrange 提交于
      Currently the qemuCapsParseDeviceStr method has a bunch of open
      coded string searches/comparisons to detect devices and their
      properties. Soon this data will be obtained from QMP queries
      instead of -device help output. Maintaining the list of device
      and properties in two places is undesirable. Thus the existing
      qemuCapsParseDeviceStr() method needs to be refactored to
      separate the device types and properties from the actual
      search code.
      
      Thus the -device help output is now parsed to construct a
      list of device names, and device properties. These are then
      checked against a set of datatables to set the capability
      flags
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b073fe40
  24. 27 9月, 2012 9 次提交