On 07/11/2016 11:09, Brian Candler wrote:
On 07/11/2016 10:42, Stefan Hajnoczi wrote:
Let's try to isolate the cause of this crash:
Are you able to switch -netdev user to -netdev tap so we can rule out
the slirp user network stack as the source of memory corruption?
Let me try to set that up. Using packer.io, I will have to start a VM
by hand, and then use the 'null' builder to ssh to the existing VM
(whereas normally packer fires up the qemu process by itself)
OK, I've done this.
I wrote a script which would start a standalone instance of qemu from
libvirt, and then run packer to do the same provisioning steps over ssh
(using the 'null' builder) as it would when running qemu by itself. I
put this in a loop and it ran 10 times on the trot without crashing once.
These are the options which libvirt ran qemu with:
qemu-system-x86_64 -enable-kvm -name ubuntu-base -S -machine
pc-i440fx-2.5,accel=kvm,usb=off -m 3072 -realtime mlock=off -smp
1,sockets=1,cores=1,threads=1 -uuid 0631eb6f-94ef-4a6c-b397-b865cc2035da
-no-user-config -nodefaults -chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-ubuntu-base/monitor.sock,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc
-no-shutdown -boot strict=on -device
piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device
virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x7 -drive
file=/var/lib/libvirt/images/ubuntu-base.qcow2,format=qcow2,if=none,id=drive-scsi0-0-0-0,discard=unmap
-device
scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1
-netdev tap,fd=27,id=hostnet0,vhost=on,vhostfd=29 -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:cc:c1:62,bus=pci.0,addr=0x3
-chardev pty,id=charserial0 -device
isa-serial,chardev=charserial0,id=serial0 -vnc 0.0.0.0:97 -device
cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on
So either this means that using tap networking instead of user
networking is fixing all the problems; or it is some other option which
is different. Really I now need to run qemu with exactly the same
settings as before, except with tap instead of user networking.
Question: is "-enable-kvm" the same as "-machine pc-xxxxx,accel=kvm", or
do both need to be specified? I notice that packer wasn't giving both
options, but libvirt is.
Regards,
Brian.