Bug 636160 - RFE: quit API: Support a domain quit API
Summary: RFE: quit API: Support a domain quit API
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: libvirtTodoHV
TreeView+ depends on / blocked
 
Reported: 2010-09-21 15:17 UTC by Daniel Berrangé
Modified: 2015-01-15 12:21 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-01-15 12:21:38 UTC
Embargoed:


Attachments (Terms of Use)

Description Daniel Berrangé 2010-09-21 15:17:25 UTC
Description of problem:
Support an API for shutting down a guest which is less drastic than virDomainDestroy, but more forceful than virDomainShutdown. This lets QEMU safely flush out any pending data & cleanly shutdown.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Daniel Berrangé 2015-01-15 12:21:38 UTC
commit 72f8a7f19753506ed957b78ad800c0f3892c9304
Author: Laine Stump <laine>
Date:   Fri Jan 27 13:28:23 2012 -0500

    qemu: new GRACEFUL flag for virDomainDestroy w/ QEMU support
    
    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.)


Note You need to log in before you can comment on or make changes to this bug.