1. 22 5月, 2013 3 次提交
  2. 21 5月, 2013 4 次提交
    • O
      src/qemu: Remove the whitespace before ';' · 66194f71
      Osier Yang 提交于
      66194f71
    • O
      qemu: Don't remove the "return 0" · 58f8e0cd
      Osier Yang 提交于
      Commit f60a50c7 intended to remove the warning only, but not with
      the "return 0" together.
      58f8e0cd
    • G
      qemu: fix a typo in qemuAddSharedDevice · ceae7460
      Guannan Ren 提交于
      ceae7460
    • M
      qemuDomainChangeEjectableMedia: Unlock domain while waiting for event · 543af79a
      Michal Privoznik 提交于
      In 84c59ffa I've tried to fix changing ejectable media process. The
      process should go like this:
      
      1) we need to call 'eject' on the monitor
      2) we should wait for 'DEVICE_TRAY_MOVED' event
      3) now we can issue 'change' command
      
      However, while waiting in step 2) the domain monitor was locked. So
      even if qemu reported the desired event, the proper callback was not
      called immediately. The monitor handling code needs to lock the
      monitor in order to read the event. So that's the first lock we must
      not hold while waiting. The second one is the domain lock. When
      monitor handling code reads an event, the appropriate callback is
      called then. The first thing that each callback does is locking the
      corresponding domain as a domain or its device is about to change
      state. So we need to unlock both monitor and VM lock. Well, holding
      any lock while sleep()-ing is not the best thing to do anyway.
      543af79a
  3. 20 5月, 2013 5 次提交
  4. 17 5月, 2013 11 次提交
  5. 16 5月, 2013 2 次提交
  6. 15 5月, 2013 6 次提交
    • O
      qemu: Support discard for disk · a7c4202c
      Osier Yang 提交于
      QEMU introduced "discard" option for drive since commit a9384aff53,
      
      <...>
      @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and
      controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
      requests are ignored or passed to the filesystem.  Some machine types
      may not support discard requests.
      </...>
      
      This patch exposes the support in libvirt.
      
      QEMU supported "discard" for "-drive" since v1.5.0-rc0:
      
      % git tag --contains a9384aff53
      contains
      v1.5.0-rc0
      v1.5.0-rc1
      
      So this only detects the capability bit using virQEMUCapsProbeQMPCommandLine.
      a7c4202c
    • J
      efdcc92f
    • J
      Adjust usage of qemu -no-reboot and -no-shutdown options · 0e034efa
      John Ferlan 提交于
      During building of the qemu command line determine whether to add/use the
      '-no-reboot' option only if each of the 'on' events want to to destroy
      the domain; otherwise, use the '-no-shutdown' option.
      
      Prior to this change both could be on the command line, which while allowed
      could be construed as a conflict.
      0e034efa
    • M
      qemu: Add VNC WebSocket support · 85ec7ff6
      Martin Kletzander 提交于
      Adding a VNC WebSocket support for QEMU driver.  This functionality is
      in upstream qemu from commit described as v1.3.0-982-g7536ee4, so the
      capability is being recognized based on QEMU version for now.
      85ec7ff6
    • O
      qemu: New XML to disable memory merge at guest startup · 77b54b96
      Osier Yang 提交于
      QEMU introduced command line "-mem-merge=on|off" (defaults to on) to
      enable/disable the memory merge (KSM) at guest startup. This exposes
      it by new XML:
        <memoryBacking>
          <nosharepages/>
        </memoryBacking>
      
      The XML tag is same with what we used internally for old RHEL.
      77b54b96
    • E
      qemu: detect -machine mem-merge capability · d12bbd6a
      Eric Blake 提交于
      * src/qemu/qemu_capabilities.h: New capability bit.
      * src/qemu/qemu_capabilities.c (virQEMUCapsProbeQMPCommandLine): New
      function, based on qemuMonitorGetCommandLineOptionParameters, which was
      introduced by commit bd56d0d8; use it to set new capability bit.
      (virQEMUCapsInitQMP): Use new function.
      d12bbd6a
  7. 14 5月, 2013 6 次提交
    • D
      Forbid use of ':' in RBD pool names · 2a2bc151
      Daniel P. Berrange 提交于
      The QEMU command line syntax for RBD disks is
      
         file=rbd:pool/image:opt1=val1:opt2=val2...
      
      There is no way to escape the ':' if it appears in the
      pool or image name. Thus it must be explicitly forbidden
      if it occurs in the libvirt XML. People are known to
      be abusing the lack of escaping in current libvirt to
      pass arbitrary args to QEMU.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      2a2bc151
    • E
      qemu: fix bad free · 0b923ba3
      Eric Blake 提交于
      Commit bd56d0d8 could lead to freeing an uninitialized pointer:
      
      qemu/qemu_monitor_json.c: In function 'qemuMonitorJSONGetCommandLineOptionParameters':
      qemu/qemu_monitor_json.c:4284: warning: 'cmd' may be used uninitialized in this function
      
      * src/qemu/qemu_monitor_json.c
      (qemuMonitorJSONGetCommandLineOptionParameters): Initialize variable.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0b923ba3
    • 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: simplify string cleanup · 082274ea
      Eric Blake 提交于
      No need to open code a string list cleanup, if we are nice
      to the caller by guaranteeing a NULL-terminated result.
      
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetCPUDefinitions)
      (qemuMonitorJSONGetCommands, qemuMonitorJSONGetEvents)
      (qemuMonitorJSONGetObjectTypes, qemuMonitorJSONGetObjectProps):
      Use simpler cleanup.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      082274ea
    • 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
    • H
      qemu: Add hotplug support for scsi host device · 8f76ad99
      Han Cheng 提交于
      This adds both attachment and detachment support for scsi host
      device.
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      Signed-off-by: NOsier Yang <jyang@redhat>
      8f76ad99
  8. 13 5月, 2013 3 次提交
    • J
      Fix starting domains when kernel has no cgroups support · bbe97ae9
      Jim Fehlig 提交于
      Found that I was unable to start existing domains after updating
      to a kernel with no cgroups support
      
        # zgrep CGROUP /proc/config.gz
        # CONFIG_CGROUPS is not set
        # virsh start test
        error: Failed to start domain test
        error: Unable to initialize /machine cgroup: Cannot allocate memory
      
      virCgroupPartitionNeedsEscaping() correctly returns errno (ENOENT) when
      attempting to open /proc/cgroups on such a system, but it was being
      dropped in virCgroupSetPartitionSuffix().
      
      Change virCgroupSetPartitionSuffix() to propagate errors returned by
      its callees.  Also check for ENOENT in qemuInitCgroup() when determining
      if cgroups support is available.
      bbe97ae9
    • O
      qemu: Refactor helpers for USB device attachment · 7d763aca
      Osier Yang 提交于
      It's better to put the usb related codes into qemuDomainAttachHostUsbDevice
      instead of qemuDomainAttachHostDevice.
      
      And in the old qemuDomainAttachHostDevice, just stealing the "usb" from
      driver->activeUsbHostdevs leaks the memory.
      7d763aca
    • H
      qemu: Introduce activeScsiHostdevs list for scsi host devices · ea74c076
      Han Cheng 提交于
      Although virtio-scsi supports SCSI PR (Persistent Reservations),
      the device on host may do not support it. To avoid losing data,
      Just like PCI and USB pass through devices, only one live guest
      is allowed per SCSI host pass through device."
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      ea74c076