Red Hat Bugzilla – Bug 496616
libvirt: a pool with the wrong config was defined in pool list
Last modified: 2016-04-26 10:56:15 EDT
Created attachment 340321 [details]
xml for storage pool creation
Description of problem:
a pool with the wrong config was defined in pool list, and it cannot be undefined.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a pool with wrong xml description (attached xml file)
2. # virsh pool-undefine test
Cannot undefine the created pool. The error messages as below:
error: Failed to undefine pool test
error: internal error no config file for test
The pool with wrong xml config should not be defined successfully.
Only reboot machine can make the pool destroy.
Looking at the code it appears the 'storagePoolCreate' method in storage_driver.c is missing a call virStoragePoolObjRemove in the failure path for the 'startPool' and 'refreshPool' calls.
I cannot see any workaround to this problem aside from restarting libvirtd. Since we recommand against restarting libvirtd, I think this is a serious enough bug to be made a blocker for 5.4
Reproduced the problem, which was fixed in git on 2009-06-22. Unfortunately, the fix that's upstream has the effect of destroying pools that already exist, so I'm doing a separate fix.
Created attachment 349968 [details]
The attached patch contains the upstream fix for this bug as well as a small fix to that fix that caused existing pools to be deleted if an attempt was made to create the same pool twice.
libvirt-0.6.3-14.el5 was built in dist-5E-qu-candidate with the fix,
This bug has been fixed with libvirt 0.6.3-14.el5 on RHEL-5.4. Set status to VERIFIED.
# virsh pool-create dir.xml
error: Failed to create pool from dir.xml
error: cannot open path '/pool': No such file or directory
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.