1. 06 8月, 2012 1 次提交
  2. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  3. 21 7月, 2012 1 次提交
    • D
      Only enforce check for YAJL when starting a VM · 33998759
      Daniel P. Berrange 提交于
      The previous check for YAJL would have many undesirable
      consequences, the most important being that it caused the
      capabilities XML to lose all <guest> elements. There is
      no user visible feedback as to what is wrong in this respect,
      merely a syslog message. The empty capabilities causes
      libvirtd to then throw away all guest XML configs that are
      stored.
      
      This changes the code so that the check for YAJL is only
      performed at the time we attempt to spawn a QEMU process
      
      error: Failed to start domain vm-vnc
      error: unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      33998759
  4. 14 7月, 2012 1 次提交
    • D
      Wire up handling for QMP's BALLOON_EVENT · 1d9d5103
      Daniel P. Berrange 提交于
      If QEMU supports the BALLOON_EVENT QMP event, then we can
      avoid invoking 'query-balloon' when returning XML or the
      domain info.
      
      * src/qemu/qemu_capabilities.c, src/qemu/qemu_capabilities.h:
        Add QEMU_CAPS_BALLOON_EVENT
      * src/qemu/qemu_driver.c: Skip query-balloon in
        qemudDomainGetInfo and qemuDomainGetXMLDesc if we have
        QEMU_CAPS_BALLOON_EVENT set
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Check
        for BALLOON_EVENT at connect to monitor. Add callback
        for balloon change notifications
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h:
        Add handling of BALLOON_EVENT and impl 'query-events'
        check
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1d9d5103
  5. 11 7月, 2012 1 次提交
  6. 21 6月, 2012 1 次提交
  7. 15 6月, 2012 1 次提交
  8. 18 5月, 2012 1 次提交
  9. 16 5月, 2012 1 次提交
    • J
      qemu: Add support for -no-user-config · 63b42436
      Jiri Denemark 提交于
      Thanks to this new option we are now able to use modern CPU models (such
      as Westmere) defined in external configuration file.
      
      The qemu-1.1{,-device} data files for qemuhelptest are filled in with
      qemu-1.1-rc2 output for now. I will update those files with real
      qemu-1.1 output once it is released.
      63b42436
  10. 27 4月, 2012 1 次提交
  11. 17 4月, 2012 2 次提交
    • O
      qemu: Split ide-drive into ide-cd and ide-hd · a4cda054
      Osier Yang 提交于
      A "ide-drive" device can be either a hard disk or a CD-ROM,
      if there is ",media=cdrom" specified for the backend, it's
      a CD-ROM, otherwise it's a hard disk.
      
      Upstream qemu splitted "ide-drive" into "ide-hd" and "ide-cd"
      since commit 1f56e32, and ",media=cdrom" is not required for
      ide-cd anymore. "ide-drive" is still supported for backwards
      compatibility, but no doubt we should go foward.
      a4cda054
    • O
      qemu: Split scsi-disk into into scsi-hd and scsi-cd · 02e8d0cf
      Osier Yang 提交于
      A "scsi-disk" device can be either a hard disk or a CD-ROM,
      if there is ",media=cdrom" specified for the backend, it's
      a CD-ROM, otherwise it's a hard disk.
      
      But upstream qemu splitted "scsi-disk" into "scsi-hd" and
      "scsi-cd" since commit b443ae, and ",media=cdrom" is not
      required for scsi-cd anymore. "scsi-disk" is still supported
      for backwards compatibility, but no doubt we should go
      foward.
      02e8d0cf
  12. 12 4月, 2012 1 次提交
    • E
      blockjob: add qemu capabilities related to block pull jobs · 2b085f5b
      Eric Blake 提交于
      RHEL 6.2 was released with an early version of block jobs, which only
      worked on the qed file format, where the commands were spelled with
      underscore (contrary to QMP style), and where 'block_job_cancel' was
      synchronous and did not trigger an event.
      
      The upcoming qemu 1.1 release has fixed these short-comings [1][2]:
      the commands now work on multiple file types, are spelled with dash,
      and 'block-job-cancel' is asynchronous and emits an event upon conclusion.
      
      [1]qemu commit 370521a1d6f5537ea7271c119f3fbb7b0fa57063
      [2]https://lists.gnu.org/archive/html/qemu-devel/2012-04/msg01248.html
      
      This patch recognizes the new spellings, and fixes virDomainBlockRebase
      to give a graceful error when talking to a too-old qemu on a partial
      rebase attempt.  Fixes for the new semantics will come later.  This
      patch also removes a bogus ATTRIBUTE_NONNULL mistakenly added in
      commit 10ec36e2.
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_BLOCKJOB_SYNC)
      (QEMU_CAPS_BLOCKJOB_ASYNC): New bits.
      * src/qemu/qemu_capabilities.c (qemuCaps): Name them.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONCheckCommands): Set
      them.
      (qemuMonitorJSONBlockJob): Manage both command names.
      (qemuMonitorJSONDiskSnapshot): Minor formatting fix.
      * src/qemu/qemu_monitor.h (qemuMonitorBlockJob): Alter signature.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockJob): Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Pass through
      capability bit.
      * src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Update callers.
      2b085f5b
  13. 24 3月, 2012 1 次提交
    • E
      snapshot: add qemu capability for 'transaction' command · 311357d9
      Eric Blake 提交于
      We need a capability bit to gracefully error out if some of the
      additions in future patches can't be implemented by the running qemu.
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_TRANSACTION): New cap.
      * src/qemu/qemu_capabilities.c (qemuCaps): Name it.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONCheckCommands): Set
      it.
      311357d9
  14. 14 3月, 2012 1 次提交
  15. 28 2月, 2012 1 次提交
  16. 15 2月, 2012 1 次提交
  17. 27 1月, 2012 1 次提交
    • E
      qemu: require qmp on new enough qemu · 6e769eba
      Eric Blake 提交于
      The qemu developers have made it clear that modern qemu will no
      longer guarantee human monitor command stability; furthermore,
      some features, such as async events, are only supported via qmp.
      If we are compiled without support for handling JSON, we cannot
      expect to sanely interact with modern qemu.
      
      However, things must continue to build on RHEL 5, where qemu
      is stuck at 0.10, and where yajl is not available.
      
      Another benefit of this patch: future additions of new monitor
      commands need only focus on qemu_monitor_json.c, instead of
      also wasting time with qemu_monitor_text.c.
      
      * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Report
      error if yajl is missing but qemu requires qmp.
      (qemuCapsParseHelpStr): Propagate error.
      (qemuCapsExtractVersionInfo): Update caller.
      * tests/qemuhelptest.c (testHelpStrParsing): Likewise.
      6e769eba
  18. 21 1月, 2012 1 次提交
  19. 19 1月, 2012 1 次提交
    • M
      Added capability checking for block <iotune> setting. · 4c82f09e
      Martin Kletzander 提交于
      There was missing capability for blkiotune and thus specifying these
      settings caused libvirt to run qemu with invalid parameters and then
      reporting qemu error instead of the standard libvirt one. The support
      for blkiotune setting was added in upstream qemu repo under commit
      0563e191516289c9d2f282a8c50f2eecef2fa773.
      4c82f09e
  20. 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
  21. 17 1月, 2012 1 次提交
  22. 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
  23. 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
  24. 22 12月, 2011 1 次提交
  25. 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
  26. 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
  27. 27 9月, 2011 1 次提交
    • 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
  28. 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
  29. 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
  30. 02 9月, 2011 3 次提交
  31. 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
  32. 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
  33. 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
  34. 13 6月, 2011 1 次提交
  35. 24 5月, 2011 1 次提交
  36. 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
  37. 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