[virt-tools-list] [virt-manager][PATCH 1/3] Add a capatilities-xml for s390x, and add a clitest for it.

Cole Robinson crobinso at redhat.com
Wed Nov 4 19:45:48 UTC 2015


On 11/04/2015 01:30 AM, Kevin Zhao wrote:
> Add a capatilities xml file for s390x ,the capatility for IBM
> Distro called KVMIBM,mainly focus on a KVM hypervious on S390x.
> Also add a clitest by using virt-install.
> ---
>  tests/capabilities-xml/kvm-s390x-KVMIBM.xml        | 82 ++++++++++++++++++++++
>  .../compare/virt-install-s390x-KVMIBM.xml          | 39 ++++++++++
>  tests/clitest.py                                   |  1 +
>  tests/utils.py                                     |  1 +
>  4 files changed, 123 insertions(+)
>  create mode 100644 tests/capabilities-xml/kvm-s390x-KVMIBM.xml
>  create mode 100644 tests/cli-test-xml/compare/virt-install-s390x-KVMIBM.xml
> 
> diff --git a/tests/capabilities-xml/kvm-s390x-KVMIBM.xml b/tests/capabilities-xml/kvm-s390x-KVMIBM.xml
> new file mode 100644
> index 0000000..171266d
> --- /dev/null
> +++ b/tests/capabilities-xml/kvm-s390x-KVMIBM.xml
> @@ -0,0 +1,82 @@
> +# The xml comes from the Distro KVMIBM for s390x

This is not a valid XML comment. It needs to be

<!-- foo -->

