diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 2d5718301e..1275f4530d 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -1237,6 +1237,7 @@ int virDomainDestroy (virDomainPtr domain); typedef enum { VIR_DOMAIN_DESTROY_DEFAULT = 0, /* Default behavior - could lead to data loss!! */ VIR_DOMAIN_DESTROY_GRACEFUL = 1 << 0, /* only SIGTERM, no SIGKILL */ + VIR_DOMAIN_DESTROY_REMOVE_LOGS = 1 << 1, /* remove VM logs on destroy */ } virDomainDestroyFlagsValues; int virDomainDestroyFlags (virDomainPtr domain, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 53efb60406..cbd7902d2d 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -524,6 +524,12 @@ virDomainDestroy(virDomainPtr domain) * timeout; at that time, the management application can decide if * calling again without VIR_DOMAIN_DESTROY_GRACEFUL is appropriate. * + * If VIR_DOMAIN_DESTROY_REMOVE_LOGS flag is set then domain specific + * logs will be deleted as well if there are any. Note that not all + * deployments are be supported. For example in case of QEMU driver + * this flags is noop if virtlogd is not used for handling QEMU + * process output. + * * Another alternative which may produce cleaner results for the * guest's disks is to use virDomainShutdown() instead, but that * depends on guest support (some hypervisor/guest combinations may