1. 27 4月, 2017 4 次提交
  2. 25 4月, 2017 1 次提交
  3. 24 4月, 2017 1 次提交
  4. 21 4月, 2017 2 次提交
  5. 20 4月, 2017 4 次提交
    • P
      qemu: hotplug: Don't save status XML when monitor is closed · 355f5ab9
      Peter Krempa 提交于
      In the vcpu hotplug code if exit from the monitor failed we would still
      attempt to save the status XML. When the daemon is terminated the
      monitor socket is closed. In such case, the written status XML would not
      contain the monitor path and thus be invalid.
      
      Avoid this issue by only saving status XML on success of the monitor
      command.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1439452
      355f5ab9
    • P
      qemu: hotplug: Unexport qemuDomainHotplugDelVcpu · f24dc5e2
      Peter Krempa 提交于
      The function is used only in the hotplug module.
      f24dc5e2
    • P
      qemu_domain: use correct default USB controller on ppc64 · 90acbc76
      Pavel Hrdina 提交于
      The history of USB controller for ppc64 guest is complex and goes
      back to libvirt 1.3.1 where the fun started.
      
      Prior Libvirt 1.3.1 if no model for USB controller was specified
      we've simply passed "-usb" on QEMU command line.
      
      Since Libvirt 1.3.1 there is a patch (8156493d) that fixes this
      issue by using "-device pci-ohci,..." but it breaks migration with
      older Libvirts which was agreed that's acceptable.  However this
      patch didn't reflect this change in the domain XML and the model
      was still missing.
      
      Since Libvirt 2.2.0 there is a patch (f55eaccb) that fixes the
      issue with not setting the USB model into domain XML which we need
      to know about to not break the migration and since the default
      model was *pci-ohci* it was used as default in this patch as well.
      
      This patch tries to take all the previous changes into account and
      also change the default for newly defined domains that don't specify
      any model for USB controller.
      
      The VIR_DOMAIN_DEF_PARSE_ABI_UPDATE is set only if new domain is
      defined or new device is added into a domain which means that in
      all other cases we will use the old *pci-ohci* model instead of the
      better and not broken *nec-usb-xhci* model.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1373184Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      90acbc76
    • P
      conf: add a new parse flag VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION · 5c7d8808
      Pavel Hrdina 提交于
      So far there is probably no change that is allowed to be done
      by the VIR_DOMAIN_DEF_PARSE_ABI_UPDATE flag that would break
      guest ABI but this may change in the future.
      
      This introduces new VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION
      which should be used only for ABI updates that are "safe" for
      persistent migration.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      5c7d8808
  6. 19 4月, 2017 8 次提交
  7. 18 4月, 2017 4 次提交
  8. 13 4月, 2017 5 次提交
  9. 12 4月, 2017 3 次提交
    • P
      qemu: conf: Don't leak 'namespaces' temporary variable while parsing config · 4e950b68
      Peter Krempa 提交于
      ==20406== 8 bytes in 1 blocks are definitely lost in loss record 24 of 1,059
      ==20406==    at 0x4C2CF55: calloc (vg_replace_malloc.c:711)
      ==20406==    by 0x54BF530: virAllocN (viralloc.c:191)
      ==20406==    by 0x54D37C4: virConfGetValueStringList (virconf.c:1001)
      ==20406==    by 0x144E4E8E: virQEMUDriverConfigLoadFile (qemu_conf.c:835)
      ==20406==    by 0x1452A744: qemuStateInitialize (qemu_driver.c:664)
      ==20406==    by 0x55DB585: virStateInitialize (libvirt.c:770)
      ==20406==    by 0x124570: daemonRunStateInit (libvirtd.c:881)
      ==20406==    by 0x5532990: virThreadHelper (virthread.c:206)
      ==20406==    by 0x8C82493: start_thread (in /lib64/libpthread-2.24.so)
      ==20406==    by 0x8F7FA1E: clone (in /lib64/libc-2.24.so)
      4e950b68
    • P
      qemu: conf: Don't leak snapshot image format conf variable · 2ef3aa8f
      Peter Krempa 提交于
      ==20406== 4 bytes in 1 blocks are definitely lost in loss record 6 of 1,059
      ==20406==    at 0x4C2AF3F: malloc (vg_replace_malloc.c:299)
      ==20406==    by 0x8F17D39: strdup (in /lib64/libc-2.24.so)
      ==20406==    by 0x552C0E0: virStrdup (virstring.c:784)
      ==20406==    by 0x54D3622: virConfGetValueString (virconf.c:945)
      ==20406==    by 0x144E4692: virQEMUDriverConfigLoadFile (qemu_conf.c:687)
      ==20406==    by 0x1452A744: qemuStateInitialize (qemu_driver.c:664)
      ==20406==    by 0x55DB585: virStateInitialize (libvirt.c:770)
      ==20406==    by 0x124570: daemonRunStateInit (libvirtd.c:881)
      ==20406==    by 0x5532990: virThreadHelper (virthread.c:206)
      ==20406==    by 0x8C82493: start_thread (in /lib64/libpthread-2.24.so)
      ==20406==    by 0x8F7FA1E: clone (in /lib64/libc-2.24.so)
      2ef3aa8f
    • E
      qemu: Fix mdev checking for VFIO support · b4c2ac8d
      Erik Skultety 提交于
      Commit a4a39d90 added a check that checks for VFIO support with mediated
      devices. The problem is that the hostdev preparing functions behave like
      a fallthrough if device of that specific type doesn't exist. However,
      the check for VFIO support was independent of the existence of a mdev
      device which caused the guest to fail to start with any device to be
      directly assigned if VFIO was disabled/unavailable in the kernel.
      The proposed change first ensures that it makes sense to check for VFIO
      support in the first place, and only then performs the VFIO support check
      itself.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1441291Signed-off-by: NErik Skultety <eskultet@redhat.com>
      b4c2ac8d
  10. 11 4月, 2017 1 次提交
  11. 10 4月, 2017 4 次提交
    • M
      qemu: remove ATTRIBUTE_UNUSED in qemuProcessHandleMonitorEOF · 7a665f24
      Marc Hartmayer 提交于
      This attribute is not needed here, since @mon is in use.
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
      7a665f24
    • M
      qemu: Implement qemuMonitorRegister() · bae81da3
      Marc Hartmayer 提交于
      Implement qemuMonitorRegister() as there is already a
      qemuMonitorUnregister() function. This way it may be easier to
      understand the code paths.
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
      bae81da3
    • M
      qemu: Turn qemuDomainLogContext into virObject · b8cc5098
      Marc Hartmayer 提交于
      This way qemuDomainLogContextRef() and qemuDomainLogContextFree() is
      no longer needed. The naming qemuDomainLogContextFree() was also
      somewhat misleading. Additionally, it's easier to turn
      qemuDomainLogContext in a self-locking object.
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
      b8cc5098
    • M
      qemu: Fix two use-after-free situations · 20e95cb7
      Marc Hartmayer 提交于
      There were multiple race conditions that could lead to segmentation
      faults. The first precondition for this is qemuProcessLaunch must fail
      sometime shortly after starting the new QEMU process. The second
      precondition for the segmentation faults is that the new QEMU process
      dies - or to be more precise the QEMU monitor has to be closed
      irregularly. If both happens during qemuProcessStart (starting a
      domain) there are race windows between the thread with the event
      loop (T1) and the thread that is starting the domain (T2).
      
      First segmentation fault scenario:
      If qemuProcessLaunch fails during qemuProcessStart the code branches
      to the 'stop' path where 'qemuMonitorSetDomainLog(priv->mon, NULL,
      NULL, NULL)' will set the log function of the monitor to NULL (done in
      T2). In the meantime the event loop of T1 will wake up with an EOF
      event for the QEMU monitor because the QEMU process has died. The
      crash occurs if T1 has checked 'mon->logFunc != NULL' in qemuMonitorIO
      just before the logFunc was set to NULL by T2. If this situation
      occurs T1 will try to call mon->logFunc which leads to the
      segmentation fault.
      
      Solution:
      Require the monitor lock for setting the log function.
      
      Backtrace:
      0  0x0000000000000000 in ?? ()
      1  0x000003ffe9e45316 in qemuMonitorIO (watch=<optimized out>,
      fd=<optimized out>, events=<optimized out>, opaque=0x3ffe08aa860) at
      ../../src/qemu/qemu_monitor.c:727
      2  0x000003fffda2e1a4 in virEventPollDispatchHandles (nfds=<optimized
      out>, fds=0x2aa000fd980) at ../../src/util/vireventpoll.c:508
      3  0x000003fffda2e398 in virEventPollRunOnce () at
      ../../src/util/vireventpoll.c:657
      4  0x000003fffda2ca10 in virEventRunDefaultImpl () at
      ../../src/util/virevent.c:314
      5  0x000003fffdba9366 in virNetDaemonRun (dmn=0x2aa000cc550) at
      ../../src/rpc/virnetdaemon.c:818
      6  0x000002aa00024668 in main (argc=<optimized out>, argv=<optimized
      out>) at ../../daemon/libvirtd.c:1541
      
      Second segmentation fault scenario:
      If qemuProcessLaunch fails it will unref the log context and with
      invoking qemuMonitorSetDomainLog(priv->mon, NULL, NULL, NULL)
      qemuDomainLogContextFree() will be invoked. qemuDomainLogContextFree()
      invokes virNetClientClose() to close the client and cleans everything
      up (including unref of _virLogManager.client) when virNetClientClose()
      returns. When T1 is now trying to report 'qemu unexpectedly closed the
      monitor' libvirtd will crash because the client has already been
      freed.
      
      Solution:
      As the critical section in qemuMonitorIO is protected with the monitor
      lock we can use the same solution as proposed for the first
      segmentation fault.
      
      Backtrace:
      0  virClassIsDerivedFrom (klass=0x3100979797979797,
      parent=0x2aa000d92f0) at ../../src/util/virobject.c:169
      1  0x000003fffda659e6 in virObjectIsClass (anyobj=<optimized out>,
      klass=<optimized out>) at ../../src/util/virobject.c:365
      2  0x000003fffda65a24 in virObjectLock (anyobj=0x3ffe08c1db0) at
      ../../src/util/virobject.c:317
      3  0x000003fffdba4688 in
      virNetClientIOEventLoop (client=client@entry=0x3ffe08c1db0,
      thiscall=thiscall@entry=0x2aa000fbfa0) at
      ../../src/rpc/virnetclient.c:1668
      4  0x000003fffdba4b4c in
      virNetClientIO (client=client@entry=0x3ffe08c1db0,
      thiscall=0x2aa000fbfa0) at ../../src/rpc/virnetclient.c:1944
      5  0x000003fffdba4d42 in
      virNetClientSendInternal (client=client@entry=0x3ffe08c1db0,
      msg=msg@entry=0x2aa000cc710, expectReply=expectReply@entry=true,
      nonBlock=nonBlock@entry=false) at ../../src/rpc/virnetclient.c:2116
      6  0x000003fffdba6268 in
      virNetClientSendWithReply (client=0x3ffe08c1db0, msg=0x2aa000cc710) at
      ../../src/rpc/virnetclient.c:2144
      7  0x000003fffdba6e8e in virNetClientProgramCall (prog=0x3ffe08c1120,
      client=<optimized out>, serial=<optimized out>, proc=<optimized out>,
      noutfds=<optimized out>, outfds=0x0, ninfds=0x0, infds=0x0,
      args_filter=0x3fffdb64440
      <xdr_virLogManagerProtocolDomainReadLogFileArgs>, args=0x3ffffffe010,
      ret_filter=0x3fffdb644c0
      <xdr_virLogManagerProtocolDomainReadLogFileRet>, ret=0x3ffffffe008) at
      ../../src/rpc/virnetclientprogram.c:329
      8  0x000003fffdb64042 in
      virLogManagerDomainReadLogFile (mgr=<optimized out>, path=<optimized
      out>, inode=<optimized out>, offset=<optimized out>, maxlen=<optimized
      out>, flags=0) at ../../src/logging/log_manager.c:272
      9  0x000003ffe9e0315c in qemuDomainLogContextRead (ctxt=0x3ffe08c2980,
      msg=0x3ffffffe1c0) at ../../src/qemu/qemu_domain.c:4422
      10 0x000003ffe9e280a8 in qemuProcessReadLog (logCtxt=<optimized out>,
      msg=msg@entry=0x3ffffffe288) at ../../src/qemu/qemu_process.c:1800
      11 0x000003ffe9e28206 in qemuProcessReportLogError (logCtxt=<optimized
      out>, msgprefix=0x3ffe9ec276a "qemu unexpectedly closed the monitor")
      at ../../src/qemu/qemu_process.c:1836
      12 0x000003ffe9e28306 in
      qemuProcessMonitorReportLogError (mon=mon@entry=0x3ffe085cf10,
      msg=<optimized out>, opaque=<optimized out>) at
      ../../src/qemu/qemu_process.c:1856
      13 0x000003ffe9e452b6 in qemuMonitorIO (watch=<optimized out>,
      fd=<optimized out>, events=<optimized out>, opaque=0x3ffe085cf10) at
      ../../src/qemu/qemu_monitor.c:726
      14 0x000003fffda2e1a4 in virEventPollDispatchHandles (nfds=<optimized
      out>, fds=0x2aa000fd980) at ../../src/util/vireventpoll.c:508
      15 0x000003fffda2e398 in virEventPollRunOnce () at
      ../../src/util/vireventpoll.c:657
      16 0x000003fffda2ca10 in virEventRunDefaultImpl () at
      ../../src/util/virevent.c:314
      17 0x000003fffdba9366 in virNetDaemonRun (dmn=0x2aa000cc550) at
      ../../src/rpc/virnetdaemon.c:818
      18 0x000002aa00024668 in main (argc=<optimized out>, argv=<optimized
      out>) at ../../daemon/libvirtd.c:1541
      
      Other code parts where the same problem was possible to occur are
      fixed as well (qemuMigrationFinish, qemuProcessStart, and
      qemuDomainSaveImageStartVM).
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reported-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      20e95cb7
  12. 07 4月, 2017 3 次提交