> +<capabilities>
> +
> +  <host>
> +    <uuid>b53b15d6-348a-4620-afd3-81278b81fbd7</uuid>
> +    <cpu>
> +      <arch>s390x</arch>
> +      <model>host</model>
> +      <topology sockets="1" cores="4" threads="1"/>
> +      <pages unit="KiB" size="4"/>
> +      <pages unit="KiB" size="1024"/>
> +    </cpu>
> +    <power_management>
> +      <suspend_disk/>
> +      <suspend_hybrid/>
> +    </power_management>
> +    <migration_features>
> +      <live/>
> +      <uri_transports>
> +        <uri_transport>tcp</uri_transport>
> +        <uri_transport>rdma</uri_transport>
> +      </uri_transports>
> +    </migration_features>
> +    <topology>
> +      <cells num="1">
> +        <cell id="0">
> +          <memory unit="KiB">3911020</memory>
> +          <cpus num="4">
> +            <cpu id="0" socket_id="0" core_id="0" siblings="0"/>
> +            <cpu id="1" socket_id="0" core_id="1" siblings="1"/>
> +            <cpu id="2" socket_id="0" core_id="2" siblings="2"/>
> +            <cpu id="3" socket_id="0" core_id="3" siblings="3"/>
> +          </cpus>
> +        </cell>
> +      </cells>
> +    </topology>
> +    <secmodel>
> +      <model>selinux</model>
> +      <doi>0</doi>
> +      <baselabel type="kvm">system_u:system_r:svirt_t:s0</baselabel>
> +      <baselabel type="qemu">system_u:system_r:svirt_tcg_t:s0</baselabel>
> +    </secmodel>
> +    <secmodel>
> +      <model>dac</model>
> +      <doi>0</doi>
> +      <baselabel type="kvm">+107:+107</baselabel>
> +      <baselabel type="qemu">+107:+107</baselabel>
> +    </secmodel>
> +  </host>
> +
> +  <guest>
> +    <os_type>hvm</os_type>
> +    <arch name="s390x">
> +      <wordsize>64</wordsize>
> +      <emulator>/usr/bin/qemu-system-s390x</emulator>
> +      <machine maxCpus="64">s390-ccw-kvmibm-1.1.1</machine>
> +      <machine canonical="s390-ccw-kvmibm-1.1.1" maxCpus="64">s390-ccw-virtio</machine>
> +      <machine maxCpus="64">s390-ccw-kvmibm-1.1.0</machine>
> +      <machine maxCpus="255">s390-virtio</machine>
> +      <machine canonical="s390-virtio" maxCpus="255">s390</machine>
> +      <machine maxCpus="255">s390-ccw-virtio-2.4</machine>
> +      <domain type="qemu">
> +        <emulator>/usr/bin/qemu-system-s390x</emulator>
> +      </domain>
> +      <domain type="kvm">
> +        <emulator>/usr/bin/qemu-kvm</emulator>
> +        <machine maxCpus="64">s390-ccw-kvmibm-1.1.1</machine>
> +        <machine canonical="s390-ccw-kvmibm-1.1.1" maxCpus="64">s390-ccw-virtio</machine>
> +        <machine maxCpus="64">s390-ccw-kvmibm-1.1.0</machine>
> +        <machine maxCpus="255">s390-virtio</machine>
> +        <machine canonical="s390-virtio" maxCpus="255">s390</machine>
> +        <machine maxCpus="255">s390-ccw-virtio-2.4</machine>
> +      </domain>
> +    </arch>
> +    <features>
> +      <cpuselection/>
> +      <deviceboot/>
> +      <disksnapshot default="on" toggle="no"/>
> +    </features>
> +  </guest>
> +
> +</capabilities>
> diff --git a/tests/cli-test-xml/compare/virt-install-s390x-KVMIBM.xml b/tests/cli-test-xml/compare/virt-install-s390x-KVMIBM.xml
> new file mode 100644
> index 0000000..081c45d
> --- /dev/null
> +++ b/tests/cli-test-xml/compare/virt-install-s390x-KVMIBM.xml
> @@ -0,0 +1,39 @@
> +<domain type="kvm">
> +  <name>foobar</name>
> +  <uuid>00000000-1111-2222-3333-444444444444</uuid>
> +  <memory>65536</memory>
> +  <currentMemory>65536</currentMemory>
> +  <vcpu>1</vcpu>
> +  <os>
> +    <type arch="s390x" machine="s390-ccw-virtio">hvm</type>
> +    <kernel>/kernel.img</kernel>
> +    <initrd>/initrd.img</initrd>
> +  </os>
> +  <clock offset="utc"/>
> +  <on_poweroff>destroy</on_poweroff>
> +  <on_reboot>restart</on_reboot>
> +  <on_crash>restart</on_crash>
> +  <devices>
> +    <emulator>/usr/bin/qemu-kvm</emulator>
> +    <disk type="file" device="disk">
> +      <driver name="qemu" type="qcow2"/>
> +      <source file="/dev/default-pool/testvol1.img"/>
> +      <target dev="vda" bus="virtio"/>
> +    </disk>
> +    <disk type="file" device="cdrom">
> +      <driver name="qemu"/>
> +      <source file="/tmp/__virtinst_cli_exist1.img"/>
> +      <target dev="sda" bus="scsi"/>
> +      <readonly/>
> +    </disk>
> +    <interface type="network">
> +      <source network="default"/>
> +      <mac address="52:54:00:5c:68:3a"/>
> +    </interface>
> +    <console type="pty"/>
> +    <channel type="unix">
> +      <source mode="bind"/>
> +      <target type="virtio" name="org.qemu.guest_agent.0"/>
> +    </channel>
> +  </devices>
> +</domain>
> \ No newline at end of file
> diff --git a/tests/clitest.py b/tests/clitest.py
> index 7b4ebd4..6100fc2 100644
> --- a/tests/clitest.py
> +++ b/tests/clitest.py
> @@ -704,6 +704,7 @@ c.add_compare("--connect %(URI-KVM-PPC64LE)s --import --disk %(EXISTIMG1)s --os-
>  
>  # s390x tests
>  c.add_compare("--arch s390x --machine s390-ccw-virtio --connect %(URI-KVM-S390X)s --boot kernel=/kernel.img,initrd=/initrd.img --disk %(EXISTIMG1)s --disk %(EXISTIMG3)s,device=cdrom --os-variant fedora21", "s390x-cdrom")
> +c.add_compare("--arch s390x --machine s390-ccw-virtio --connect %(URI-KVM-S390X)s --boot kernel=/kernel.img,initrd=/initrd.img --disk %(EXISTIMG1)s --disk %(EXISTIMG3)s,device=cdrom --os-variant fedora21", "s390x-cdrom-KVMIBM")
>  
>  # qemu:///session tests
>  c.add_compare("--connect %(URI-KVM-SESSION)s --disk size=8 --os-variant fedora21 --cdrom %(EXISTIMG1)s", "kvm-session-defaults")
> diff --git a/tests/utils.py b/tests/utils.py
> index 748e808..2db01ee 100644
> --- a/tests/utils.py
> +++ b/tests/utils.py
> @@ -49,6 +49,7 @@ uri_kvm_armv7l = (_uri_kvm_domcaps + _capsprefix + "kvm-armv7l.xml")
>  uri_kvm_aarch64 = (_uri_kvm_domcaps + _capsprefix + "kvm-aarch64.xml")
>  uri_kvm_ppc64le = (_uri_kvm_domcaps + _capsprefix + "kvm-ppc64le.xml")
>  uri_kvm_s390x = (_uri_kvm_domcaps + _capsprefix + "kvm-s390x.xml")
> +uri_kvm_s390x-KVMIBM = (_uri_kvm_domcaps + _capsprefix + "kvm-s390x-KVMIBM.xml")
>  

This doesn't even work... you can't have a hyphen in a python variable name.
Please test your patches after making changes

I fixed these issues and pushed patch 1 + 2

Thanks,
Cole




More information about the virt-tools-list mailing list