1. 19 2月, 2014 1 次提交
  2. 11 2月, 2014 1 次提交
    • M
      qemu: introduce spiceport chardev backend · d27e6bc4
      Martin Kletzander 提交于
      Add a new backend for any character device.  This backend uses channel
      in spice connection.  This channel is similar to spicevmc, but
      all-purpose in contrast to spicevmc.
      
      Apart from spicevmc, spiceport-backed chardev will not be formatted
      into the command-line if there is no spice to use (with test for that
      as well).  For this I moved the def->graphics counting to the start
      of the function so its results can be used in rest of the code even in
      the future.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      d27e6bc4
  3. 21 1月, 2014 1 次提交
  4. 07 1月, 2014 2 次提交
    • Y
      Fix segmentation fault when accessing default qemu machine type · 72953074
      Yudai Yamagish 提交于
      This patch fixes a segmentation fault when creating new virtual machines using QEMU.
      The segmentation fault is caused by commit f4183068
      and commit cbb6ec42.
      
      In virQEMUCapsProbeQMPMachineTypes, when copying machines to qemuCaps, "none" is skipped.
      Therefore, the value of i and "qemuCaps->nmachineTypes - 1" do not always match.
      However, defIdx value (used to call virQEMUCapsSetDefaultMachine) is set using the value in i
      when the array elements are in qemuCaps->nmachineTypes - 1.
      So, when libvirt tries to create virtual machines using the default machine type,
      qemuCaps->machineTypes[defIdx] is accessed and since the defIdx is NULL, it results in segmentation fault.
      Signed-off-by: NYudai Yamagishi <yummy@sfc.wide.ad.jp>
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      72953074
    • P
      AArch64: Porting of armv7l conditons to run qemu for aarch64. · 27e32e0f
      Pranavkumar Sawargaonkar 提交于
      AArch64 qemu has similar behavior as armv7l, like use of mmio etc.
      This patch adds similar bypass checks what we have for armv7l to aarch64.
      E.g. we are enabling mmio transport for Nicdev.
      Making addDefaultUSB and addDefaultMemballoon to false etc.
      
      V3:
      - Adding missing domain rng schema for aarcg64 and test case in
        testutilsqemu.c which was causing test suite failure
        while running make check.
      
      V2:
      - Added testcase to qemuxml2argvtest as suggested
        during review comments of V1.
      
      V1:
      - Initial patch.
      Signed-off-by: NAnup Patel <anup.patel@linaro.org>
      Signed-off-by: NPranavkumar Sawargaonkar <pranavkumar@linaro.org>
      27e32e0f
  5. 18 12月, 2013 1 次提交
    • E
      qemu: ask for -enable-fips when FIPS is required · a21cfb0f
      Eric Blake 提交于
      On a system that is enforcing FIPS, most libraries honor the
      current mode by default.  Qemu, on the other hand, refused to
      honor FIPS mode unless you add the '-enable-fips' command
      line option; worse, this option is not discoverable via QMP,
      and is only present on binaries built for Linux.  So, if we
      detect FIPS mode, then we unconditionally ask for FIPS; either
      qemu is new enough to have the option and then correctly
      cripple insecure VNC passwords, or it is so old that we are
      correctly avoiding a FIPS violation by preventing qemu from
      starting.  Meanwhile, if we don't detect FIPS mode, then
      omitting the argument is safe whether the qemu has the option
      (but it would do nothing because FIPS is disabled) or whether
      qemu lacks the option (including in the case where we are not
      running on Linux).
      
      The testsuite was a bit interesting: we don't want our test
      to depend on whether it is being run in FIPS mode, so I had
      to tweak things to set the capability bit outside of our
      normal interaction with capability parsing.
      
      This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1035474
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_ENABLE_FIPS): New bit.
      * src/qemu/qemu_capabilities.c (virQEMUCapsInitQMP): Conditionally
      set capability according to detection of FIPS mode.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Use it.
      * tests/qemucapabilitiestest.c (testQemuCaps): Conditionally set
      capability to test expected output.
      * tests/qemucapabilitiesdata/caps_1.2.2-1.caps: Update list.
      * tests/qemucapabilitiesdata/caps_1.6.0-1.caps: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a21cfb0f
  6. 13 12月, 2013 2 次提交
  7. 03 12月, 2013 1 次提交
    • L
      qemu: add "-boot strict" to commandline whenever possible · 96fddee3
      Laine Stump 提交于
      This resolves:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=888635
      
      (which was already closed as CANTFIX because the qemu "-boot strict"
      commandline option wasn't available at the time).
      
      Problem: you couldn't have a domain that used PXE to boot, but also
      had an un-bootable disk device *even if that disk wasn't listed in the
      boot order*, because if PXE timed out (e.g. due to the bridge
      forwarding delay), the BIOS would move on to the next target, which
      would be the unbootable disk device (again - even though it wasn't
      given a boot order), and get stuck at a "BOOT DISK FAILURE, PRESS ANY
      KEY" message until a user intervened.
      
      The solution available since sometime around QEMU 1.5, is to add
      "-boot strict=on" to *every* qemu command. When this is done, if any
      devices have a boot order specified, then QEMU will *only* attempt to
      boot from those devices that have an explicit boot order, ignoring the
      rest.
      96fddee3
  8. 12 11月, 2013 2 次提交
  9. 05 11月, 2013 1 次提交
  10. 11 10月, 2013 1 次提交
    • M
      qemu_migration: Avoid crashing if domain dies too quickly · c7ac2519
      Michal Privoznik 提交于
      I've noticed a SIGSEGV-ing libvirtd on the destination when the qemu
      died too quickly = in Prepare phase. What is happening here is:
      
      1) [Thread 3493] We are in qemuMigrationPrepareAny() and calling
      qemuProcessStart() which subsequently calls qemuProcessWaitForMonitor()
      and qemuConnectMonitor(). So far so good. The qemuMonitorOpen()
      succeeds, however switching monitor to QMP mode fails as qemu died
      meanwhile. That is qemuMonitorSetCapabilities() returns -1.
      
      2013-10-08 15:54:10.629+0000: 3493: debug : qemuMonitorSetCapabilities:1356 : mon=0x14a53da0
      2013-10-08 15:54:10.630+0000: 3493: debug : qemuMonitorJSONCommandWithFd:262 : Send command '{"execute":"qmp_capabilities","id":"libvirt-1"}' for write with FD -1
      2013-10-08 15:54:10.630+0000: 3493: debug : virEventPollUpdateHandle:147 : EVENT_POLL_UPDATE_HANDLE: watch=17 events=13
      ...
      2013-10-08 15:54:10.631+0000: 3493: debug : qemuMonitorSend:956 : QEMU_MONITOR_SEND_MSG: mon=0x14a53da0 msg={"execute":"qmp_capabilities","id":"libvirt-1"}
       fd=-1
      2013-10-08 15:54:10.631+0000: 3262: debug : virEventPollRunOnce:641 : Poll got 1 event(s)
      
      2) [Thread 3262] The event loop is trying to do the talking to monitor.
      However, qemu is dead already, remember?
      
      2013-10-08 15:54:13.436+0000: 3262: error : qemuMonitorIORead:551 : Unable to read from monitor: Connection reset by peer
      2013-10-08 15:54:13.516+0000: 3262: debug : virFileClose:90 : Closed fd 25
      ...
      2013-10-08 15:54:13.533+0000: 3493: debug : qemuMonitorSend:968 : Send command resulted in error internal error: early end of file from monitor: possible problem:
      
      3) [Thread 3493] qemuProcessStart() failed. No big deal. Go to the
      'endjob' label and subsequently to the 'cleanup'. Since the domain is
      not persistent and ret is -1, the qemuDomainRemoveInactive() is called.
      This has an (unpleasant) effect of virObjectUnref()-in the @vm object.
      Unpleasant because the event loop which is about to trigger EOF callback
      still holds a pointer to the @vm (not the reference). See the valgrind
      output below.
      
      4) [Thread 3262] So the event loop starts triggering EOF:
      
      2013-10-08 15:54:13.542+0000: 3262: debug : qemuMonitorIO:729 : Triggering EOF callback
      2013-10-08 15:54:13.543+0000: 3262: debug : qemuProcessHandleMonitorEOF:294 : Received EOF on 0x14549110 'migt10'
      
      And the monitor is cleaned up. This results in calling
      qemuProcessHandleMonitorEOF with the @vm pointer passed. The pointer is
      kept in qemuMonitor struct.
      
      ==3262== Thread 1:
      ==3262== Invalid read of size 4
      ==3262==    at 0x77ECCAA: pthread_mutex_lock (in /lib64/libpthread-2.15.so)
      ==3262==    by 0x52FAA06: virMutexLock (virthreadpthread.c:85)
      ==3262==    by 0x52E3891: virObjectLock (virobject.c:320)
      ==3262==    by 0x11626743: qemuProcessHandleMonitorEOF (qemu_process.c:296)
      ==3262==    by 0x11642593: qemuMonitorIO (qemu_monitor.c:730)
      ==3262==    by 0x52BD526: virEventPollDispatchHandles (vireventpoll.c:501)
      ==3262==    by 0x52BDD49: virEventPollRunOnce (vireventpoll.c:648)
      ==3262==    by 0x52BBC68: virEventRunDefaultImpl (virevent.c:274)
      ==3262==    by 0x542D3D9: virNetServerRun (virnetserver.c:1112)
      ==3262==    by 0x11F368: main (libvirtd.c:1513)
      ==3262==  Address 0x14549128 is 24 bytes inside a block of size 136 free'd
      ==3262==    at 0x4C2AF5C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==3262==    by 0x529B1FF: virFree (viralloc.c:580)
      ==3262==    by 0x52E3703: virObjectUnref (virobject.c:270)
      ==3262==    by 0x531557E: virDomainObjListRemove (domain_conf.c:2355)
      ==3262==    by 0x1160E899: qemuDomainRemoveInactive (qemu_domain.c:2061)
      ==3262==    by 0x1163A0C6: qemuMigrationPrepareAny (qemu_migration.c:2450)
      ==3262==    by 0x1163A923: qemuMigrationPrepareDirect (qemu_migration.c:2626)
      ==3262==    by 0x11682D71: qemuDomainMigratePrepare3Params (qemu_driver.c:10309)
      ==3262==    by 0x53B0976: virDomainMigratePrepare3Params (libvirt.c:7266)
      ==3262==    by 0x1502D3: remoteDispatchDomainMigratePrepare3Params (remote.c:4797)
      ==3262==    by 0x12DECA: remoteDispatchDomainMigratePrepare3ParamsHelper (remote_dispatch.h:5741)
      ==3262==    by 0x54322EB: virNetServerProgramDispatchCall (virnetserverprogram.c:435)
      
      The mon->vm is set in qemuMonitorOpenInternal() which is the correct
      place to increase @vm ref counter. The correct place to decrease the ref
      counter is then qemuMonitorDispose().
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c7ac2519
  11. 01 10月, 2013 1 次提交
  12. 25 9月, 2013 1 次提交
  13. 16 9月, 2013 1 次提交
  14. 03 9月, 2013 2 次提交
    • C
      qemu: Support virtio-mmio transport for virtio on ARM · 4fa17221
      Cole Robinson 提交于
      Starting with qemu 1.6, the qemu-system-arm vexpress-a9 model has a
      hardcoded virtio-mmio transport which enables attaching all virtio
      devices.
      
      On the command line, we have to use virtio-XXX-device rather than
      virtio-XXX-pci, thankfully s390 already set the precedent here so
      it's fairly straight forward.
      
      At the XML level, this adds a new device address type virtio-mmio.
      The controller and addressing don't have any subelements at the
      moment because we they aren't needed for this usecase, but could
      be added later if needed.
      
      Add a test case for an ARM guest with one of every virtio device
      enabled.
      4fa17221
    • C
      qemu: Fix specifying char devs for ARM · 3a2beaee
      Cole Robinson 提交于
      QEMU ARM boards don't give us any way to explicitly wire in
      a -chardev, so use the old style -serial options.
      
      Unfortunately this isn't as simple as just turning off the CHARDEV flag
      for qemu-system-arm, as upcoming virtio support _will_ use device/chardev.
      3a2beaee
  15. 02 9月, 2013 2 次提交
  16. 27 8月, 2013 1 次提交
    • J
      Build QEMU command line for pcihole64 · 63ee776f
      Ján Tomko 提交于
      QEMU commit 3984890 introduced the "pci-hole64-size" property,
      to i440FX-pcihost and q35-pcihost with a default setting of 2 GB.
      
      Translate <pcihole64>x<pcihole64/> to:
      -global q35-pcihost.pci-hole64-size=x for q35 machines and
      -global i440FX-pcihost.pci-hole64-size=x for i440FX-based machines.
      
      Error out on other machine types or if the size was specified
      but the pcihost device lacks 'pci-hole64-size' property.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=990418
      63ee776f
  17. 26 8月, 2013 1 次提交
  18. 06 8月, 2013 1 次提交
    • L
      qemu: add dmi-to-pci-bridge controller · 62ac6b43
      Laine Stump 提交于
      This PCI controller, named "dmi-to-pci-bridge" in the libvirt config,
      and implemented with qemu's "i82801b11-bridge" device, connects to a
      PCI Express slot (e.g. one of the slots provided by the pcie-root
      controller, aka "pcie.0" on the qemu commandline), and provides 31
      *non-hot-pluggable* PCI (*not* PCIe) slots, numbered 1-31.
      
      Any time a machine is defined which has a pcie-root controller
      (i.e. any q35-based machinetype), libvirt will automatically add a
      dmi-to-pci-bridge controller if one doesn't exist, and also add a
      pci-bridge controller. The reasoning here is that any useful domain
      will have either an immediate (startup time) or eventual (subsequent
      hot-plug) need for a standard PCI slot; since the pcie-root controller
      only provides PCIe slots, we need to connect a dmi-to-pci-bridge
      controller to it in order to get a non-hot-plug PCI slot that we can
      then use to connect a pci-bridge - the slots provided by the
      pci-bridge will be both standard PCI and hot-pluggable.
      
      Since pci-bridge devices themselves can not be hot-plugged into a
      running system (although you can hot-plug other devices into a
      pci-bridge's slots), any new pci-bridge controller that is added can
      (and will) be plugged into the dmi-to-pci-bridge as long as it has
      empty slots available.
      
      This patch is also changing the qemuxml2xml-pcie test from a "DO_TEST"
      to a "DO_DIFFERENT_TEST". This is so that the "before" xml can omit
      the automatically added dmi-to-pci-bridge and pci-bridge devices, and
      the "after" xml can include it - this way we are testing if libvirt is
      properly adding these devices.
      62ac6b43
  19. 29 7月, 2013 1 次提交
  20. 22 7月, 2013 2 次提交
  21. 18 7月, 2013 1 次提交
  22. 11 7月, 2013 1 次提交
  23. 10 7月, 2013 1 次提交
  24. 01 7月, 2013 1 次提交
  25. 21 6月, 2013 2 次提交
  26. 18 6月, 2013 1 次提交
  27. 06 6月, 2013 2 次提交
  28. 23 5月, 2013 1 次提交
  29. 22 5月, 2013 1 次提交
  30. 21 5月, 2013 1 次提交
  31. 17 5月, 2013 1 次提交
  32. 15 5月, 2013 1 次提交
    • O
      qemu: Support discard for disk · a7c4202c
      Osier Yang 提交于
      QEMU introduced "discard" option for drive since commit a9384aff53,
      
      <...>
      @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and
      controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
      requests are ignored or passed to the filesystem.  Some machine types
      may not support discard requests.
      </...>
      
      This patch exposes the support in libvirt.
      
      QEMU supported "discard" for "-drive" since v1.5.0-rc0:
      
      % git tag --contains a9384aff53
      contains
      v1.5.0-rc0
      v1.5.0-rc1
      
      So this only detects the capability bit using virQEMUCapsProbeQMPCommandLine.
      a7c4202c