1. 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
  2. 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
  3. 25 10月, 2011 1 次提交
  4. 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
  5. 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
  6. 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
  7. 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
  8. 05 9月, 2011 2 次提交
  9. 02 9月, 2011 10 次提交
  10. 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
  11. 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
  12. 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
  13. 09 7月, 2011 1 次提交
  14. 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
  15. 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
  16. 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
  17. 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
  18. 13 6月, 2011 1 次提交
  19. 02 6月, 2011 1 次提交
  20. 31 5月, 2011 2 次提交
  21. 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
  22. 30 4月, 2011 1 次提交
    • E
      tests: simplify common setup · 20986e58
      Eric Blake 提交于
      A few of the tests were missing basic sanity checks, while most
      of them were doing copy-and-paste initialization (in fact, some
      of them pasted the argc > 1 check more than once!).  It's much
      nicer to do things in one common place, and minimizes the size of
      the next patch that fixes getcwd usage.
      
      * tests/testutils.h (EXIT_AM_HARDFAIL): New define.
      (progname, abs_srcdir): Define for all tests.
      (VIRT_TEST_MAIN): Change callback signature.
      * tests/testutils.c (virtTestMain): Do more common init.
      * tests/commandtest.c (mymain): Simplify.
      * tests/cputest.c (mymain): Likewise.
      * tests/esxutilstest.c (mymain): Likewise.
      * tests/eventtest.c (mymain): Likewise.
      * tests/hashtest.c (mymain): Likewise.
      * tests/networkxml2xmltest.c (mymain): Likewise.
      * tests/nodedevxml2xmltest.c (myname): Likewise.
      * tests/nodeinfotest.c (mymain): Likewise.
      * tests/nwfilterxml2xmltest.c (mymain): Likewise.
      * tests/qemuargv2xmltest.c (mymain): Likewise.
      * tests/qemuhelptest.c (mymain): Likewise.
      * tests/qemuxml2argvtest.c (mymain): Likewise.
      * tests/qemuxml2xmltest.c (mymain): Likewise.
      * tests/qparamtest.c (mymain): Likewise.
      * tests/sexpr2xmltest.c (mymain): Likewise.
      * tests/sockettest.c (mymain): Likewise.
      * tests/statstest.c (mymain): Likewise.
      * tests/storagepoolxml2xmltest.c (mymain): Likewise.
      * tests/storagevolxml2xmltest.c (mymain): Likewise.
      * tests/virbuftest.c (mymain): Likewise.
      * tests/virshtest.c (mymain): Likewise.
      * tests/vmx2xmltest.c (mymain): Likewise.
      * tests/xencapstest.c (mymain): Likewise.
      * tests/xmconfigtest.c (mymain): Likewise.
      * tests/xml2sexprtest.c (mymain): Likewise.
      * tests/xml2vmxtest.c (mymain): Likewise.
      20986e58
  23. 29 3月, 2011 2 次提交
    • O
      cputune: New tests for cputune XML · 079ae9c7
      Osier Yang 提交于
      v1 - v2:
        * Add missed tests/qemuxml2argvdata/qemuxml2argv-cputune.args
      079ae9c7
    • E
      qemu: fix restoring a compressed save image · d51023d4
      Eric Blake 提交于
      Latent bug introduced in commit 2d6a5819 (Aug 2009), but not exposed
      until commit 1859939a (Jan 2011).  Basically, when virExec creates a
      pipe, it always marks libvirt's side as cloexec.  If libvirt then
      wants to hand that pipe to another child process, things work great if
      the fd is dup2()'d onto stdin or stdout (as with stdin: or exec:
      migration), but if the pipe is instead used as-is (such as with fd:
      migration) then qemu sees EBADF because the fd was closed at exec().
      
      This is a minimal fix for the problem at hand; it is slightly racy,
      but no more racy than the rest of libvirt fd handling, including the
      case of uncompressed save images.  A more invasive fix, but ultimately
      safer at avoiding leaking unintended fds, would be to _always and
      atomically_ open all fds as cloexec in libvirt (thanks to primitives
      like open(O_CLOEXEC), pipe2(), accept4(), ...), then teach virExec to
      clear that bit for all fds explicitly marked to be handed to the child
      only after forking.
      
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Clear cloexec
      flag.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Tweak test.
      d51023d4
  24. 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
  25. 24 2月, 2011 3 次提交