Jonathon Jongsma <[email protected]> [2020-08-18, 09:47AM -0500]:
> diff --git a/tests/nodedevmdevctldata/mdevctl-list-single.out.xml 
> b/tests/nodedevmdevctldata/mdevctl-list-single.out.xml
> new file mode 100644
> index 0000000000..cb443346ef
> --- /dev/null
> +++ b/tests/nodedevmdevctldata/mdevctl-list-single.out.xml
> @@ -0,0 +1,14 @@
> +<device>
> +  <name>mdev_783e6dbb_ea0e_411f_94e2_717eaad438bf</name>
> +  <parent>matrix</parent>
> +  <capability type='mdev'>
> +    <type id='vfio_ap-passthrough'/>
> +    <iommuGroup number='0'/>
> +    <attr name='assign_adapter' value='5'/>
> +    <attr name='assign_adapter' value='6'/>
> +    <attr name='assign_domain' value='0xab'/>
> +    <attr name='assign_control_domain' value='0xab'/>
> +    <attr name='assign_domain' value='4'/>
> +    <attr name='assign_control_domain' value='4'/>
> +  </capability>
> +</device>

I find this XML design for the an AP mdev rather unfortunate. First of
all, it is really noisy and requires a lot of boiler-plate for the end
user.

Secondly, which I think it more important, it introduces a completely
new and different nomenclature compared to what we currently already
have for AP-related devices, i.e. cards

        virsh # nodedev-dumpxml ap_card05
        <device>
          <name>ap_card05</name>
          <path>/sys/devices/ap/card05</path>
          <parent>computer</parent>
          <driver>
                <name>cex4card</name>
          </driver>
          <capability type='ap_card'>
                <ap-adapter>0x05</ap-adapter>
          </capability>
        </device>

and queues

        virsh # nodedev-dumpxml ap_05_002a
        <device>
          <name>ap_05_002a</name>
          <path>/sys/devices/ap/card05/05.002a</path>
          <parent>ap_card05</parent>
          <driver>
                <name>cex4queue</name>
          </driver>
          <capability type='ap_queue'>
                <ap-adapter>0x05</ap-adapter>
                <ap-domain>0x002a</ap-domain>
          </capability>
        </device>

This is really inconsistent and can be confusing for the end user.

Can we instead propose something along the lines

        <device>
          <name>mdev_783e6dbb_ea0e_411f_94e2_717eaad438bf</name>
          <parent>matrix</parent>
          <capability type='mdev'>
                <type id='vfio_ap-passthrough'/>
                <iommuGroup number='0'/>
                <ap-adapter>0x05</ap-adapter>
                <ap-adapter>0x06</ap-adapter>
                <ap-domain>0x002a</ap-domain>
                <ap-domain>0x0004</ap-domain>
                <ap-domain>0x00ab</ap-domain>
                <ap-control>0x04</ap-control>
          </capability>
        </device>

plus any number of enclosing elements that we like for better readability?

Best,
Bjoern

PS: I haven't read the whole patch series, we just have an internal
discussion about AP support and the XML design came up. I know that we'd
like to generically treat all mdevs as the same but we also should allow
for vendor-specific attributes to be represented individually to what
makes sense.

-- 
IBM Systems
Linux on Z & Virtualization Development
--------------------------------------------------
IBM Deutschland Research & Development GmbH
Schönaicher Str. 220, 71032 Böblingen
Phone: +49 7031 16 1819
--------------------------------------------------
Vorsitzende des Aufsichtsrats: Gregor Pillen
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

Attachment: signature.asc
Description: PGP signature

Reply via email to