• D
    Make checks for inactive QEMU guest more robust · 8d616dec
    Daniel P. Berrange 提交于
    Before issuing monitor commands it is neccessary to check whether
    the guest is still running. Most places use virDomainIsActive()
    correctly, but a few relied on 'priv->mon != NULL'. In theory
    these should be equivalent, but the release of the last reference
    count on priv->mon can be delayed a small amount of time until
    the event handler is finally deregistered. A further ref counting
    bug also means that priv->mon might be never released. In such a
    case, code could mistakenly issue a monitor command and wait for
    a response that will never arrive, effectively leaving the QEMU
    driver waiting on virCondWait() forever..
    
    To protect against these possibilities, make sure all code uses
    virDomainIsActive(), not 'priv->mon != NULL'
    
    * src/qemu/qemu_driver.c: Replace 'priv->mon != NULL' with
      calls to 'priv->mon != NULL'()
    8d616dec
qemu_driver.c 374.5 KB