1. 03 6月, 2014 1 次提交
  2. 25 3月, 2014 2 次提交
  3. 21 3月, 2014 2 次提交
    • C
      libvirt support to force convergence of live guest migration · 05e1b06a
      Chegu Vinod 提交于
      Busy enterprise workloads hosted on large sized VM's tend to dirty
      memory faster than the transfer rate achieved via live guest migration.
      Despite some good recent improvements (& using dedicated 10Gig NICs
      between hosts) the live migration may NOT converge.
      
      Recently support was added in qemu (version 1.6) to allow a user to
      choose if they wish to force convergence of their migration via a
      new migration capability : "auto-converge". This feature allows for qemu
      to auto-detect lack of convergence and trigger a throttle-down of the
      VCPUs.
      
      This patch includes the libvirt support needed to trigger this
      feature. (Testing is in progress)
      Signed-off-by: NChegu Vinod <chegu_vinod@hp.com>
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      05e1b06a
    • E
      qemu: enable monitor event reporting · 3566599a
      Eric Blake 提交于
      Wire up all the pieces to send arbitrary qemu events to a
      client using libvirt-qemu.so.  If the extra bookkeeping of
      generating event objects even when no one is listening turns
      out to be noticeable, we can try to further optimize things
      by adding a counter for how many connections are using events,
      and only dump events when the counter is non-zero; but for
      now, I didn't think it was worth the code complexity.
      
      * src/qemu/qemu_driver.c
      (qemuConnectDomainQemuMonitorEventRegister)
      (qemuConnectDomainQemuMonitorEventDeregister): New functions.
      * src/qemu/qemu_monitor.h (qemuMonitorEmitEvent): New prototype.
      (qemuMonitorDomainEventCallback): New typedef.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONIOProcessEvent):
      Report events.
      * src/qemu/qemu_monitor.c (qemuMonitorEmitEvent): New function, to
      pass events through.
      * src/qemu/qemu_process.c (qemuProcessHandleEvent): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3566599a
  4. 12 3月, 2014 1 次提交
    • E
      qemu: don't munge user input during block commit · 359f4b11
      Eric Blake 提交于
      While investigating https://bugzilla.redhat.com/show_bug.cgi?id=1061827
      I noticed that we pass user input unscathed for block-pull, but
      always pass a canonical absolute name through for block-commit.
      [Note that we probably _ought_ to validate that the user's request
      for block-pull actually matches the backing chain, the way we already
      do for block-commit - but that's a separate issue.  Further note that
      the ability to pass user input through unscathed allows backdoors
      such as specifying a backing image that is a network URI such as
      a gluster disk, instead of forcing things to the local file system;
      which is an area still under active investigation on whether libvirt
      needs to behave differently for network disks.]
      
      Since qemu may write the name that the user passed in as the backing
      file, a user may have a reason to want a relative file name passed
      through to qemu, and always munging things to absolute prevents that.
      
      Put another way, if you have the backing chain:
      
      [A] <- [B(back=./A)] <- [C(back=./B)]
      
      and commit B into A (virsh blockcommit $dom vda --base A --top B),
      the metadata of C will have to be re-written. But should it be
      rewritten as [C(back=./A)] or as [C(back=/path/to/A)]?  Still up in
      the air is whether qemu's decision should be based on whether B
      and/or C had relative paths, or on whether the --base and/or
      --top arguments to the command were relative paths; but if we always
      pass a canonical name, we've prevented the spelling of the command
      arguments from being part of the hueristics that qemu uses.
      
      I also audited the code, and verified that we never call
      qemuMonitorBlockCommit() with a NULL base, either before or after
      the change to qemu_driver.c.
      
      * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Preserve user's
      spelling, since absolute vs. relative matters to qemu.
      * src/qemu/qemu_monitor.h (qemuMonitorBlockCommit): Base is never
      null.
      * src/qemu/qemu_monitor.c (qemuMonitorBlockCommit): Likewise.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockCommit):
      Likewise.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockCommit):
      Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      359f4b11
  5. 15 11月, 2013 1 次提交
  6. 13 11月, 2013 1 次提交
  7. 08 11月, 2013 1 次提交
  8. 25 9月, 2013 1 次提交
    • P
      qemu: monitor: Add infrastructure to access VM logs for better err msgs · 8519e9ec
      Peter Krempa 提交于
      Early VM startup errors usually produce a better error message in the
      machine log file. Currently we were accessing it only when the process
      exited during certain phases of startup. This will help adding a more
      comprehensive error extraction for early qemu startup phases.
      
      This patch adds infrastructure to keep a file descriptor for the machine
      log file that will be used in case an error happens.
      8519e9ec
  9. 26 8月, 2013 2 次提交
  10. 20 7月, 2013 1 次提交
  11. 18 7月, 2013 1 次提交
  12. 16 7月, 2013 1 次提交
    • J
      Determine whether to start balloon memory stats gathering. · ffdf82a9
      John Ferlan 提交于
      At vm startup and attach attempt to set the balloon driver statistics
      collection period based on the value found in the domain xml file. This
      is not done at reconnect since it's possible that a collection period
      was set on the live guest and making the set period call would reset to
      whatever value is stored in the config file.
      
      Setting the stats collection period has a side effect of searching through
      the qom-list output for the virtio balloon driver and making sure that it
      has the right properties in order to allow setting of a collection period
      and eventually fetching of statistics.
      
      The walk through the qom-list is expensive and thus the balloonpath will
      be saved in the monitor private structure as well as a flag indicating
      that the initialization has already been attempted (in the event that a
      path is not found, no sense to keep checking).
      
      This processing model conforms to the qom object model model which
      requires setting object properties after device startup. That is, it's
      not possible to pass the period along via the startup code as it won't
      be recognized.
      ffdf82a9
  13. 12 7月, 2013 2 次提交
  14. 03 7月, 2013 1 次提交
  15. 01 7月, 2013 1 次提交
  16. 07 6月, 2013 1 次提交
  17. 22 5月, 2013 1 次提交
    • M
      qemu: Adapt qemuBuildInterfaceCommandLine to to multiqueue net · 1f24f682
      Michal Privoznik 提交于
      In order to learn libvirt multiqueue several things must be done:
      
      1) The '/dev/net/tun' device needs to be opened multiple times with
      IFF_MULTI_QUEUE flag passed to ioctl(fd, TUNSETIFF, &ifr);
      
      2) Similarly, '/dev/vhost-net' must be opened as many times as in 1)
      in order to keep 1:1 ratio recommended by qemu and kernel folks.
      
      3) The command line construction code needs to switch from 'fd=X' to
      'fds=X:Y:...:Z' and from 'vhostfd=X' to 'vhostfds=X:Y:...:Z'.
      
      4) The monitor handling code needs to learn to pass multiple FDs.
      1f24f682
  18. 14 5月, 2013 2 次提交
    • E
      qemu: query command line options in QMP · bd56d0d8
      Eric Blake 提交于
      Ever since the conversion to using only QMP for probing features
      of qemu 1.2 and newer, we have been unable to detect features
      that are added only by additional command line options.  For
      example, we'd like to know if '-machine mem-merge=on' (added
      in qemu 1.5) is present.  To do this, we will take advantage
      of qemu 1.5's query-command-line-parameters QMP call [1].
      
      This patch wires up the framework for probing the command results;
      if the QMP command is missing, or if a particular command line
      option does not output any parameters (for example, -net uses
      a polymorphic parser, which showed up as no parameters as of qemu
      1.5), we silently treat that command as having no results.
      
      [1] https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg05180.html
      
      * src/qemu/qemu_monitor.h (qemuMonitorGetOptions)
      (qemuMonitorSetOptions)
      (qemuMonitorGetCommandLineOptionParameters): New functions.
      * src/qemu/qemu_monitor_json.h
      (qemuMonitorJSONGetCommandLineOptionParameters): Likewise.
      * src/qemu/qemu_monitor.c (_qemuMonitor): Add cache field.
      (qemuMonitorDispose): Clean it.
      (qemuMonitorGetCommandLineOptionParameters): Implement new function.
      * src/qemu/qemu_monitor_json.c
      (qemuMonitorJSONGetCommandLineOptionParameters): Likewise.
      (testQemuMonitorJSONGetCommandLineParameters): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      bd56d0d8
    • E
      qemu: use bool in monitor struct · 764bb5e5
      Eric Blake 提交于
      Follows on the heels of other bool cleanups, such as commit 93002b98.
      
      * src/qemu/qemu_monitor.h (qemuMonitorOpen, qemuMonitorOpenFD):
      Update json parameter type.
      * src/qemu/qemu_monitor.c (qemuMonitorOpen, qemuMonitorOpenFD):
      Likewise.
      (_qemuMonitor): Adjust field type.
      * src/qemu/qemu_domain.h (_qemuDomainObjPrivate): Likewise.
      * src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLParse): Adjust
      client.
      * src/qemu/qemu_process.c (qemuProcessStart): Likewise.
      * tests/qemumonitortestutils.c (qemuMonitorTestNew): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      764bb5e5
  19. 13 4月, 2013 1 次提交
  20. 23 2月, 2013 6 次提交
  21. 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
  22. 16 1月, 2013 1 次提交
  23. 09 1月, 2013 1 次提交
  24. 21 12月, 2012 2 次提交
  25. 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
  26. 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
  27. 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
  28. 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
  29. 27 9月, 2012 1 次提交