<div dir="ltr">thank you very much for reply. I have got another question which is off topic.<div>Am I able to get vm's process id through libvirt api?</div><div><br></div><div>Thank you very much.</div><div><br></div><div>Best,</div><div>Norman</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 26, 2022 at 4:04 PM Michal Prívozník <<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 7/26/22 09:48, Jiatong Shen wrote:<br>
> Thank you very much for reply. Initially my thought of uptime is equal<br>
> to executing to `uptime` inside a virtual machine. <br>
> as for the second case, where virtual machine is paused for a period,<br>
> does libvirt expose an api to get how long qemu process<br>
> has existed?<br>
<br>
No, it doesn't. But that should be pretty easy to implement into<br>
virDomainListGetStats()/virConnectGetAllDomainStats().<br>
Alternatively, libvirt emits an event when a domain is started, so you<br>
may use that to record the time when the domain was started.<br>
<br>
Michal<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><br><div>Best Regards,</div><div><br></div><div>Jiatong Shen</div></div></div>