qemu调试
执行gdb qemu-kvm后在gdb交互界面设置set args参数,在qemu代码打断点,然后开始执行使用gdb执行r开始调试。
set args -name guest=ele01,debug-threads=on -S -machine pc-i440fx-5.2,accel=kvm,usb=off,dump-guest-core=off,kernel_irqchip=on -cpu qemu64,x2apic=on,hypervisor=on,lahf-lm=on,svm=off -m 2048 -overcommit mem-lock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 31e62644-2cf3-4af9-8302-9e9a8c1c9aa6 -smbios type=1,serial=afef51ac-b449-4c16-9e0c-2d3d224e1aaf -smbios type=3,manufacturer=,asset=www.mcloud.io -no-user-config -nodefaults -rtc base=utc -no-shutdown -boot menu=on,strict=on -device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device usb-ehci,id=usb1,bus=pci.0,addr=0x6 -device nec-usb-xhci,id=usb2,bus=pci.0,addr=0x7 -device usb-ehci,id=usb3,bus=pci.0,addr=0x8 -device nec-usb-xhci,id=usb4,bus=pci.0,addr=0x9 -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0xc -device ahci,id=sata0,bus=pci.0,addr=0x4 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0xa -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel1,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -vnc 0.0.0.0:1 -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb3.0,port=1 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb3.0,port=2 -chardev spicevmc,id=charredir2,name=usbredir -device usb-redir,chardev=charredir2,id=redir2,bus=usb4.0,port=1 -chardev spicevmc,id=charredir3,name=usbredir -device usb-redir,chardev=charredir3,id=redir3,bus=usb4.0,port=2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xb -qmp unix:/var/lib/libvirt/qemu/mcloud/ele01.sock,server,nowait -chardev socket,id=scsi.45,path=/var/tmp/scsi.45 -device vhost-user-scsi-pci,bootindex=1,chardev=scsi.45,id=scsi.45,addr=0xd -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on -device edu```
set args -name guest=ele01,debug-threads=on -S -machine pc-i440fx-5.2,accel=kvm,usb=off,dump-guest-core=off,kernel_irqchip=on -cpu qemu64,x2apic=on,hypervisor=on,lahf-lm=on,svm=off -m 2048 -overcommit mem-lock=off -smp 1,sockets=1,cores=1,threads=1 -device edu -device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 -qmp unix:/var/lib/libvirt/qemu/mcloud/ele01.sock,server,nowait -chardev socket,id=scsi.45,path=/var/tmp/scsi.45 -device vhost-user-scsi-pci,bootindex=1,chardev=scsi.45,id=scsi.45,addr=0xd -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on```