Bug 957077 - Convert guest domain XML config to a native guest configuration format occur an unknown error.
Convert guest domain XML config to a native guest configuration format occur ...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-26 06:13 EDT by zzhong@redhat.com
Modified: 2014-06-17 20:49 EDT (History)
7 users (show)

See Also:
Fixed In Version: libvirt-1.0.5-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 05:39:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description zzhong@redhat.com 2013-04-26 06:13:58 EDT
Description of problem:

 Convert guest domain XML config to a native guest configuration format occur an unknown error.


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

 libvirt-1.0.4-1.1.el7.x86_64
 qemu-kvm-1.4.0-2.1.el7.x86_64
 kernel-3.8.0-0.43.el7.x86_64


How reproducible:
100%



Steps to Reproduce:

1: config qemu.conf to support tls
  1.1 uncomment the following settings in qemu.conf
    spice_listen = "0.0.0.0"
    spice_tls = 1
    spice_tls_x509_cert_dir = "/etc/pki/libvirt-spice"
  1.2 erform the following script, to generate the cert files for ssl , and then copy *.pem file info /etc/pkil/libvirt-spice directory
#!/bin/bash

SERVER_KEY=server-key.pem

# creating a key for our ca
if [ ! -e ca-key.pem ]; then
    openssl genrsa -des3 -out ca-key.pem 1024
fi
# creating a ca
if [ ! -e ca-cert.pem ]; then
    openssl req -new -x509 -days 1095 -key ca-key.pem -out ca-cert.pem  -subj "/C=IL/L=Raanana/O=Red Hat/CN=my CA"
fi
# create server key
if [ ! -e $SERVER_KEY ]; then
    openssl genrsa -out $SERVER_KEY 1024
fi
# create a certificate signing request (csr)
if [ ! -e server-key.csr ]; then
    openssl req -new -key $SERVER_KEY -out server-key.csr -subj "/C=IL/L=Raanana/O=Red Hat/CN=my server"
fi
# signing our server certificate with this ca
if [ ! -e server-cert.pem ]; then
    openssl x509 -req -days 1095 -in server-key.csr -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
fi

# now create a key that doesn't require a passphrase
openssl rsa -in $SERVER_KEY -out $SERVER_KEY.insecure
mv $SERVER_KEY $SERVER_KEY.secure
mv $SERVER_KEY.insecure $SERVER_KEY

# show the results (no other effect)
openssl rsa -noout -text -in $SERVER_KEY
openssl rsa -noout -text -in ca-key.pem
openssl req -noout -text -in server-key.csr
openssl x509 -noout -text -in server-cert.pem
openssl x509 -noout -text -in ca-cert.pem

# copy *.pem file to /etc/pki/libvirt-spice
if [[ -d "/etc/pki/libvirt-spice" ]] 
then
    cp ./*.pem /etc/pki/libvirt-spice
else
    mkdir /etc/pki/libvirt-spice
        cp ./*.pem /etc/pki/libvirt-spice
fi

# echo --host-subject
echo "your --host-subject is" \" `openssl x509 -noout -text -in server-cert.pem | grep Subject: | cut -f 10- -d " "` \"
2:
echo '<?xml version="1.0"?>
<domain type="kvm">
  <name>tls-only</name>
  <memory>32768</memory>
  <os>
    <type arch="x86_64" machine="pc">hvm</type>
  </os>
  <devices>
    <graphics type="spice" tlsPort="5800" passwd="123" >
      <listen type="address" address="::" />
    </graphics>
    <video>
      <model type="qxl" vram="32768" heads="1"/>
    </video>
  </devices>
</domain>' | virsh domxml-to-native qemu-argv /dev/stdin
  
Actual results:
    error: An error occurred, but the cause is unknown

Expected results:
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=spice /usr/libexec/qemu-kvm -name tls-only -S -M pc -enable-kvm -m 32 -smp 1,sockets=1,cores=1,threads=1 -uuid 74377671-f095-aa5b-031b-2c5037b81977 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/tls-only.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -no-acpi -device piix3-usb-uhci,id=usb -spice tls-port=5800,addr=::,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on -vga qxl -global qxl-vga.vram_size=33554432 -device virtio-balloon-pci,id=balloon0

Additional info:
Comment 2 Ján Tomko 2013-04-26 07:57:59 EDT
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2013-April/msg01910.html
Comment 3 Ján Tomko 2013-04-30 04:49:16 EDT
Fixed upstream by:
commit 11fc1beab6e018a88182f80056d35217c150b3de
Author:     Ján Tomko <jtomko@redhat.com>
AuthorDate: 2013-04-29 19:54:07 +0200
Commit:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2013-04-30 10:23:44 +0200

    qemu: assign addresses when converting xml to native
    
    This adds addresses to domxml-to-native output and chooses
    the correct virtio devices for ccw and s390 machines.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=957077
Comment 4 zzhong@redhat.com 2013-05-07 21:00:48 EDT
verify with build:
libvirt-1.0.5-1.el7.x86_64
qemu-kvm-1.4.0-4.el7.x86_64
3.8.0-0.43.el7.x86_64

step is same with the description.

[root@zzhong test20130425]#echo '
<domain type="kvm">
<name>tls-only</name>
<memory>32768</memory>
<os>
<type arch="x86_64" machine="pc">hvm</type>
</os>
<devices>
<graphics type="spice" tlsPort="5800" passwd="123" >
<listen type="address" address="::" />
</graphics>
<video>
<model type="qxl" vram="32768" heads="1"/>
</video>
</devices>
</domain>' | virsh domxml-to-native qemu-argv /dev/stdin
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin QEMU_AUDIO_DRV=spice /usr/libexec/qemu-kvm -name tls-only -S -machine pc,accel=kvm,usb=off -m 32 -smp 1,sockets=1,cores=1,threads=1 -uuid 30c6c8cb-f6d2-4aea-9f0c-05deccd6c45f -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/tls-only.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -no-acpi -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -spice tls-port=5800,addr=::,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3

not occur an unknown error.verification passed.
Comment 6 Ludek Smid 2014-06-13 05:39:42 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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