Linux:来宾虚拟机的内核如何维护时间
在 Linux 中,我生成一个猜测虚拟机并加载另一个 Linux 实例。 VM 通过 KVM/libvirt/qemu 生成。来宾VM被主机内核视为一个进程。假设由于某种原因,来宾 VM QEMU 进程在某个时候没有被调度。VM 中的内核如何维护时间?假设我的来宾虚拟机应用程序中有一个计时器。如果来宾 VM qemu 进程本身没有得到安排,是否会影响我的计时器到期?
In Linux I am spawning a guess VM and load another instance of Linux. VM is spawned through KVM/libvirt/qemu. Guest VM is seen as a process by the host kernel. Lets say for some reason the guest VM QEMU process doesn't get scheduled for sometime.. how does the kernel in the VM maintain time ? Lets say I have a timer in my application in the guest VM. If the guest VM qemu process itself doesn't get scheduled will it affect my timer expiry ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
某些虚拟化解决方案将 VM 时钟连接到某些主机时钟,因此 VM 时钟不会独立运行。在其他情况下,可能不会发生这种情况(例如,依赖于模拟中断时钟),这确实会导致时钟偏差。您可以尝试使用 ntpd 来解决挂钟偏差,但对于像 CLOCK_MONOTONIC 这样的事情,您可能不得不忍受它。
Some virtualization solutions have the VM clock(s) hooked to some host clock(s), so that the VM clock does not tick independently. In other cases, no such thing may occur (relying on an emulated interrupt clock for example), which then does lead to clock skew. The wall clock skew you can attempt to combat with ntpd, but for things like CLOCK_MONOTONIC, you will probably have to live with it.