[libvirt-users] How to show underlying QEMU command line using virsh

Erik Skultety eskultet at redhat.com
Wed May 24 08:38:42 UTC 2017


On Wed, May 24, 2017 at 10:49:23AM +0300, Roman Storozhenko wrote:
> Hello, everybody
>
> I use virt to run my VM's and QEMU as a hypervisor. There is a file
> describing my virtual machine:
>
> /etc/libvirt/qemu/centos7.0.xml

Just a note, never edit ^these files directly behind libvirt's back and always
use 'virsh edit' for all modifications.

>
> As you know it contains xml representation of my VM. Is there any way to
> show underlying qemu command that virsh runs using that file? For
> example:

virsh doesn't spawn the qemu process, it's a frontend to libvirtd daemon which
will build the qemu cmdline according to the domain XML description and spawn
the process. As for the qemu commandline, we don't have an API to query the
command line, what you can do is get the qemu pid (e.g. with pgrep -f <VM_name>
and then cat /proc/<pid>/cmdline) or use ps and pipe its output to grep.

Erik

>
> qemu-system-x86-64 -m 1024 -smp 2 -...
>
> If no, is there any way to figure it out during VM run ?
>
> ---
> Thanks in advance,
> Roman Storozhenko
>
> _______________________________________________
> libvirt-users mailing list
> libvirt-users at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users




More information about the libvirt-users mailing list