1. 20 5月, 2013 4 次提交
  2. 17 5月, 2013 11 次提交
  3. 16 5月, 2013 2 次提交
  4. 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
  5. 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
  6. 13 5月, 2013 10 次提交
    • 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
    • D
      Add 'nbd' as a valid filesystem driver type · 13579d45
      Daniel P. Berrange 提交于
      The <filesystem> element can now accept a <driver type='nbd'/>
      as an alternative to 'loop'. The benefit of NBD is support
      for non-raw disk image formats.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      13579d45
    • D
      Add support for storage format in FS <driver> · ada14b86
      Daniel P. Berrange 提交于
      Extend the <driver> element in filesystem devices to
      allow a storage format to be set. The new attribute
      uses 'format' to reflect the storage format. This is
      different from the <driver> element in disk devices
      which use 'type' to reflect the storage format. This
      is because the 'type' attribute on filesystem devices
      is already used for the driver backend, for which the
      disk devices use the 'name' attribute. Arggggh.
      
      Anyway for disks we have
      
         <driver name="qemu" type="raw"/>
      
      And for filesystems this change means we now have
      
         <driver type="loop" format="raw"/>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ada14b86
    • H
      qemu: Allow the scsi-generic device in cgroup · 6eb42e38
      Han Cheng 提交于
      This adds the scsi-generic device into the device controller's
      whitelist, so that it's allowed to used by the qemu process.
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      6eb42e38
    • O
      qemu: Support bootindex for scsi host device · bab6ee6b
      Osier Yang 提交于
      bab6ee6b
    • O
      Introduce <readonly> for hostdev · f4bb7b48
      Osier Yang 提交于
      Since it's generic enough to be used by other types in future, I
      put it in <hostdev> as sub-element, though now it's only used by
      scsi host device.
      f4bb7b48
    • H
      qemu: Build qemu command line for scsi host device · 0d70656a
      Han Cheng 提交于
      Except the scsi host device's controller is "lsilogic", mapping
      between the libvirt attributes and scsi-generic properties is:
      
        libvirt     qemu
      -----------------------------------------
        controller  bus ($libvirt_controller.0)
        bus         channel
        target      scsi-id
        unit        lun
      
      For scsi host device with "lsilogic" controller, the mapping is:
      ('target (libvirt)' must be 0, as it's not used; 'unit (libvirt)
      must <= 7).
      
        libvirt            qemu
      ----------------------------------------------------------
        controller && bus  bus ($libvirt_controller.$libvirt_bus)
        unit               scsi-id
      
      It's not good to hardcode/hard-check limits of these attributes,
      and even worse, these limits are not documented, one has to find
      out by either testing or reading the qemu code, I'm looking forward
      to qemu expose limits like these one day). For example, exposing
      "max_target", "max_lun" for megasas:
      
      static const struct SCSIBusInfo megasas_scsi_info = {
          .tcq = true,
          .max_target = MFI_MAX_LD,
          .max_lun = 255,
      
          .transfer_data = megasas_xfer_complete,
          .get_sg_list = megasas_get_sg_list,
          .complete = megasas_command_complete,
          .cancel = megasas_command_cancel,
      };
      
      Example of the qemu command line (lsilogic controller):
      
        -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
        -device scsi-generic,bus=scsi0.0,scsi-id=8,\
        drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0
      
      Example of the qemu command line (virtio-scsi controller):
      
        -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
        -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=128,lun=128,\
        drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      0d70656a
    • H
      qemu: New cap flags for scsi-generic · b238c0be
      Han Cheng 提交于
      Adding two cap flags for scsi-generic:
        QEMU_CAPS_SCSI_GENERIC
        QEMU_CAPS_SCSI_GENERIC_BOOTINDEX
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      b238c0be
  7. 11 5月, 2013 1 次提交