1. 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
  2. 02 12月, 2011 1 次提交
    • E
      build: properly skip tests · da8061ee
      Eric Blake 提交于
      I got this failure on FreeBSD:
      
      shunloadtest.c: In function 'main':
      shunloadtest.c:150: error: 'EXIT_AM_SKIP' undeclared (first use in this function)
      
      but inspection showed several other problems, all fixed here.
      
      * tests/domainsnapshotxml2xmltest.c [!WITH_QEMU]: Ensure
      EXIT_AM_SKIP is defined.
      * tests/esxutilstest.c [!WITH_ESX]: Likewise.
      * tests/openvzutilstest.c [!WITH_OPENVZ]: Likewise.
      * tests/qemuargv2xmltest.c [!WITH_QEMU]: Likewise.
      * tests/qemuhelptest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxml2argvtest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxml2xmltest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxmlnstest.c [!WITH_QEMU]: Likewise.
      * tests/shunloadtest.c [!linux]: Likewise.
      * tests/vmx2xmltest.c [!WITH_VMX]: Likewise.
      * tests/xml2vmxtest.c [!WITH_VMX]: Likewise.
      da8061ee
  3. 01 12月, 2011 1 次提交
  4. 30 11月, 2011 1 次提交
  5. 19 11月, 2011 1 次提交
    • D
      Rename Macvtap management APIs · 43925db7
      Daniel P. Berrange 提交于
      In preparation for code re-organization, rename the Macvtap
      management APIs to have the following patterns
      
        virNetDevMacVLanXXXXX     - macvlan/macvtap interface management
        virNetDevVPortProfileXXXX - virtual port profile management
      
      * src/util/macvtap.c, src/util/macvtap.h: Rename APIs
      * src/conf/domain_conf.c, src/network/bridge_driver.c,
        src/qemu/qemu_command.c, src/qemu/qemu_command.h,
        src/qemu/qemu_driver.c, src/qemu/qemu_hotplug.c,
        src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
        src/qemu/qemu_process.h: Update for renamed APIs
      43925db7
  6. 18 11月, 2011 1 次提交
  7. 16 11月, 2011 1 次提交
    • S
      qemu/rbd: improve rbd device specification · 5745dc12
      Sage Weil 提交于
      This improves the support for qemu rbd devices by adding support for a few
      key features (e.g., authentication) and cleaning up the way in which
      rbd configuration options are passed to qemu.
      
      An <auth> member of the disk source xml specifies how librbd should
      authenticate. The username attribute is the Ceph/RBD user to authenticate as.
      The usage or uuid attributes specify which secret to use. Usage is an
      arbitrary identifier local to libvirt.
      
      The old RBD support relied on setting an environment variable to
      communicate information to qemu/librbd.  Instead, pass those options
      explicitly to qemu.  Update the qemu argument parsing and tests
      accordingly.
      Signed-off-by: NSage Weil <sage@newdream.net>
      Signed-off-by: NJosh Durgin <josh.durgin@dreamhost.com>
      5745dc12
  8. 03 11月, 2011 1 次提交
    • D
      Allow multiple consoles per virtual guest · 0873b688
      Daniel P. Berrange 提交于
      While Xen only has a single paravirt console, UML, and
      QEMU both support multiple paravirt consoles. The LXC
      driver can also be trivially made to support multiple
      consoles. This patch extends the XML to allow multiple
      <console> elements in the XML. It also makes the UML
      and QEMU drivers support this config.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Allow
        multiple <console> devices
      * src/lxc/lxc_driver.c, src/xen/xen_driver.c,
        src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c: Update for
        internal API changes
      * src/security/security_selinux.c, src/security/virt-aa-helper.c:
        Only label consoles that aren't a copy of the serial device
      * src/qemu/qemu_command.c, src/qemu/qemu_driver.c,
        src/qemu/qemu_process.c, src/uml/uml_conf.c,
        src/uml/uml_driver.c: Support multiple console devices
      * tests/qemuxml2xmltest.c, tests/qemuxml2argvtest.c: Extra
        tests for multiple virtio consoles. Set QEMU_CAPS_CHARDEV
        for all console /channel tests
      * tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.args,
        tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args
        tests/qemuxml2argvdata/qemuxml2argv-console-virtio.args: Update
        for correct chardev syntax
      * tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.args,
        tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml: New
        test file
      0873b688
  9. 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
  10. 25 10月, 2011 1 次提交
  11. 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
  12. 07 10月, 2011 2 次提交
    • L
      qemu: add separate rerror_policy for disk errors · 4bb4109f
      Laine Stump 提交于
      Previously libvirt's disk device XML only had a single attribute,
      error_policy, to control both read and write error policy, but qemu
      has separate options for controlling read and write. In one case
      (enospc) a policy is allowed for write errors but not read errors.
      
      This patch adds a separate attribute that sets only the read error
      policy. If just error_policy is set, it will apply to both read and
      write error policy (previous behavior), but if the new rerror_policy
      attribute is set, it will override error_policy for read errors only.
      Possible values for rerror_policy are "stop", "report", and "ignore"
      ("report" is the qemu-controlled default for rerror_policy when
      error_policy isn't specified).
      
      For consistency, the value "report" has been added to the possible
      values for error_policy as well.
      4bb4109f
    • L
      qemu: leave rerror policy at default when enospace is requested · 91195b43
      Laine Stump 提交于
      commit 12062abb set rerror=ignore when error_policy="enospace" was
      selected (since the rerror option in qemu doesn't accept "enospc", as
      the werror option does).
      
      After that patch was already pushed, Paolo Bonzini noticed it and
      commented that leaving rerror at the default ("report") would be a
      better choice. This patch corrects the problem - if error_policy =
      "enospace" is given, rerror is left off the qemu commandline,
      effectively setting it to "report". For other values, rerror is still
      set to match werror.
      
      Additionally, the parsing of error_policy was changed to no longer
      erroneously allow "default" as a choice - as with most other
      attributes, if you want the default setting, just don't specify an
      error_policy.
      
      Finally, two ommissions in the first patch were corrected - a
      long-dormant qemuxml2argv test for enospace was enabled, and fixed to
      pass, and the argv2xml parser in qemu_command.c was updated to
      recognize the different spelling on the qemu commandline.
      91195b43
  13. 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
  14. 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
  15. 05 9月, 2011 2 次提交
  16. 02 9月, 2011 10 次提交
  17. 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
  18. 12 7月, 2011 1 次提交
    • M
      Add domain type checking · aa14709a
      Matthias Bolte 提交于
      The drivers were accepting domain configs without checking if those
      were actually meant for them. For example the LXC driver happily
      accepts configs with type QEMU.
      
      Add a check for the expected domain types to the virDomainDefParse*
      functions.
      aa14709a
  19. 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
  20. 09 7月, 2011 1 次提交
  21. 24 6月, 2011 1 次提交
    • D
      Support reboots with the QEMU driver · 42f43592
      Daniel P. Berrange 提交于
      For controlled shutdown we issue a 'system_powerdown' command
      to the QEMU monitor. This triggers an ACPI event which (most)
      guest OS wire up to a controlled shutdown. There is no equiv
      ACPI event to trigger a controlled reboot. This patch attempts
      to fake a reboot.
      
       - In qemuDomainObjPrivatePtr we have a bool fakeReboot
         flag.
       - The virDomainReboot method sets this flag and then
         triggers a normal 'system_powerdown'.
       - The QEMU process is started with '-no-shutdown'
         so that the guest CPUs pause when it powers off the
         guest
       - When we receive the 'POWEROFF' event from QEMU JSON
         monitor if fakeReboot is not set we invoke the
         qemuProcessKill command and shutdown continues
         normally
       - If fakeReboot was set, we spawn a background thread
         which issues 'system_reset' to perform a warm reboot
         of the guest hardware. Then it issues 'cont' to
         start the CPUs again
      
      * src/qemu/qemu_command.c: Add -no-shutdown flag if
        we have JSON support
      * src/qemu/qemu_domain.h: Add 'fakeReboot' flag to
        qemuDomainObjPrivate struct
      * src/qemu/qemu_driver.c: Fake reboot using the
        system_powerdown command if JSON support is available
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        binding for system_reset command
      * src/qemu/qemu_process.c: Reset the guest & start CPUs if
        fakeReboot is set
      42f43592
  22. 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
  23. 20 6月, 2011 1 次提交
    • O
      numatune: Add tests for numatune XML · b369114d
      Osier Yang 提交于
      Only add tests for qemuxmlargvtest.c, as there is no qemu command line
      for numatune XML, just want to make sure the XML could be validated
      well.
      b369114d
  24. 15 6月, 2011 1 次提交
    • J
      qemu: Translate boot config into bootindex if possible · c3068d4d
      Jiri Denemark 提交于
      Prefer bootindex=N option for -device over the old way -boot ORDER
      possibly accompanied with boot=on option for -drive. This gives us full
      control over which device will actually be used for booting guest OS.
      Moreover, if qemu doesn't support boot=on, this is the only way to boot
      of certain disks in some configurations (such as virtio disks when used
      together IDE disks) without transforming domain XML to use per device
      boot elements.
      c3068d4d
  25. 13 6月, 2011 1 次提交
  26. 02 6月, 2011 1 次提交
  27. 31 5月, 2011 2 次提交
  28. 01 5月, 2011 1 次提交
    • M
      tests: Lower stack usage below 4096 bytes · 9ba4eb3c
      Matthias Bolte 提交于
      Make virtTestLoadFile allocate the buffer to read the file into.
      
      Fix logic error in virtTestLoadFile, stop reading on the first empty line.
      
      Use virFileReadLimFD in virtTestCaptureProgramOutput to avoid manual
      buffer handling.
      9ba4eb3c