Bug 639926

Summary: libvirt qemu driver should disallow domain names containing comma
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: crobinso, eblake, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-16 14:35:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2010-10-04 10:45:01 UTC
Description of problem:

The libvirt qemu driver allows you to create domain names which
contain a ',' (comma) character.

However qemu will not allow these domains to start up.  The
reason is that the qemu -name parameter must not contain a
comma, since that might be used to delimit other suboptions
in future.

The error message you get is:

  error: Failed to start domain ,
  error: internal error process exited while connecting to monitor: Unknown suba
rgument  to -name

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

libvirt-0.8.3-2.fc14.x86_64

How reproducible:

Always.

Steps to Reproduce:
1. Create a qemu or KVM domain where the name contains a comma.
2.
3.

Upstream discussion:

https://www.redhat.com/archives/libvir-list/2010-October/thread.html#00053

Comment 1 Eric Blake 2012-04-19 23:28:59 UTC
Rather, libvirt should be fixed to borrow ideas from this commit, and use those ideas to properly escape commas in domain names:

commit 6e0ff1d4024ca44fab307a89da1968f7b03cd482
Author: Eric Blake <eblake>
Date:   Fri Mar 9 16:13:30 2012 -0300

    qemu: support disk filenames with comma
    
    If there is a disk file with a comma in the name, QEmu expects a double
    comma instead of a single one (e.g., the file "virtual,disk.img" needs
    to be specified as "virtual,,disk.img" in QEmu's command line). This
    patch fixes libvirt to work with that feature. Fix RHBZ #801036.
    
    Based on an initial patch by Crístian Viana.

Comment 2 Cole Robinson 2016-04-22 22:47:57 UTC
Patches sent upstream:

http://www.redhat.com/archives/libvir-list/2016-April/msg01594.html

Comment 3 Cole Robinson 2016-05-16 14:35:55 UTC
Upstream now, last patch was:

commit 7dbbc0ca07f0e8f2f3652afe4a3f7d94940bef1e
Author: Cole Robinson <crobinso>
Date:   Fri Apr 22 18:27:44 2016 -0400

    qemu: command: escape commas in chardev socket path
    
    After this, a default virt-manager VM will startup with a comma
    in the VM name:
    
    https://bugzilla.redhat.com/show_bug.cgi?id=639926