1. 18 1月, 2012 1 次提交
    • D
      Add new attribute wrpolicy to <driver> element · d9e0d820
      Deepak C Shetty 提交于
      This introduces new attribute wrpolicy with only supported
      value as immediate. This will be an optional
      attribute with no defaults. This helps specify whether
      to skip the host page cache.
      
      When wrpolicy is specified, meaning when wrpolicy=immediate
      a writeback is explicitly initiated for the dirty pages in
      the host page cache as part of the guest file write operation.
      
      Usage:
      <filesystem type='mount' accessmode='passthrough'>
        <driver type='path' wrpolicy='immediate'/>
        <source dir='/export/to/guest'/>
        <target dir='mount_tag'/>
      </filesystem>
      
      Currently this only works with type='mount' for the QEMU/KVM driver.
      Signed-off-by: NDeepak C Shetty <deepakcs@linux.vnet.ibm.com>
      d9e0d820
  2. 17 1月, 2012 1 次提交
  3. 13 1月, 2012 1 次提交
    • O
      qemu: Support copy on read for disk · 5edfcaae
      Osier Yang 提交于
      The new introduced optional attribute "copy_on_read</code> controls
      whether to copy read backing file into the image file. The value can
      be either "on" or "off". Copy-on-read avoids accessing the same backing
      file sectors repeatedly and is useful when the backing file is over a
      slow network. By default copy-on-read is off.
      5edfcaae
  4. 09 1月, 2012 1 次提交
    • L
      qemu: add capabilities flags related to SG_IO · e8daeeb1
      Laine Stump 提交于
      This patch adds two capabilities flags to deal with various aspects
      of supporting SG_IO commands on virtio-blk-pci devices:
      
        QEMU_CAPS_VIRTIO_BLK_SCSI
          set if -device virtio-blk-pci accepts the scsi="on|off" option
          When present, this is on by default, but can be set to off to disable
          SG_IO functions.
      
        QEMU_CAPS_VIRTIO_BLK_SG_IO
          set if SG_IO commands are supported in the virtio-blk-pci driver
          (present since qemu 0.11 according to a qemu developer, if I
           understood correctly)
      e8daeeb1
  5. 22 12月, 2011 1 次提交
  6. 21 12月, 2011 1 次提交
    • M
      qemu: Add a capability flag for -no-acpi · 5abbe04d
      Michael Ellerman 提交于
      Currently non-x86 guests must have <acpi/> defined in <features> to
      prevent libvirt from running qemu with -no-acpi. Although it works, it
      is a hack.
      
      Instead add a capability flag which indicates whether qemu understands
      the -no-acpi option. Use it to control whether libvirt emits -no-acpi.
      
      Current versions of qemu always display -no-acpi in their help output,
      so this patch has no effect. However the development version of qemu
      has been modified such that -no-acpi is only displayed when it is
      actually supported.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      5abbe04d
  7. 10 12月, 2011 1 次提交
    • S
      fix error when parsing ppc64 models on x86 host · 84f56333
      Stefan Berger 提交于
      When parsing ppc64 models on an x86 host an out-of-memory error message is displayed due
      to it checking for retcpus being NULL. Fix this by removing the check whether retcpus is NULL
      since we will realloc into this variable.
      Also in the X86 model parser display the OOM error at the location where it happens.
      84f56333
  8. 08 12月, 2011 1 次提交
  9. 05 12月, 2011 1 次提交
  10. 30 11月, 2011 3 次提交
    • D
      Remove powerMgmt_valid field from capabilities struct · f1f28611
      Daniel P. Berrange 提交于
      If we ensure that virNodeSuspendGetTargetMask always resets
      *bitmask to zero upon failure, there is no need for the
      powerMgmt_valid field.
      
      * src/util/virnodesuspend.c: Ensure *bitmask is zero upon
        failure
      * src/conf/capabilities.c, src/conf/capabilities.h: Remove
        powerMgmt_valid field
      * src/qemu/qemu_capabilities.c: Remove powerMgmt_valid
      f1f28611
    • D
      Move suspend capabilities APIs out of util.h into virnodesuspend.c · c92653f4
      Daniel P. Berrange 提交于
      The node suspend capabilities APIs should not have been put into
      util.[ch]. Instead move them into virnodesuspend.[ch]
      
      * src/util/util.c, src/util/util.h: Remove suspend capabilities APIs
      * src/util/virnodesuspend.c, src/util/virnodesuspend.h: Add
        suspend capabilities APIs
      * src/qemu/qemu_capabilities.c: Include virnodesuspend.h
      c92653f4
    • D
      Rename suspend capabilities APIs · 53c2aad8
      Daniel P. Berrange 提交于
      Rename virGetPMCapabilities to virNodeSuspendGetTargetMask and
      virDiscoverHostPMFeature to virNodeSuspendSupportsTarget.
      
      * src/util/util.c, src/util/util.h: Rename APIs
      * src/qemu/qemu_capabilities.c, src/util/virnodesuspend.c: Adjust
        for new names
      53c2aad8
  11. 22 11月, 2011 1 次提交
    • S
      Export KVM Host Power Management capabilities · e352b164
      Srivatsa S. Bhat 提交于
      This patch exports KVM Host Power Management capabilities as XML so that
      higher-level systems management software can make use of these features
      available in the host.
      
      The script "pm-is-supported" (from pm-utils package) is run to discover if
      Suspend-to-RAM (S3) or Suspend-to-Disk (S4) is supported by the host.
      If either of them are supported, then a new tag "<power_management>" is
      introduced in the XML under the <host> tag.
      
      However in case the query to check for power management features succeeded,
      but the host does not support any such feature, then the XML will contain
      an empty <power_management/> tag. In the event that the PM query itself
      failed, the XML will not contain any "power_management" tag.
      
      To use this, new APIs could be implemented in libvirt to exploit power
      management features such as S3/S4.
      e352b164
  12. 03 11月, 2011 1 次提交
    • D
      Fix default console type setting · 209c2880
      Daniel P. Berrange 提交于
      The default console type may vary based on the OS type. ie a Xen
      paravirt guests wants a 'xen' console, while a fullvirt guests
      wants a 'serial' console.
      
      A plain integer default console type in the capabilities does
      not suffice. Instead introduce a callback that is passed the
      OS type.
      
      * src/conf/capabilities.h: Use a callback for default console
        type
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Use callback
        for default console type. Add missing LXC/OpenVZ console types.
      * src/esx/esx_driver.c, src/libxl/libxl_conf.c,
        src/lxc/lxc_conf.c, src/openvz/openvz_conf.c,
        src/phyp/phyp_driver.c, src/qemu/qemu_capabilities.c,
        src/uml/uml_conf.c, src/vbox/vbox_tmpl.c,
        src/vmware/vmware_conf.c, src/xen/xen_hypervisor.c,
        src/xenapi/xenapi_driver.c: Set default console type callback
      209c2880
  13. 27 10月, 2011 1 次提交
    • E
      qemu: simplify use of HAVE_YAJL · 6889f33e
      Eric Blake 提交于
      Rather than making all clients of monitor commands that are JSON-only
      check whether yajl support was compiled in, it is simpler to just
      avoid setting the capability bit up front if we can't use the capability.
      
      * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Only set
      capability bit if we also have yajl library to use it.
      * src/qemu/qemu_driver.c (qemuDomainReboot): Drop #ifdefs.
      * src/qemu/qemu_process.c (qemuProcessStart): Likewise.
      * tests/qemuhelptest.c (testHelpStrParsing): Pass test even
      without yajl.
      * tests/qemuxml2argvtest.c (mymain): Simplify use of json flag.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-*.args:
      Update expected results to match.
      6889f33e
  14. 18 10月, 2011 1 次提交
    • J
      Add AHCI support to qemu driver · c1bc3d89
      Jim Fehlig 提交于
      Tested with multiple AHCI controllers and multiple disks attached
      to a controller. E.g.,
      
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/test/disk0.raw'/>
            <target dev='sda' bus='sata'/>
            <address type='drive' controller='0' bus='0' unit='0'/>
          </disk>
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/test/disk1.raw'/>
            <target dev='sdb' bus='sata'/>
            <address type='drive' controller='0' bus='0' unit='1'/>
          </disk>
          <disk type='file' device='disk'>
            <driver name='qemu' type='raw'/>
            <source file='/var/lib/libvirt/images/test/disk2.raw'/>
            <target dev='sdc' bus='sata'/>
            <address type='drive' controller='1' bus='0' unit='0'/>
          </disk>
          <controller type='sata' index='0'>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
          </controller>
          <controller type='sata' index='1'>
            <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
          </controller>
      c1bc3d89
  15. 17 10月, 2011 1 次提交
  16. 07 10月, 2011 1 次提交
    • E
      qemu: enable multifunction for older qemu · 8644a379
      Eric Blake 提交于
      Now that RHEL 6.2 Beta is out, it would be nice to test multifunction
      devices on that platform.  This changes things so that the multifunction
      cap bit can be set in two different ways: by version comparison (needed
      for qemu 0.13 which lacked a -device query), and by -device query
      (provided by qemu.git and backported to the RHEL beta build of
      qemu-kvm which still claims to be a modified 0.12, and therefore needed
      for RHEL).
      
      * src/qemu/qemu_capabilities.c (qemuCapsParseDeviceStr): Allow
      second method of setting multifunction cap bit.
      * tests/qemuhelptest.c (mymain): Test it.
      * tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta: New file.
      * tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device: Likewise.
      8644a379
  17. 27 9月, 2011 2 次提交
    • L
      qemu: add ability to set PCI device "rombar" on or off · dc79852a
      Laine Stump 提交于
      This patch was made in response to:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=738095
      
      In short, qemu's default for the rombar setting (which makes the
      firmware ROM of a PCI device visible/not on the guest) was previously
      0 (not visible), but they recently changed the default to 1
      (visible). Unfortunately, there are some PCI devices that fail in the
      guest when rombar is 1, so the setting must be exposed in libvirt to
      prevent a regression in behavior (it will still require explicitly
      setting <rom bar='off'/> in the guest XML).
      
      rombar is forced on/off by adding:
      
        <rom bar='on|off'/>
      
      inside a <hostdev> element that defines a PCI device. It is currently
      ignored for all other types of devices.
      
      At the moment there is no clean method to determine whether or not the
      rombar option is supported by QEMU - this patch uses the advice of a
      QEMU developer to assume support for qemu-0.12+. There is currently a
      patch in the works to put this information in the output of "qemu-kvm
      -device pci-assign,?", but of course if we switch to keying off that,
      we would lose support for setting rombar on all the versions of qemu
      between 0.12 and whatever version gets that patch.
      dc79852a
    • J
      qemu: Relax -no-shutdown check to [0.14.0, 0.15.50) · 75e31492
      Jiri Denemark 提交于
      SIGTERM handling for -no-shutdown is already fixed in qemu git and
      libvirt can safely use it. The downside is that 0.15.50 version of qemu
      can be any qemu compiled from git, even that without the fix for
      SIGTERM. However, I think this patch is worth it since excluding 0.15.50
      from the check makes testing current qemu with libvirt much easier and
      someone running qemu from git should be able to rebuild fixed qemu from
      git if they hit the problem with a hang on shutdown.
      75e31492
  18. 23 9月, 2011 1 次提交
    • O
      Add unsafe cache mode support for disk driver · f887334d
      Oskari Saarenmaa 提交于
      QEMU 0.13 introduced cache=unsafe for -drive, this patch exposes
      it in the libvirt layer.
      
        * Introduced a new QEMU capability flag ($prefix_CACHE_UNSAFE),
          as even if $prefix_CACHE_V2 is set, we can't know if unsafe
          is supported.
      
        * Improved the reliability of qemu cache type detection.
      f887334d
  19. 21 9月, 2011 1 次提交
    • J
      qemu: Fix shutdown regression with buggy qemu · f84aedad
      Jiri Denemark 提交于
      The commit that prevents disk corruption on domain shutdown
      (96fc4784) causes regression with QEMU
      0.14.* and 0.15.* because of a regression bug in QEMU that was fixed
      only recently in QEMU git. The affected versions of QEMU do not quit on
      SIGTERM if started with -no-shutdown, which we use to implement fake
      reboot. Since -no-shutdown tells QEMU not to quit automatically on guest
      shutdown, domains started using the affected QEMU cannot be shutdown
      properly and stay in a paused state.
      
      This patch disables fake reboot feature on such QEMU by not using
      -no-shutdown, which makes shutdown work as expected. However,
      virDomainReboot will not work in this case and it will report "Requested
      operation is not valid: Reboot is not supported with this QEMU binary".
      f84aedad
  20. 02 9月, 2011 3 次提交
  21. 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
  22. 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
  23. 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
  24. 08 7月, 2011 1 次提交
  25. 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
  26. 13 6月, 2011 1 次提交
  27. 24 5月, 2011 2 次提交
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 24 2月, 2011 2 次提交