Bug 727508

Summary: Screenshot fills up /var/cache/libvirt/qemu
Product: [Community] Virtualization Tools Reporter: Marc-Andre Lureau <marcandre.lureau>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, eblake, veillard, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-04 01:37:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Marc-Andre Lureau 2011-08-02 10:35:10 UTC
Description of problem:

It is easy to have each screenshot ~2Mb. With that kind of size, /var can be quickly filled up

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

current 0.9+

How reproducible:

100%

Steps to Reproduce:
1. Use virDomainScreenshot() 
2. repeat until /var is full.
  

Expected results:

virDomainScreenshot() shouldn't fill /var

At the minimum, it could perhaps reuse the same file?

Comment 1 Daniel Berrangé 2011-08-02 11:25:00 UTC
The screenshot file should never persist in /var, rather we should be unlinking it immediately after creating it. Some aspect of this must be broken...

Comment 2 Michal Privoznik 2011-08-02 15:37:51 UTC
Patch sent upstream for review:

https://www.redhat.com/archives/libvir-list/2011-August/msg00091.html

Comment 3 Eric Blake 2011-08-02 17:12:45 UTC
First patch now upstream:
commit d68b97c8a641ca3d56c7031eb49526174257280b
Author: Michal Privoznik <mprivozn>
Date:   Tue Aug 2 17:50:18 2011 +0200

    qemu: Unlink temporary file on failure
    
    Although virFDStreamOpenFile will unlink it once opened, when we hit
    error path, we must unlink it by hand.

But we may want to also use this second proposed patch:
https://www.redhat.com/archives/libvir-list/2011-August/msg00103.html

Comment 4 Daniel Veillard 2011-08-04 01:37:46 UTC
Fixed in libvirt-0.9.4