On Tue, Feb 06, 2024 at 01:57:39PM +0100, Pierre Clouzet wrote: > Hello, > I've recently tried libvirt api to manage virtual machine. > The point of my work is to modify the topology of a virtual machine and test performances (add numa nodes, change number of cpu per numa, nvm devices, cxl, etc) > As far as understand, when using virt-manager, qemu arguments stored in xml files can only be like the one that page: > [ https://wiki.libvirt.org/QEMUSwitchToLibvirt.html | https://wiki.libvirt.org/QEMUSwitchToLibvirt.html ] > > But maybe I misundertood? > > For example, when I directly run qemu with arguments, I can add an arguments like this: > qemu [...] -object memory-backend-ram,size=4G,id=ram0 > -object memory-backend-ram,size=2G,id=ram1 > -numa node,nodeid=0,memdev=ram0,cpus=0-3 > -numa node,nodeid=1,memdev=ram1,cpus=4-7 > > To have 2 numa nodes with 4 cpus each. > Is there an equivalent of -objet, -numa, -device; qemu arguments when using libvirt? Or arguments are restricted to the one described on wiki page? Hi, I see that the wiki page doesn't cover memory-backend-ram but it is implemented in libvirt and doable with XML. That wiki page will most likely miss other QEMU commands but you can always check the Domain XML format documentation [1] to see if libvirt supports what you want to achieve. For your case you want to use something like this: <domain> <currentMemory unit='GiB'>6</currentMemory> <vcpu>8</vcpu> ... <cpu> ... <numa> <cell id='0' cpus='0-3' memory='4' unit='GiB'/> <cell id='1' cpus='4-7' memory='2' unit='GiB'/> </numa> ... </domain> More details here [2]. Note: one defined libvirt will show the memory in `KiB` so that behavior is expected. Pavel [1] <https://libvirt.org/formatdomain.html> [2] <https://libvirt.org/formatdomain.html#cpu-model-and-topology>
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Users mailing list -- users@xxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxx