Bug 494005 - libvirt should sanitize pool paths
libvirt should sanitize pool paths
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Cole Robinson
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-03 13:06 EDT by Jesse Keating
Modified: 2013-01-09 22:29 EST (History)
11 users (show)

See Also:
Fixed In Version: libvirt-0.7.1-18.fc12
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-07-08 14:18:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Jesse Keating 2009-04-03 13:06:59 EDT
I added a storage pool that was a directory that has a live iso in it, then I tried to create a guest using the live iso as the "install" media.  I was told no, and this is the log:

[Fri, 03 Apr 2009 09:54:13 virt-manager 7648] DEBUG (VirtualDisk:442) Path '/srv/mirror/releases/test/11-Beta/Live/F11-Beta-x86_64-Live-KDE' is target for pool 'F11-Beta-x86_64-Live-KDE'. Creating volume 'F11-Beta-x86_64-Live-KDE.iso'.
[Fri, 03 Apr 2009 09:54:13 virt-manager 7648] ERROR (storagebrowse:273) Failed to determine if storage volume in use.
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/storagebrowse.py", line 266, in populate_storage_volumes
    size=.001)
  File "/usr/lib/python2.6/site-packages/virtinst/VirtualDisk.py", line 180, in __init__
    self.__validate_params()
  File "/usr/lib/python2.6/site-packages/virtinst/VirtualDisk.py", line 523, in __validate_params
    self.__check_if_path_managed()
  File "/usr/lib/python2.6/site-packages/virtinst/VirtualDisk.py", line 453, in __check_if_path_managed
    capacity=cap, allocation=alloc, pool=pool)
  File "/usr/lib/python2.6/site-packages/virtinst/Storage.py", line 954, in __init__
    conn=conn)
  File "/usr/lib/python2.6/site-packages/virtinst/Storage.py", line 705, in __init__
    name=name, conn=self.pool._conn)
  File "/usr/lib/python2.6/site-packages/virtinst/Storage.py", line 92, in __init__
    self.name = name
  File "/usr/lib/python2.6/site-packages/virtinst/Storage.py", line 123, in set_name
    self._check_name_collision(val)
  File "/usr/lib/python2.6/site-packages/virtinst/Storage.py", line 855, in _check_name_collision
    name))
ValueError: Name 'F11-Beta-x86_64-Live-KDE.iso' already in use by another volume.
[Fri, 03 Apr 2009 09:54:13 virt-manager 7648] DEBUG (VirtualDisk:442) Path '/srv/mirror/releases/test/11-Beta/Live/F11-Beta-x86_64-Live-KDE' is target for pool 'F11-Beta-x86_64-Live-KDE'. Creating volume 'F11-Beta-x86_64-Live-KDE.log'.
[Fri, 03 Apr 2009 09:54:13 virt-manager 7648] ERROR (storagebrowse:273) Failed to determine if storage volume in use.
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/storagebrowse.py", line 266, in populate_storage_volumes
    size=.001)
  File "/usr/lib/python2.6/site-packages/virtinst/VirtualDisk.py", line 180, in __init__
    self.__validate_params()
  File "/usr/lib/python2.6/site-packages/virtinst/VirtualDisk.py", line 523, in __validate_params
    self.__check_if_path_managed()
  File "/usr/lib/python2.6/site-packages/virtinst/VirtualDisk.py", line 453, in __check_if_path_managed
    capacity=cap, allocation=alloc, pool=pool)
  File "/usr/lib/python2.6/site-packages/virtinst/Storage.py", line 954, in __init__
    conn=conn)
  File "/usr/lib/python2.6/site-packages/virtinst/Storage.py", line 705, in __init__
    name=name, conn=self.pool._conn)
  File "/usr/lib/python2.6/site-packages/virtinst/Storage.py", line 92, in __init__
    self.name = name
  File "/usr/lib/python2.6/site-packages/virtinst/Storage.py", line 123, in set_name
    self._check_name_collision(val)
  File "/usr/lib/python2.6/site-packages/virtinst/Storage.py", line 855, in _check_name_collision
    name))
ValueError: Name 'F11-Beta-x86_64-Live-KDE.log' already in use by another volume.
[Fri, 03 Apr 2009 09:54:21 virt-manager 7648] DEBUG (DistroInstaller:134) Size must be specified for non existent volume path '/srv/mirror/releases/test/11-Beta/Live/F11-Beta-x86_64-Live-KDE/F11-Beta-x86_64-Live-KDE.iso'
[Fri, 03 Apr 2009 09:54:21 virt-manager 7648] DEBUG (error:97) Validation Error: Error setting install media location.
[Fri, 03 Apr 2009 09:54:52 virt-manager 7648] DEBUG (DistroInstaller:134) Size must be specified for non existent volume path '/srv/mirror/releases/test/11-Beta/Live/F11-Beta-x86_64-Live-KDE/F11-Beta-x86_64-Live-KDE.iso'
[Fri, 03 Apr 2009 09:54:52 virt-manager 7648] DEBUG (error:97) Validation Error: Error setting install media location.
Comment 1 Mark McLoughlin 2009-04-06 04:26:46 EDT
This:

ValueError: Name 'F11-Beta-x86_64-Live-KDE.iso' already in use by another
volume.

Sounds like virtinst thinks the volume doesn't exist and is trying to create it.

Did you perhaps create the pool, then copy the iso in and then try and create the guest? Does "virsh pool-list" list it? Try "virsh pool-refresh"?

Any SELinux errors?
Comment 2 Cole Robinson 2009-04-06 08:21:28 EDT
Jesse and I followed up offline when the bug was filed. You can't tell from the error message, but the issue is that the storage pool was defined with a spurious ending '/', like:

/some/pool/directory//

Libvirt doesn't sanitize the path at define time, but virtinst likely is when it's trying to lookup the volume path. Should be an easy fix, I'll take a look at this today.
Comment 3 Bug Zapper 2009-06-09 09:13:25 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 4 Cole Robinson 2010-02-26 20:53:16 EST
Reassigning this to libvirt with a proper description.
Comment 5 Bug Zapper 2010-04-27 09:29:14 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Jesse Keating 2010-04-27 11:44:48 EDT
AFAIK this is still an issue.  putting it on rawhide and using keyword to avoid the bugzappers.
Comment 7 Daniel Berrange 2010-04-27 11:55:52 EDT
Moving to the upstream bug tracker, since this requires some dev effort beyond scope of fedora bug fixing.
Comment 8 Cole Robinson 2010-06-03 14:54:49 EDT
This is fixed upstream now:

http://libvirt.org/git/?p=libvirt.git;a=commit;h=a7fb2258cac63b2420b51d5720a6e2b8734d818d

But we should backport to fedora, since the error case here causes lots of confusion for virt-manager users.
Comment 9 Fedora Update System 2010-06-17 12:55:57 EDT
libvirt-0.7.1-18.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/libvirt-0.7.1-18.fc12
Comment 10 Fedora Update System 2010-06-21 09:02:41 EDT
libvirt-0.7.1-18.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update libvirt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/libvirt-0.7.1-18.fc12
Comment 11 Fedora Update System 2010-07-08 14:17:31 EDT
libvirt-0.7.1-18.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

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