[Kimchi-devel] [PATCH] Github issue #306: Creating a guest OS whose name contain spaces causes it to fail.

Aline Manera alinefm at linux.vnet.ibm.com
Fri Jan 24 00:40:14 UTC 2014


On 01/23/2014 08:57 PM, Otavio Rodolfo Piske wrote:
> I see your point. I did a quick research and it seems to be a 
> limitation on virt-aa-helper:
>
> root at orpiske:/etc/libvirt/qemu# cat ubuntu_12_04\ with\ spaces.xml | 
> /usr/lib/libvirt/virt-aa-helper -d -p 0 -r -u 
> libvirt-61d77fad-bb1f-49fa-93e1-2b70a5cb8f4c ; echo $?
> virt-aa-helper: error: bad name
> virt-aa-helper: error: could not get VM definition
> 1
>
> Whereas, this works:
>
> root at orpiske:/etc/libvirt/qemu# cat ubuntu_12_04.xml | 
> /usr/lib/libvirt/virt-aa-helper -d -p 0 -r -u 
> libvirt-d020c07a-b8d5-40f3-b02b-3df5ed6d06b3 ; echo $?
> virt-aa-helper:
> /etc/apparmor.d/libvirt/libvirt-d020c07a-b8d5-40f3-b02b-3df5ed6d06b3.files
> virt-aa-helper:
>   "/var/log/libvirt/**/ubuntu_12_04.log" w,
>   "/var/lib/libvirt/**/ubuntu_12_04.monitor" rw,
>   "/var/run/libvirt/**/ubuntu_12_04.pid" rwk,
>   "/run/libvirt/**/ubuntu_12_04.pid" rwk,
>   "/var/run/libvirt/**/*.tunnelmigrate.dest.ubuntu_12_04" rw,
>   "/run/libvirt/**/*.tunnelmigrate.dest.ubuntu_12_04" rw,
> "/var/lib/libvirt/images/d020c07a-b8d5-40f3-b02b-3df5ed6d06b3-0.img" rw,
>   "/home/orpiske/vms/isos/ubuntu-12.04.3-desktop-i386.iso" r,
>   # don't audit writes to readonly files
>   deny "/home/orpiske/vms/isos/ubuntu-12.04.3-desktop-i386.iso" w,
>
> 0
>
> I decided to dig further and I took a look at virt-aa-helper source 
> code and it does, indeed, check if the name does not contain spaces 
> (as well as one of /, [, ] and *). Because of that, it seems that it's 
> unable to load/recreate (?) the profile.
>

Do you mean libvirt blocks domain name with those characters?

As Cristian mentioned, it seems to be a Ubuntu only problem.

Which Ubuntu version are you using?
What is the libvirt version?

I find this problem on Ubuntu 12.10 and libvirt 0.9.13

alinefm at alinefm:~/libvirt$ libvirtd --version
libvirtd (libvirt) 0.9.13

But I've just checked the latest libvirt (from source code) on same 
Ubuntu node and I was able to create and start a domain (which name 
contains spaces)
The current upstream version is 1.2.1

alinefm at alinefm:~/libvirt$ sudo ./daemon/libvirtd -d
alinefm at alinefm:~/libvirt$ sudo tools/virsh -c qemu:///system
Welcome to lt-virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
        'quit' to quit

virsh # list --all
  Id    Name                           State
----------------------------------------------------
  -     fedora18-iso-stream            shut off
  -     Fedora19                       shut off
  -     openSUSE-13-1                  shut off
  -     RHEL6.5                        shut off
  -     Ubuntu13-10                    shut off
  -     with spaces                    shut off

virsh # start 'with spaces'
Domain with spaces started

virsh # destroy 'with spaces'
Domain with spaces destroyed




> Does it make sense to you? And, if yes, what would you suggest as an 
> appropriate work-around in this case?
>
>
> On Thu, Jan 23, 2014 at 5:48 PM, Aline Manera 
> <alinefm at linux.vnet.ibm.com <mailto:alinefm at linux.vnet.ibm.com>> wrote:
>
>     On 01/22/2014 07:19 PM, Crístian Viana wrote:
>
>         As I added to the GitHub issue page
>         (https://github.com/kimchi-project/kimchi/issues/306#issuecomment-33068988),
>         I don't think having a space in a VM's name is a problem. I am
>         able to create a VM named "hello world" using Kimchi and virsh.
>
>         We should not add a limitation like this one to Kimchi (i.e.
>         restricting the VM name) if there's not a real reason to.
>
>
>     Agree.
>
>     Seems this problem is on a deeper layer.
>     In a quick search on the internet I found a lot of forums related
>     to "libvirtError: internal error cannot load AppArmor profile"
>     We need to investigate more to find the root cause.
>
>
>         Am 22-01-2014 19:01, schrieb Otavio R. Piske:
>
>             From: "Otavio R. Piske" <angusyoung at gmail.com
>             <mailto:angusyoung at gmail.com>>
>
>             Kimchi fails to start the guest OS if the user names it
>             with spaces. As pointed in the issue #306, other VM
>             management interfaces prevent the user from creating a
>             guest OS if the name contain invalid characters.
>
>             This patch adds a validation logic that prevents the user
>             from naming a Guest OS with anything other than
>             alphanumeric chars, '-', '.' or '_'.
>
>             Signed-off-by: Otavio R. Piske <angusyoung at gmail.com
>             <mailto:angusyoung at gmail.com>>
>
>
>         _______________________________________________
>         Kimchi-devel mailing list
>         Kimchi-devel at ovirt.org <mailto:Kimchi-devel at ovirt.org>
>         http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>
>
>
>
>
> -- 
> Otavio R. Piske
> http://orpiske.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20140123/36375954/attachment.html>


More information about the Kimchi-devel mailing list