Skip to contentSkip to conversation

Running KVM version ?

DISCUSSION Florent B 2 participants 2 messages Apr 9, 2015 KVM

lore
Share & tools
lore

Florent B

author
#0 lore raw

Hi everyone,

This list seems to be a developer list, I didn't find any "users" list. So please forgive me if I'm at the wrong place.

I would like to know if there's a way to know the version of a running kvm process ?

I have some VMs running for 100+ days, and I would like to know if I need to restart them to run with a newer version of kvm.

Thank you a lot.

Florent

#1 lore raw

2015-04-09 15:27+0200, Florent B:

Quoted 3 lines

Hi everyone,

This list seems to be a developer list, I didn't find any "users" list.

I don't think it exists, KVM is used mostly by programs and they are not sophisticated enough to communicate.
(or they are, which is why humans aren't invited)

Quoted 1 line

So please forgive me if I'm at the wrong place.

qemu-discuss/libvirt-users/openstack-operators (whatever you face) or stack overflow are better for questions about virtualization.

Quoted 2 lines

I would like to know if there's a way to know the version of a running kvm process ?

I think you meant QEMU process. KVM is the kernel part and it can't change while any VM is running. (uname -r gives kernel version.)

There are at least four ways to get VM's QEMU version. I presume you are using at most libvirt.

1a) virsh
1. get name of the VM
2. # virsh qemu-monitor-command $name --hmp info version
1b) qemu monitor
1. access the monitor (if you don't use libvirt, you should know how)
2. (qemu) info version
(2+. curse and repent if you set up JSON monitor)

3) reading /proc/$pid/mem
1. get PID of the QEMU process
2. # cd /proc/$pid/
3. # offset=$((0xawk -F - '/r-x.*qemu/{print $1}' maps))
4. # dd skip=$offset if=mem bs=1 | strings | grep 'emulator version'

4) gdb
(You probably don't have debuginfo and the option above is easier.)

Quoted 2 lines

I have some VMs running for 100+ days, and I would like to know if I need to restart them to run with a newer version of kvm.

No need to know the version for that. You can take look when the binary was updated and compare it with process start time.