Comment 8 for bug 1756915

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Some things to hot add (without needing special devices) to test with this (some are more related to bug 1755153 but tested here as well):

Testing nvdimms is a bit odd, as there is no "enable" option.
So one needs to start with nvdimms to get it working.
And to do so it needs actually support in virt-aa-helper.
If one ignores that it would work like the following

$ sudo fallocate /var/lib/libvirt/qemu/nvdimm-test -l 512m
$ sudo chown libvirt-qemu:kvm /var/lib/libvirt/qemu/nvdimm-test
$ sudo chmod 777 /var/lib/libvirt/qemu/nvdimm-test
$ sudo fallocate /var/lib/libvirt/qemu/nvdimm-base -l 512m
$ sudo chown libvirt-qemu:kvm /var/lib/libvirt/qemu/nvdimm-base
$ sudo chmod 777 /var/lib/libvirt/qemu/nvdimm-base

Add a nvdimm to enable it on start to the base guest XML:
    <memory model='nvdimm'>
      <source>
        <path>/var/lib/libvirt/qemu/nvdimm-base</path>
      </source>
      <target>
        <size unit='KiB'>524288</size>
        <node>0</node>
      </target>
    </memory>

And for hot add one can use the file:
$ sudo virsh attach-device <guest> hotplug-mem512-nvdimm.xml --live

$ cat hotplug-mem512-nvdimm.xml
<memory model='nvdimm'>
        <source>
                <path>/var/lib/libvirt/qemu/nvdimm-test</path>
        </source>
        <target>
                <size unit='KiB'>524288</size>
                <node>0</node>
        </target>
</memory>

The hot add adds the rule:
  "/var/lib/libvirt/qemu/nvdimm-test" rwk,
as it should.

Needs the start rule thou (by virt-aa-helper).

Will retest once implemented.
First look at the others.

"Normal" memory - working
$ cat hotplug-mem512.xml
<memory model='dimm'>
        <target>
                <size unit='KiB'>524288</size>
                <node>0</node>
        </target>
</memory>

RNG Device - working
$ cat hotplug-rng.xml
<rng model='virtio'>
        <rate period="2000" bytes="1234"/>
        <backend model='random'>/dev/random</backend>
</rng>

Trivial input dev - working
$ cat hotplug-input.xml
<input type='tablet' bus='virtio'/>

Passthrough input dev - working
ubuntu@node-horsea:~$ cat hotplug-input-evdev.xml
<input type='passthrough' bus='virtio'>
        <source evdev='/dev/input/event0' />
</input>
Got rule:
    "/dev/input/event0" rwk,

But also on the latter if added to the initial domain xml it is failing (label callbacks work, but virt-aa-helper needs to learn about it).

So overall it seems we are all good, except the initial memory / input evdev specification.
Filing an extra bug for the two (it is a new issue essentially).