From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: Running KVM version ? Date: Thu, 9 Apr 2015 17:58:21 +0200 Message-ID: <20150409155821.GA9729@potion.brq.redhat.com> References: <55267E59.1020600@coppint.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm list To: Florent B Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52287 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932929AbbDIP60 (ORCPT ); Thu, 9 Apr 2015 11:58:26 -0400 Content-Disposition: inline In-Reply-To: <55267E59.1020600@coppint.com> Sender: kvm-owner@vger.kernel.org List-ID: 2015-04-09 15:27+0200, Florent B: > 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) > 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. > 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=$((0x`awk -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.) > 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.