1. 13 8月, 2015 1 次提交
    • M
      qemu: Fix segfault when parsing private domain data · 92ddffdb
      Martin Kletzander 提交于
      When parsing private domain data, there are two paths that are flawed.
      They are both error paths, just from different parts of the function.
      One of them can call free() on an uninitialized pointer.  Initialization
      to NULL is enough here.  The other one is a bit trickier to explain, but
      as easy as the first one to fix.  We create capabilities, parse them and
      then assign them into the private data pointer inside the domain object.
      If, however, we get to fail from now on, the error path calls unrefs the
      capabilities and then, when the domain object is being cleaned,
      qemuDomainObjPrivateFree() tries to unref them as well.  That causes a
      segfault.  Settin the pointer to NULL upon successful addition to the
      private data is enough.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      92ddffdb
  2. 12 8月, 2015 1 次提交
    • L
      qemu: fix qemuDomainSupportsPCI() for ARM machines of "virt" machinetype · 9bd16ad3
      Laine Stump 提交于
      Commit e8d55172 updated the domain post-parse to automatically add
      pcie-root et al for certain ARM "virt" machinetypes, but didn't update
      the function qemuDomainSupportsPCI() which is called later on when we
      are auto-assigning PCI addresses and default settings for the PCI
      controller <model> and <target> attributes. The result was that PCI
      addresses weren't assigned, and the controllers didn't have their
      attribute default values set, leading to an error when the domain was
      started, e.g.:
      
        internal error: autogenerated dmi-to-pci-bridge options not set
      
      This patch adds the same check made in the earlier patch to
      qemuDomainSupportsPCI(), so that PCI address auto-assignment and
      target/model default values will be set.
      9bd16ad3
  3. 06 8月, 2015 2 次提交
  4. 03 8月, 2015 1 次提交
    • M
      qemu: Remove double unlock for domains · c43c661f
      Martin Kletzander 提交于
      The virDomainObjListRemove() function unlocks a domain that it's given
      due to legacy code.  And because of that code, which should be
      refactored, that last virObjectUnlock() cannot be just removed.  So
      instead, lock it right back for qemu for now.  All calls to
      qemuDomainRemoveInactive() are followed by code that unlocks the domain
      again, plus the domain should be locked during qemuDomainObjEndJob(), so
      the right place to lock it is right after virDomainObjListRemove().
      
      The only place where this would cause a problem is the autodestroy
      callback, so we need to get another reference there and uref+unlock it
      afterwards.  Luckily, returning NULL from that function doesn't mean an
      error, and only means that it doesn't need to be unlocked anymore.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      c43c661f
  5. 08 7月, 2015 2 次提交
  6. 01 7月, 2015 2 次提交
  7. 19 6月, 2015 5 次提交
  8. 18 6月, 2015 1 次提交
    • P
      qemu: 'privileged' flag is not really configuration · 0b416434
      Peter Krempa 提交于
      The privileged flag will not change while the configuration might
      change. Make the 'privileged' flag member of the driver again and mark
      it immutable. Should that ever change add an accessor that will group
      reads of the state.
      0b416434
  9. 04 6月, 2015 2 次提交
  10. 01 6月, 2015 1 次提交
  11. 20 5月, 2015 1 次提交
  12. 15 5月, 2015 2 次提交
  13. 04 5月, 2015 1 次提交
  14. 28 4月, 2015 1 次提交
    • J
      qemu: Use domain iothreadids to IOThread's 'thread_id' · 8d4614a5
      John Ferlan 提交于
      Add 'thread_id' to the virDomainIOThreadIDDef as a means to store the
      'thread_id' as returned from the live qemu monitor data.
      
      Remove the iothreadpids list from _qemuDomainObjPrivate and replace with
      the new iothreadids 'thread_id' element.
      
      Rather than use the default numbering scheme of 1..number of iothreads
      defined for the domain, use the iothreadid's list for the iothread_id
      
      Since iothreadids list keeps track of the iothread_id's, these are
      now used in place of the many places where a for loop would "know"
      that the ID was "+ 1" from the array element.
      
      The new tests ensure usage of the <iothreadid> values for an exact number
      of iothreads and the usage of a smaller number of <iothreadid> values than
      iothreads that exist (and usage of the default numbering scheme).
      8d4614a5
  15. 26 4月, 2015 1 次提交
    • P
      qemu: agent: Differentiate errors when the agent channel was hotplugged · e1c04108
      Peter Krempa 提交于
      When the guest agent channel gets hotplugged to a VM, libvirt would
      still report that "QEMU guest agent is not configured" rather than
      stating that the connection was not established yet.
      
      Currently the code won't be able to connect to the agent after hotplug
      but that will change in a later patch.
      
      As the qemuFindAgentConfig() helper is quite helpful in this case move
      it to a more usable place and export it.
      e1c04108
  16. 24 4月, 2015 3 次提交
  17. 21 4月, 2015 1 次提交
    • C
      domain: conf: Drop expectedVirtTypes · 835cf84b
      Cole Robinson 提交于
      This needs to specified in way too many places for a simple validation
      check. The ostype/arch/virttype validation checks later in
      DomainDefParseXML should catch most of the cases that this was covering.
      835cf84b
  18. 14 4月, 2015 1 次提交
  19. 09 4月, 2015 3 次提交
  20. 08 4月, 2015 2 次提交
    • M
      qemu: fix crash in qemuProcessAutoDestroy · 7578cc17
      Michael Chapman 提交于
      The destination libvirt daemon in a migration may segfault if the client
      disconnects immediately after the migration has begun:
      
        # virsh -c qemu+tls://remote/system list --all
         Id    Name                           State
        ----------------------------------------------------
        ...
      
        # timeout --signal KILL 1 \
            virsh migrate example qemu+tls://remote/system \
              --verbose --compressed --live --auto-converge \
              --abort-on-error --unsafe --persistent \
              --undefinesource --copy-storage-all --xml example.xml
        Killed
      
        # virsh -c qemu+tls://remote/system list --all
        error: failed to connect to the hypervisor
        error: unable to connect to server at 'remote:16514': Connection refused
      
      The crash is in:
      
         1531 void
         1532 qemuDomainObjEndJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
         1533 {
         1534     qemuDomainObjPrivatePtr priv = obj->privateData;
         1535     qemuDomainJob job = priv->job.active;
         1536
         1537     priv->jobs_queued--;
      
      Backtrace:
      
        #0  at qemuDomainObjEndJob at qemu/qemu_domain.c:1537
        #1  in qemuDomainRemoveInactive at qemu/qemu_domain.c:2497
        #2  in qemuProcessAutoDestroy at qemu/qemu_process.c:5646
        #3  in virCloseCallbacksRun at util/virclosecallbacks.c:350
        #4  in qemuConnectClose at qemu/qemu_driver.c:1154
        ...
      
      qemuDomainRemoveInactive calls virDomainObjListRemove, which in this
      case is holding the last remaining reference to the domain.
      qemuDomainRemoveInactive then calls qemuDomainObjEndJob, but the domain
      object has been freed and poisoned by then.
      
      This patch bumps the domain's refcount until qemuDomainRemoveInactive
      has completed. We also ensure qemuProcessAutoDestroy does not return the
      domain to virCloseCallbacksRun to be unlocked in this case. There is
      similar logic in bhyveProcessAutoDestroy and lxcProcessAutoDestroy
      (which call virDomainObjListRemove directly).
      Signed-off-by: NMichael Chapman <mike@very.puzzling.org>
      7578cc17
    • M
      virQEMUDriverGetConfig: Fix memleak · 225aa802
      Michal Privoznik 提交于
      ==19015== 968 (416 direct, 552 indirect) bytes in 1 blocks are definitely lost in loss record 999 of 1,049
      ==19015==    at 0x4C2C070: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==19015==    by 0x52ADF14: virAllocVar (viralloc.c:560)
      ==19015==    by 0x5302FD1: virObjectNew (virobject.c:193)
      ==19015==    by 0x1DD9401E: virQEMUDriverConfigNew (qemu_conf.c:164)
      ==19015==    by 0x1DDDF65D: qemuStateInitialize (qemu_driver.c:666)
      ==19015==    by 0x53E0823: virStateInitialize (libvirt.c:777)
      ==19015==    by 0x11E067: daemonRunStateInit (libvirtd.c:905)
      ==19015==    by 0x53201AD: virThreadHelper (virthread.c:206)
      ==19015==    by 0xA1EE1F2: start_thread (in /lib64/libpthread-2.19.so)
      ==19015==    by 0xA4EFC8C: clone (in /lib64/libc-2.19.so)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      225aa802
  21. 02 4月, 2015 2 次提交
  22. 25 3月, 2015 4 次提交