Bug 461930

Summary: Storage driver does not report error messages from commands it runs
Product: [Fedora] Fedora Reporter: Daniel Berrange <berrange>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: berrange, crobinso, hbrock
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-06 19:49:08 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 461925    
Bug Blocks:    

Description Daniel Berrange 2008-09-11 10:20:33 EDT
+++ This bug was initially created as a clone of Bug #461925 +++

Created an attachment (id=316444)

Description of problem:

Error occured while creating a bochs storage volume in a directory storage pool.

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


How reproducible:

Steps to Reproduce:
1. Create a 'dir' storage pool
2. Create a 'bochs' storage volume of max/alloc == 2000/2000
Actual results:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/createvol.py", line 191, in _async_vol_create
    poolobj = self.vol.install(meter=meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Storage.py", line 893, in install
    (self.name, str(e)))
RuntimeError: Couldn't create storage volume 'virt-stor-dir-bochs.img': '/usr/bin/qemu-img exited with non-zero status 1 and signal 0'

Expected results:
no traceback

Additional info:

* See attached screenshot. 
* Please advise if additional information/logfiles are needed.
Comment 1 Daniel Berrange 2008-09-11 10:22:18 EDT
The core problem here is that  while libvirt  can tell qemu-img failed, it is not capturing the data on stderr. We need to make the storage driver capture stderr and include it in the libvirt error message. If this were done we'd get the useful error message

qemu-img: Formatting or formatting option not supported for file format 'bochs'

indicating bochs support is for 'query & conversion only, not creation of new volumes
Comment 2 Cole Robinson 2008-09-11 11:08:55 EDT
While we are in this code, I would like to see a macro or something to either log or just print to stderr the entire argv we are running. Not just for storage but anything calling virRun.
Comment 3 Daniel Berrange 2008-11-04 06:07:14 EST
Patches posted upstream

Comment 4 Cole Robinson 2008-12-06 19:49:08 EST
This is released as of version 0.5.0: error messages will now contain the full command line of the forked command, as well as the stderr of that command. 0.5.0 is in rawhide and now F10, so closing as CURRENTRELEASE.