• D
    Fix performance & reliabilty of QMP probing · 1b253a10
    Daniel P. Berrange 提交于
    This previous commit
    
      commit 1a50ba2c
      Author: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      Date:   Mon Nov 26 15:17:13 2012 +0100
    
        qemu: Fix QMP Capabability Probing Failure
    
    which attempted to make sure the QEMU process used for probing
    ran as the right user id, caused serious performance regression
    and unreliability in probing. The -daemonize switch in QEMU
    guarantees that the monitor socket is present before the parent
    process exits. This means libvirtd is guaranteed to be able to
    connect immediately. By switching from -daemonize to the
    virCommandDaemonize API libvirtd was no longer synchronized with
    QEMU's startup process. The result was that the QEMU monitor
    failed to open and went into its 200ms sleep loop. This happened
    for all 25 binaries resulting in 5 seconds worth of sleeping
    at libvirtd startup. In addition sometimes when libvirt connected,
    QEMU would be partially initialized and crash causing total
    failure to probe that binary.
    
    This commit reverts the previous change, ensuring we do use the
    -daemonize flag to QEMU. Startup delay is cut from 7 seconds
    to 2 seconds on my machine, which is on a par with what it was
    prior to the capabilities rewrite.
    
    To deal with the fact that QEMU needs to be able to create the
    pidfile, we switch pidfile location fron runDir to libDir, which
    QEMU is guaranteed to be able to write to.
    Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
    1b253a10
qemu_capabilities.h 12.8 KB