------- Comment From [email protected] 2025-03-31 05:29 EDT-------
(In reply to comment #22)
> Hi I'm seeing success in defining a virtio-mem-ccw device via `virsh edit`.
> However I'm seeing failure when I try hotplugging a device.
>
> ```
> # virsh edit u25
> ...
> # virsh start u25
> ...
> # virsh dumpxml u2410 | grep virtio-mem -A10
>     <memory model='virtio-mem'>
>       <target>
>         <size unit='KiB'>9437184</size>
>         <block unit='KiB'>2048</block>
>         <requested unit='KiB'>0</requested>
>         <current unit='KiB'>0</current>
>         <address base='0x80000000'/>
>       </target>
>       <alias name='virtiomem0'/>
>       <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0006'/>
>     </memory>
> # cat ./virtio-mem.xml
> <memory model='virtio-mem'>
>   <target>
>     <size unit='GiB'>9</size>
>     <block unit='MiB'>2</block>
>     <requested unit='KiB'>0</requested>
>   </target>
>   <address type='ccw'/>
> </memory>
> # virsh attach-device u25 $PWD/virtio-mem.xml
> error: Failed to attach device from /var/lib/libvirt/images/virtio-mem.xml
> error: internal error: unable to execute QEMU command 'device_add':
> PCI-attached virtio based memory devices not supported
> ```
>
> Hotunplug succeeds however.
>
> ```
> # virsh dumpxml u2410 | grep virtio-mem -A10 > ./live-definition.xml
> # virsh detach-device u2410 $PWD/live-definition.xml
> Device detached successfully
> ```
>
> Additionally virtio-mem-pci does not work at all, logging the same error
> message as above: `PCI-attached virtio based memory devices not supported`.

OK, It seems that libvirt ignores the address type and every virtio-mem device 
defaults to be a PCI device.
That is a libvirt bug fixed upstream by:
9ef080d6d9 qemu_domain_address: fix CCW virtio-mem hotplug

This leaves the QEMU error which does not allow to attache a PCI virtio-mem 
device.
There must be patches missing in QEMU that prevent virtio-mem-pci devices to be 
attached on s390.
Are these to commits included in qemu?

commit d77ae821e8940bdb9d97ee688aaa949f45de1758
Author: David Hildenbrand <[email protected]>
Date:   Tue Jan 28 19:57:05 2025 +0100

s390x/s390-virtio-ccw: Support plugging PCI-based virtio memory devices

Let's just wire it up, unlocking virtio-mem-pci support on s390x.

While at it, drop the "return;" in s390_machine_device_unplug_request(),
to make it look like the other handlers.

Reviewed-by: Thomas Huth <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>

commit 03248e714b0dc95f13221cfd4496cbdfa118e114
Author: David Hildenbrand <[email protected]>
Date:   Tue Jan 28 19:57:04 2025 +0100

virtio-mem-pci: Allow setting nvectors, so we can use MSI-X

Let's do it similar as virtio-balloon-pci. With this change, we can
use virtio-mem-pci on s390x, although plugging will still fail until
properly wired up in the machine.

No need to worry about transitional/non_transitional devices, because they
don't exist for virtio-mem.

Signed-off-by: David Hildenbrand <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2097886

Title:
  [25.04 FEAT] [VS2027] KVM: Enable virtio-mem support - libvirt part

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/2097886/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to