#
#asahi · 2023-07-24 09:40
mazdottedmag: I understand that people want a "universal" virt framework, but it really feels that libvirt is a horrible ball of tangled wires... I tried to use it twice, and wrote my own, KVM-specific ball of wires.
#asahi · 2023-07-24 09:38
waldimaz: ups
#asahi · 2023-07-24 09:37
mazwaldi: "-accel kvm". old style QEMU command line.
#asahi · 2023-07-24 09:36
dottedmagGood luck figuring out how libvirt converts domain properties to QEMU command line. I have read this code some time ago, and it took me several days to stop weeping.
#asahi · 2023-07-24 09:36
waldiso runs tcg emulated
#asahi · 2023-07-24 09:36
waldirycloud: it misses the accel=kvm
#asahi · 2023-07-24 09:35
rycloud /usr/bin/qemu-system-aarch64 -accel kvm -M virt -cpu host -m 2G -smp 2 -bios /usr/share/AAVMF/AAVMF_CODE.fd -drive if=none,file=/export/primary/disk,id=hd0 -vnc :1 -monitor stdio QEMU 7.2.0 monitor - type 'help' for more information (qemu) info kvm kvm support: enabled
#asahi · 2023-07-24 09:35
rycloudSo it seems instead of a host-passthrough or cpu model, if I use host it works on cmd line;
#asahi · 2023-07-24 09:02
rycloud(taking a break)
#asahi · 2023-07-24 08:59
rycloudwaldi maz this domain/xml works but with qemu - https://pastebin.pl/view/9387ac0a but if I change the top xml <domain type='qemu'> to <domain type='kvm'> I get the error
#asahi · 2023-07-24 08:58
rycloudI got a test VM xml that works on this machine with emulator qemu but when I change the domain type to 'kvm' it fails
#asahi · 2023-07-24 08:57
rycloudI got a test VM xml that works on this machine with emulator qemu but when I change the domain type to 'kvm' it fails
#asahi · 2023-07-24 08:55
waldirycloud: <model> sounds like what you want. but "virt"
#asahi · 2023-07-24 08:55
rycloudI got this in the xml though - <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>cortex-a57</model> </cpu>
#asahi · 2023-07-24 08:54
waldirycloud: okay, so the log is enough in this case
#asahi · 2023-07-24 08:54
waldithis ought to read "virt" or so
#asahi · 2023-07-24 08:54
rycloudyup indeed
#asahi · 2023-07-24 08:54
waldithis sounds pretty wrong
#asahi · 2023-07-24 08:54
waldi-machine none
#asahi · 2023-07-24 08:54
rycloud2023-07-24 08:43:49.131+0000: 7124: debug : virCommandRunAsync:2607 : About to run LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /usr/bin/qemu-system-aarch64 -S -no-user-config -nodefaults -nographic -machine none,accel=kvm:tcg -qmp unix:/var/lib/libvirt/qemu/qmp-281M81/qmp.monitor,server=on,wait=off -pidfile /var/lib/libvirt/qemu/qmp-281M81/qmp.pid -daemonize 2023-07-24 08:43:49.132+0000: 7124: debug : virCommandRunAsync:2609
#asahi · 2023-07-24 08:54
rycloudhere's what I see from libvirtd logs:
#asahi · 2023-07-24 08:53
rycloudwaldi: here. https://pastebin.pl/view/312d90eb
#asahi · 2023-07-24 08:52
waldior even larger
#asahi · 2023-07-24 08:52
waldi-s 4096
#asahi · 2023-07-24 08:52
rycloudhttps://pastebin.pl/view/74f63c26
#asahi · 2023-07-24 08:51
rycloudjust repeats these
#asahi · 2023-07-24 08:50
rycloud[pid 18807] execve("/usr/bin/qemu-system-aarch64", ["/usr/bin/qemu-system-aarch64", "-S", "-no-user-config", "-nodefaults", "-nographic", "-machine", "none,accel=kvm:tcg", "-qmp", "unix:/var/lib/libvirt/qemu/qmp-8"..., "-pidfile", "/var/lib/libvirt/qemu/qmp-8VQ371"..., "-daemonize"], 0xffff48061fd0 /* 2 vars */) = 0
#asahi · 2023-07-24 08:50
rycloud[pid 18797] execve("/usr/bin/qemu-system-aarch64", ["/usr/bin/qemu-system-aarch64", "-S", "-no-user-config", "-nodefaults", "-nographic", "-machine", "none,accel=kvm:tcg", "-qmp", "unix:/var/lib/libvirt/qemu/qmp-4"..., "-pidfile", "/var/lib/libvirt/qemu/qmp-486771"..., "-daemonize"], 0xffff48011050 /* 2 vars */) = 0
#asahi · 2023-07-24 08:50
rycloudah okay here we go:
#asahi · 2023-07-24 08:50
waldithe pid of that process. and hopefully it'll catch the exec of qemu
#asahi · 2023-07-24 08:50
rycloudah okay :) I can also try to get the libvirtd logs if they help
#asahi · 2023-07-24 08:49
waldirycloud: you use the main libvirtd process
#asahi · 2023-07-24 08:49
rycloudwaldi: sorry the process exits very quickly how do I run the strace command?
#asahi · 2023-07-24 08:48
rycloud(I was running everything as root btw)
#asahi · 2023-07-24 08:47
rycloudyes it's available maz root@macmini:~# kvm-ok INFO: /dev/kvm exists KVM acceleration can be used root@macmini:~# ls -l /dev/kvm crw-rw---- 1 root kvm 10, 232 Jul 24 08:46 /dev/kvm root@macmini:~# lsmod | grep kvm root@macmini:~# modprobe kvm
#asahi · 2023-07-24 08:39
mazrycloud: "ls -l /dev/kvm"?
#asahi · 2023-07-24 08:38
Guest6702or maybe not setuid, but the daemon can be low privileged while controlled by a virsh running as root
#asahi · 2023-07-24 08:38
maz(or set permissive permissions on /dev/kvm)
#asahi · 2023-07-24 08:38
mazyeah, that's a potential issue. burn libvirt.
#asahi · 2023-07-24 08:38
Guest6702yeah but libvirt can setuid down i believe
#asahi · 2023-07-24 08:38
mazGuest6702: ah, I see what you mean now.
#asahi · 2023-07-24 08:38
waldirycloud: you could use strace to get the correct command line libvirtd is about to execute. strace -fe execve -p $pid
#asahi · 2023-07-24 08:37
mazGuest6702: no. we already know /dev/kvm accessible, since QEMU is able to open it (and rycloud is running as root...)
#asahi · 2023-07-24 08:37
j`eyrycloud: its very likely just libvirt running qemu incorrectly
#asahi · 2023-07-24 08:36
mazrycloud: let's not create additional problems by switching distro. we want to understand the issue, not paper over it.
#asahi · 2023-07-24 08:36
Guest6702could it be a permissions issue on /dev/kvm if libvirt isn’t running qemu as root?
#asahi · 2023-07-24 08:35
mazfor a start, you should remove this "kvmclock" from your XML. it has no purpose on arm64, and may well be the cause of the error you're seeing
#asahi · 2023-07-24 08:35
rycloudI suppose I can try Debian and see it works, thanks maz
#asahi · 2023-07-24 08:33
rycloudah :) let me share the qemu commands it's running. It's possible a libvirt issue.
#asahi · 2023-07-24 08:31
mazOK, so you QEMU is OK. this looks like a libvirt problem, for which I'm utterly incompetent.

plus ›