virt-manager does not escape apostrophes

Bug #383510 reported by Tim Allen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
virt-manager (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: virt-manager

What you'll need:
 - An actual ISO9660 image, bootable or not.
 - A file with an apostrophe in the name (such as "a'b.iso", without the
   double-quotes)

Steps to reproduce:
 1. Start virt-manager
 2. Create a new VM.
 3. Go through all the pages of the setup wizard, accepting the defaults.
    - When it asks for installation media, you'll want to pick your actual ISO
      image.
    - When it asks whether you want to allocate the hard-disk image, you
      needn't bother as it's never going to be used anyway.
 4. After the wizard, the VM is automatically booted up. Hit "Force Off" to
    shut down the VM.
 5. Go to the "Hardware" tab, select the virtual CD-ROM device, and click
    "connect".
 6. Make sure "ISO Image Location" is selected, then click "Browse" and pick
    the file you created earlier with an apostrophe in the name.
 7. Click OK.

Expected result:
 - "Source Path" updates with the path to the selected ISO.

Actual result:
 - "Source Path" isn't updated.

The problems are actually more severe than that:
 8. Click "Connect" again, notice that the "ISO Location" field is correctly
    filled out.
 9. Click OK.
10. This time, you get an error dialog:

 Error Connecting CDROM: xmlParseDoc() failed

11. Click "Close" on the error dialog.
12. Close all the virt-manager windows to quit it.
13. Start virt-manager again.
14. Select the VM you created earlier, then click the "Open" button at the
    bottom of the window.
15. You get an error dialog:

 Error bringing up domain details: Error parsing domain xml:
 xmlParseDoc() failed.

If you examine the contents of the domain settings file in /etc/libvirt/qemu/, you'll see it contains a line like this:

    <source file='/home/username/a'b.iso'/>

Deleting the extra apostrophe and restarting libvirtd is sufficient to restore the usual operation of virt-manager.

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
Package: virt-manager 0.6.1-1ubuntu4
ProcEnviron:
 PATH=(cuusernameom, user)
 LANG=en_AU.UTF-8
 SHELL=/bin/bash
SourcePackage: virt-manager
Uname: Linux 2.6.28-11-generic x86_64

Revision history for this message
Tim Allen (screwtape) wrote :
Revision history for this message
Andrew Bloxom (abloxom) wrote :

Thank you for posting this bug report, it saved me immense amounts of frustration. A work around for me was to put the ISO in a path that did not include an apostrophe.

For me the path was a CIFS share on a Windows box where spaces and apostrophes are pretty common and are used to indicate ownership:

//server/Andrew's Files/XPInstall.ISO

I wasn't aware of the XML file though. moving the ISO to an apostropheless path was good enough for me. :)

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

This now works correctly in the version of virt-manager that is in Lucid. Closing bug.

Changed in virt-manager (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.