• L
    qemu: new GRACEFUL flag for virDomainDestroy w/ QEMU support · 72f8a7f1
    Laine Stump 提交于
    When libvirt's virDomainDestroy API is shutting down the qemu process,
    it first sends SIGTERM, then waits for 1.6 seconds and, if it sees the
    process still there, sends a SIGKILL.
    
    There have been reports that this behavior can lead to data loss
    because the guest running in qemu doesn't have time to flush its disk
    cache buffers before it's unceremoniously whacked.
    
    This patch maintains that default behavior, but provides a new flag
    VIR_DOMAIN_DESTROY_GRACEFUL to alter the behavior. If this flag is set
    in the call to virDomainDestroyFlags, SIGKILL will never be sent to
    the qemu process; instead, if the timeout is reached and the qemu
    process still exists, virDomainDestroy will return an error.
    
    Once this patch is in, the recommended method for applications to call
    virDomainDestroyFlags will be with VIR_DOMAIN_DESTROY_GRACEFUL
    included. If that fails, then the application can decide if and when
    to call virDomainDestroyFlags again without
    VIR_DOMAIN_DESTROY_GRACEFUL (to force the issue with SIGKILL).
    
    (Note that this does not address the issue of existing applications
    that have not yet been modified to use VIR_DOMAIN_DESTROY_GRACEFUL.
    That is a separate patch.)
    72f8a7f1
libvirt.c 534.9 KB