Bug 727508 - Screenshot fills up /var/cache/libvirt/qemu
Summary: Screenshot fills up /var/cache/libvirt/qemu
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Privoznik
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-02 10:35 UTC by Marc-Andre Lureau
Modified: 2011-08-04 01:37 UTC (History)
5 users (show)

Fixed In Version: libvirt-0.9.4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-04 01:37:46 UTC


Attachments (Terms of Use)

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


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