1. 02 9月, 2011 2 次提交
  2. 15 8月, 2011 1 次提交
    • L
      qemu: support event_idx parameter for virtio disk and net devices · 73c0a148
      Laine Stump 提交于
      In some versions of qemu, both virtio-blk-pci and virtio-net-pci
      devices can have an event_idx setting that determines some details of
      event processing. When it is enabled, it "reduces the number of
      interrupts and exits for the guest". qemu will automatically enable
      this feature when it is available, but there may be cases where this
      new feature could actually make performance worse (NB: no such case
      has been found so far).
      
      As a safety switch in case such a situation is encountered in the
      field, this patch adds a new attribute "event_idx" to the <driver>
      element of both disk and interface devices. event_idx can be set to
      "on" (to force event_idx on in case qemu has it disabled by default)
      or "off" (for force event_idx off). In the case that event_idx support
      isn't present in qemu, the attribute is ignored (this on the advice of
      the qemu developer).
      
      docs/formatdomain.html.in: document the new flag (marking it as
         "don't mess with this!"
      docs/schemas/domain.rng: add event_idx in appropriate places
      src/conf/domain_conf.[ch]: add event_idx to parser and formatter
      src/libvirt_private.syms: export
         virDomainVirtioEventIdx(From|To)String
      src/qemu/qemu_capabilities.[ch]: detect and report event_idx in
         disk/net
      src/qemu/qemu_command.c: add event_idx parameter to qemu commandline
          when appropriate.
      tests/qemuxml2argvdata/qemuxml2argv-event_idx.args,
      tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml,
      tests/qemuxml2argvtest.c,
      tests/qemuxml2xmltest.c: test cases for event_idx.
      73c0a148
  3. 22 7月, 2011 1 次提交
    • E
      build: rename files.h to virfile.h · 8e22e089
      Eric Blake 提交于
      In preparation for a future patch adding new virFile APIs.
      
      * src/util/files.h, src/util/files.c: Move...
      * src/util/virfile.h, src/util/virfile.c: ...here, and rename
      functions to virFile prefix.  Macro names are intentionally
      left alone.
      * *.c: All '#include "files.h"' uses changed.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
      * src/libvirt_private.syms: Likewise.
      * docs/hacking.html.in: Likewise.
      * HACKING: Regenerate.
      8e22e089
  4. 11 7月, 2011 1 次提交
    • M
      bios: Add support for SGA · 874e65aa
      Michal Privoznik 提交于
      This patch creates new <bios> element which, at this time has only the
      attribute useserial='yes|no'. This attribute allow users to use
      Serial Graphics Adapter and see BIOS messages from the very first moment
      domain boots up. Therefore, users can choose boot medium, set PXE, etc.
      874e65aa
  5. 08 7月, 2011 1 次提交
  6. 22 6月, 2011 1 次提交
    • M
      qemu: domain I/O asynchronous handling · 017abcbb
      Michal Privoznik 提交于
      For virtio disks and interfaces, qemu allows users to enable or disable
      ioeventfd feature. This means, qemu can execute domain code, while
      another thread waits for I/O event. Basically, in some cases it is win,
      in some loss. This feature is available via 'ioeventfd' attribute in disk
      and interface <driver> element. It accepts 'on' and 'off'. Leaving this
      attribute out defaults to hypervisor decision.
      017abcbb
  7. 13 6月, 2011 1 次提交
  8. 24 5月, 2011 2 次提交
  9. 12 5月, 2011 1 次提交
    • L
      libvirt,logging: cleanup VIR_XXX0() · b65f37a4
      Lai Jiangshan 提交于
      These VIR_XXXX0 APIs make us confused, use the non-0-suffix APIs instead.
      
      How do these coversions works? The magic is using the gcc extension of ##.
      When __VA_ARGS__ is empty, "##" will swallow the "," in "fmt," to
      avoid compile error.
      
      example: origin				after CPP
      	high_level_api("%d", a_int)	low_level_api("%d", a_int)
      	high_level_api("a  string")	low_level_api("a  string")
      
      About 400 conversions.
      
      8 special conversions:
      VIR_XXXX0("") -> VIR_XXXX("msg") (avoid empty format) 2 conversions
      VIR_XXXX0(string_literal_with_%) -> VIR_XXXX(%->%%) 0 conversions
      VIR_XXXX0(non_string_literal) -> VIR_XXXX("%s", non_string_literal)
        (for security) 6 conversions
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      b65f37a4
  10. 05 5月, 2011 1 次提交
    • D
      Persist qemu capabilities in the domain status file · 43c01d38
      Daniel P. Berrange 提交于
      To cope with the QEMU binary being changed while a VM is running,
      it is neccessary to persist the original qemu capabilities at the
      time the VM is booted.
      
      * src/qemu/qemu_capabilities.c, src/qemu/qemu_capabilities.h: Add
        an enum for a string rep of every capability
      * src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Support for
        storing capabilities in the domain status XML
      * src/qemu/qemu_process.c: Populate & free QEMU capabilities at
        domain startup
      43c01d38
  11. 05 4月, 2011 1 次提交
    • J
      qemu: Ignore unusable binaries · ef264e82
      Jiri Denemark 提交于
      When initializing qemu guest capabilities, we should ignore qemu
      binaries that we are not able to extract version/help info from since
      they will be unusable for creating domains anyway. Ignoring them is also
      much better than letting initialization of qemu driver fail.
      ef264e82
  12. 25 3月, 2011 1 次提交
    • E
      maint: prohibit access(,X_OK) · 391c397e
      Eric Blake 提交于
      This simplifies several callers that were repeating checks already
      guaranteed by util.c, and makes other callers more robust to now
      reject directories.  remote_driver.c was over-strict - access(,R_OK)
      is only needed to execute a script file; a binary only needs
      access(,X_OK) (besides, it's unusual to see a file with x but not
      r permissions, whether script or binary).
      
      * cfg.mk (sc_prohibit_access_xok): New syntax-check rule.
      (exclude_file_name_regexp--sc_prohibit_access_xok): Exempt one use.
      * src/network/bridge_driver.c (networkStartRadvd): Fix offenders.
      * src/qemu/qemu_capabilities.c (qemuCapsProbeMachineTypes)
      (qemuCapsInitGuest, qemuCapsInit, qemuCapsExtractVersionInfo):
      Likewise.
      * src/remote/remote_driver.c (remoteFindDaemonPath): Likewise.
      * src/uml/uml_driver.c (umlStartVMDaemon): Likewise.
      * src/util/hooks.c (virHookCheck): Likewise.
      391c397e
  13. 06 3月, 2011 1 次提交
    • O
      qemu: Support vram for video of qxl type · 82dfc6f3
      Osier Yang 提交于
      For qemu names the primary vga as "qxl-vga":
      
        1) if vram is specified for 2nd qxl device:
      
          -vga qxl -global qxl-vga.vram_size=$SIZE \
          -device qxl,id=video1,vram_size=$SIZE,...
      
        2) if vram is not specified for 2nd qxl device, (use the default
           set by global):
      
          -vga qxl -global qxl-vga.vram_size=$SIZE \
          -device qxl,id=video1,...
      
      For qemu names all qxl devices as "qxl":
      
        1) if vram is specified for 2nd qxl device:
      
          -vga qxl -global qxl.vram_size=$SIZE \
          -device qxl,id=video1,vram_size=$SIZE ...
      
        2) if vram is not specified for 2nd qxl device:
      
          -vga qxl -global qxl-vga.vram_size=$SIZE \
          -device qxl,id=video1,...
      
      "-global" is the only way to define vram_size for the primary qxl
      device, regardless of how qemu names it, (It's not good a good
      way, as original idea of "-global" is to set a global default for
      a driver property, but to specify vram for first qxl device, we
      have to use it).
      
      For other qxl devices, as they are represented by "-device", could
      specify it directly and seperately for each, and it overrides the
      default set by "-global" if specified.
      
      v1 - v2:
        * modify "virDomainVideoDefaultRAM" so that it returns 16M as the
          default vram_size for qxl device.
      
        * vram_size * 1024 (qemu accepts bytes for vram_size).
      
        * apply default vram_size for qxl device for which vram_size is
          not specified.
      
        * modify "graphics-spice" tests (more sensiable vram_size)
      
        * Add an argument of virDomainDefPtr type for qemuBuildVideoDevStr,
          to use virDomainVideoDefaultRAM in qemuBuildVideoDevStr).
      
      v2 - v3:
        * Modify default video memory size for qxl device from 16M to 24M
      
        * Update codes to be consistent with changes on qemu_capabilities.*
      82dfc6f3
  14. 24 2月, 2011 4 次提交
  15. 18 2月, 2011 1 次提交
    • L
      Add txmode attribute to interface XML for virtio backend · e9bd5c0e
      Laine Stump 提交于
      This is in response to:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=629662
      
      Explanation
      
      qemu's virtio-net-pci driver allows setting the algorithm used for tx
      packets to either "bh" or "timer". This is done by adding ",tx=bh" or
      ",tx=timer" to the "-device virtio-net-pci" commandline option.
      
      'bh' stands for 'bottom half'; when this is set, packet tx is all done
      in an iothread in the bottom half of the driver. (In libvirt, this
      option is called the more descriptive "iothread".)
      
      'timer' means that tx work is done in qemu, and if there is more tx
      data than can be sent at the present time, a timer is set before qemu
      moves on to do other things; when the timer fires, another attempt is
      made to send more data. (libvirt retains the name "timer" for this
      option.)
      
      The resulting difference, according to the qemu developer who added
      the option is:
      
          bh makes tx more asynchronous and reduces latency, but potentially
          causes more processor bandwidth contention since the cpu doing the
          tx isn't necessarily the cpu where the guest generated the
          packets.
      
      Solution
      
      This patch provides a libvirt domain xml knob to change the option on
      the qemu commandline, by adding a new attribute "txmode" to the
      <driver> element that can be placed inside any <interface> element in
      a domain definition. It's use would be something like this:
      
          <interface ...>
            ...
            <model type='virtio'/>
            <driver txmode='iothread'/>
            ...
          </interface>
      
      I chose to put this setting as an attribute to <driver> rather than as
      a sub-element to <tune> because it is specific to the virtio-net
      driver, not something that is generally usable by all network drivers.
      (note that this is the same placement as the "driver name=..."
      attribute used to choose kernel vs. userland backend for the
      virtio-net driver.)
      
      Actually adding the tx=xxx option to the qemu commandline is only done
      if the version of qemu being used advertises it in the output of
      
          qemu -device virtio-net-pci,?
      
      If a particular txmode is requested in the XML, and the option isn't
      listed in that help output, an UNSUPPORTED_CONFIG error is logged, and
      the domain fails to start.
      e9bd5c0e
  16. 15 2月, 2011 1 次提交
  17. 11 2月, 2011 1 次提交
    • W
      qemu: fix attach-interface regression · 6bf4788e
      Wen Congyang 提交于
      QEMUD_CMD_FLAG_PCI_MULTIBUS should be set in the function
      qemuCapsExtractVersionInfo()
      
      The flag QEMUD_CMD_FLAG_PCI_MULTIBUS is used in the function
      qemuBuildDeviceAddressStr(). All callers get qemuCmdFlags
      by the function qemuCapsExtractVersionInfo() except that
      testCompareXMLToArgvFiles() in qemuxml2argvtest.c.
      
      So we should set QEMUD_CMD_FLAG_PCI_MULTIBUS in the function
      qemuCapsExtractVersionInfo() instead of qemuBuildCommandLine()
      because the function qemuBuildCommandLine() does not be called
      when we attach a pci device.
      
      tests: set QEMUD_CMD_FLAG_PCI_MULTIBUS in testCompareXMLToArgvFiles()
      
      set QEMUD_CMD_FLAG_PCI_MULTIBUS before calling qemuBuildCommandLine()
      as the flags is not set by qemuCapsExtractVersionInfo().
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      6bf4788e
  18. 10 2月, 2011 1 次提交
    • D
      Add check for binary existing in machine type probe · bf6a3825
      Daniel P. Berrange 提交于
      When probing machine types if the QEMU binary does not exist
      we get a hard to diagnose error, due to the execve() in the
      child failing
      
      error: internal error Child process exited with status 1.
      
      Add an explicit check so that we get
      
      error: Cannot find QEMU binary /usr/libexec/qem3u-kvm: No such file or directory
      
      * src/qemu/qemu_capabilities.c: Check for QEMU binary
      bf6a3825
  19. 05 2月, 2011 1 次提交
    • E
      spicevmc: support older -device spicevmc of qemu 0.13.0 · 5a3ec56b
      Eric Blake 提交于
      qemu 0.13.0 (at least as built for Fedora 14, and also backported to
      RHEL 6.0 qemu) supported an older syntax for a spicevmc channel; it's
      not as flexible (it has an implicit name and hides the chardev
      aspect), but now that we support spicevmc, we might as well target
      both variants.
      
      * src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_DEVICE_SPICEVMC):
      New flag.
      * src/qemu/qemu_capabilities.c (qemuCapsParseDeviceStr): Set it
      correctly.
      * src/qemu/qemu_command.h (qemuBuildVirtioSerialPortDevStr): Drop
      declaration.
      * src/qemu/qemu_command.c (qemuBuildVirtioSerialPortDevStr): Alter
      signature, check flag.
      (qemuBuildCommandLine): Adjust caller and check flag.
      * tests/qemuhelptest.c (mymain): Update test.
      * tests/qemuxml2argvtest.c (mymain): New test.
      * tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc-old.xml:
      New file.
      * tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc-old.args:
      Likewise.
      5a3ec56b
  20. 04 2月, 2011 2 次提交
    • E
      smartcard: check for qemu capability · 7a2f29e4
      Eric Blake 提交于
      Qemu smartcard/spicevmc support exists on branches (such as
      http://cgit.freedesktop.org/~alon/qemu/commit/?h=usb_ccid.v15&id=024a37b)
      but is not yet upstream.  The added -help output matches a scratch build
      that will be close to the RHEL 6.1 qemu-kvm.
      
      * src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_CCID_EMULATED)
      (QEMUD_CMD_FLAG_CCID_PASSTHRU, QEMUD_CMD_FLAG_CHARDEV_SPICEVMC):
      New flags.
      * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags)
      (qemuCapsParseDeviceStr): Check for smartcard capabilities.
      (qemuCapsExtractVersionInfo): Tweak comment.
      * tests/qemuhelptest.c (mymain): New test.
      * tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel61: New file.
      * tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel61-device: Likewise.
      7a2f29e4
    • J
      qemu: Support booting from hostdev PCI devices · 963a9460
      Jiri Denemark 提交于
      963a9460
  21. 29 1月, 2011 1 次提交
  22. 25 1月, 2011 1 次提交
    • C
      qemu: sound: Support intel 'ich6' model · 6cabc0b0
      Cole Robinson 提交于
      In QEMU, the card itself is a PCI device, but it requires a codec
      (either -device hda-output or -device hda-duplex) to actually output
      sound. Specifying <sound model='ich6'/> gives us -device intel-hda
      -device hda-duplex I think it's important that a simple <sound model='ich6'/>
      sets up a useful codec, to have consistent behavior with all other sound cards.
      
      This is basically Dan's proposal of
      
          <sound model='ich6'>
              <codec type='output' slot='0'/>
              <codec type='duplex' slot='3'/>
          </sound>
      
      without the codec bits implemented.
      
      The important thing is to keep a consistent API here, we don't want some
      <sound> devs require tweaking codecs but not others. Steps I see to
      accomplishing this:
      
          - every <sound> device has a <codec type='default'/> (unless codecs are
              manually specified)
          - <codec type='none'/> is required to specify 'no codecs'
          - new audio settings like mic=on|off could then be exposed in
              <sound> or <codec> in a consistent manner for all sound models
      
      v2:
          Use model='ich6'
      
      v3:
          Use feature detection, from eblake
          Set codec id, bus, and cad values
      
      v4:
          intel-hda isn't supported if -device isn't available
      
      v5:
          Comment spelling fixes
      6cabc0b0
  23. 19 1月, 2011 1 次提交
    • E
      qemu: don't fail capabilities check on 0.12.x · 93681a36
      Eric Blake 提交于
      Fixes regression introduced in commit 22115181, where all qemu 0.12.x
      fails to start, as does qemu 0.13.x lacking the pci-assign device.
      Prior to 22115181, the code was just ignoring a non-zero exit status
      from the qemu child, but the virCommand code checked this to avoid
      masking any other issues, which means the real bug of provoking
      non-zero exit status has been latent for a longer time.
      
      * src/qemu/qemu_capabilities.c (qemuCapsExtractVersionInfo): Check
      for -device driver,? support.
      (qemuCapsExtractDeviceStr): Avoid failure if all probed devices
      are unsupported.
      Reported by Ken Congyang.
      93681a36
  24. 18 1月, 2011 1 次提交
  25. 14 1月, 2011 2 次提交
    • E
      qemu: improve device flag parsing · f892f5a5
      Eric Blake 提交于
      * src/qemu/qemu_capabilities.h (qemuCapsParseDeviceStr): New
      prototype.
      * src/qemu/qemu_capabilities.c (qemuCapsParsePCIDeviceStrs)
      Rename and split...
      (qemuCapsExtractDeviceStr, qemuCapsParseDeviceStr): ...to make it
      easier to add and test device-specific checks.
      (qemuCapsExtractVersionInfo): Update caller.
      * tests/qemuhelptest.c (testHelpStrParsing): Also test parsing of
      device-related flags.
      (mymain): Update expected flags.
      * tests/qemuhelpdata/qemu-0.12.1-device: New file.
      * tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel60-device: New file.
      * tests/qemuhelpdata/qemu-kvm-0.12.3-device: New file.
      * tests/qemuhelpdata/qemu-kvm-0.13.0-device: New file.
      f892f5a5
    • E
      qemu: convert capabilities to use virCommand · 22115181
      Eric Blake 提交于
      * src/qemu/qemu_capabilities.c (qemuCapsProbeMachineTypes)
      (qemuCapsProbeCPUModels, qemuCapsParsePCIDeviceStrs)
      (qemuCapsExtractVersionInfo): Use virCommand rather than virExec.
      22115181
  26. 24 12月, 2010 1 次提交
    • E
      qemu: add -incoming fd:n capability checking · abff0290
      Eric Blake 提交于
      * src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_MIGRATE_QEMU_FD):
      New enum value.
      * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Populate
      flags according to qemu version.
      * tests/qemuhelptest.c (mymain): Adjust test.
      abff0290
  27. 17 12月, 2010 1 次提交
    • D
      Move QEMU capabilities management into a separate file · d8ae147d
      Daniel P. Berrange 提交于
      The qemu_conf.c code is doing three jobs, driver config file
      loading, QEMU capabilities management and QEMU command line
      management. Move the capabilities code into its own file
      
      * src/qemu/qemu_capabilities.c, src/qemu/qemu_capabilities.h: New
        capabilities management code
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Delete capabilities
        code
      * src/qemu/qemu_conf.h: Adapt for API renames
      * src/Makefile.am: add src/qemu/qemu_capabilities.c
      d8ae147d