/ var / log / libvirt / qemu下的libvirt日志显示时间是UTC如何让它显示当地时间?

时间:2016-01-31 09:42:32

标签: kvm libvirt

/ var / log / libvirt / qemu下的libvirt日志显示时间是UTC如何让它显示当地时间?

如下所示:

qemu: terminating on signal 15 from pid 118813 2016-01-31 09:07:08.465+0000: shutting down 2016-01-31 09:09:14.958+0000: starting up libvirt version: 1.2.21, qemu version: 1.1.2 LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin QEMU_AUDIO_DRV=none /usr/bin/kvm -name test10.0.10.35 -S -machine pc-1.1,accel=kvm -cpu host -m 16384 -smp 2,sockets=2,cores=1,threads=1 -uuid f498447b-ebad-ce98-e5fa-0cdfecad7371 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-test10.0.10.35/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=2016-01-31T17:09:14 -no-shutdown -boot order=cd,menu=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/home/vmstorage/images/test.img,if=none,id=drive-virtio-disk0,format=qcow2,bps=85445632,iops_rd=1000,iops_wr=1000 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 -drive if=none,id=drive-ide0-1-1,readonly=on,format=raw -device ide-cd,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1 -netdev tap,fd=24,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:cc:8b:45,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -vnc 0.0.0.0:3 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 Domain id=34 is tainted: high-privileges Domain id=34 is tainted: host-cpu char device redirected to /dev/pts/5

2016-01-31 09:09:14.958 + 0000这次显示是utc我怎样才能让它显示当地时间?

1 个答案:

答案 0 :(得分:0)

Libvirt将始终使用UTC进行所有日志记录,而不是本地时间。这主要源于需要使日志记录功能是线程安全的而不需要任何锁定,并且没有用于转换为本地时间的线程安全API。因此,libvirt决定简单地将UTC用于所有事情,从而在主机和面临时区变化时提供一致性的附加好处。