]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_command: Generate .memaddr for virtio-mem and virtio-pmem
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 28 Mar 2023 08:44:15 +0000 (10:44 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 26 May 2023 14:44:45 +0000 (16:44 +0200)
This is fairly trivial. Just set .memaddr attribute if a value
was set in the XML.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2180679
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-5.2.0.args
tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args

index 15383f646a242a7c8b898db32e7be3c9c91bfbdb..72363238b8564862823ade7ffc542747fb11265f 100644 (file)
@@ -3627,6 +3627,7 @@ qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg,
                               "T:unarmed", unarmed,
                               "s:memdev", memdev,
                               "B:prealloc", prealloc,
+                              "P:memaddr", mem->address,
                               "s:id", mem->info.alias,
                               NULL) < 0)
         return NULL;
index ba1dd872ba60035e27010e813bbf6107531fe3bf..592578fb597e2f0488514d0b34cb54fce367f239 100644 (file)
@@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -object '{"qom-type":"memory-backend-ram","id":"memvirtiomem0","reserve":false,"size":1073741824}' \
 -device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":536870912,"memdev":"memvirtiomem0","id":"virtiomem0","bus":"pci.0","addr":"0x2"}' \
 -object '{"qom-type":"memory-backend-file","id":"memvirtiomem1","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","reserve":false,"size":2147483648,"host-nodes":[1,2,3],"policy":"bind"}' \
--device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":1073741824,"memdev":"memvirtiomem1","prealloc":true,"id":"virtiomem1","bus":"pci.1","addr":"0x1"}' \
+-device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":1073741824,"memdev":"memvirtiomem1","prealloc":true,"memaddr":5637144576,"id":"virtiomem1","bus":"pci.1","addr":"0x1"}' \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
 -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \
index 4972285a3e4b5a35aa138db7bcc43926d164d44d..e28dd339e9242ebcfad2b7906f6528a4c6413e54 100644 (file)
@@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -boot strict=on \
 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
 -object memory-backend-file,id=memvirtiopmem0,mem-path=/tmp/virtio_pmem,share=on,size=536870912 \
--device virtio-pmem-pci,memdev=memvirtiopmem0,id=virtiopmem0,bus=pci.0,addr=0x5 \
+-device virtio-pmem-pci,memdev=memvirtiopmem0,memaddr=5368709120,id=virtiopmem0,bus=pci.0,addr=0x5 \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
 -device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
index 560be7673056174fc9e413d56d0f8f19c47da27b..bd8343c15e4f4be410cc096672ece9bdde015187 100644 (file)
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -boot strict=on \
 -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
 -object '{"qom-type":"memory-backend-file","id":"memvirtiopmem0","mem-path":"/tmp/virtio_pmem","share":true,"size":536870912}' \
--device '{"driver":"virtio-pmem-pci","memdev":"memvirtiopmem0","id":"virtiopmem0","bus":"pci.0","addr":"0x5"}' \
+-device '{"driver":"virtio-pmem-pci","memdev":"memvirtiopmem0","memaddr":5368709120,"id":"virtiopmem0","bus":"pci.0","addr":"0x5"}' \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
 -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \