QEMU가 결정 기록 및 재생을 지원하지만 https://github.com/qemu/qemu/blob/v2.9.0/docs/replay.txtLinux 커널 부팅에 QEMU의 결정 론적 기록 및 재생 기능을 사용하는 방법은 무엇입니까? 에 설명 된대로
, 나는 전체 리눅스 커널 부팅 작업 재생을 가져올 수 없습니다 : 항상 어떤 시점에서 중단됩니다.
이 내가 실행 해요 명령은 다음과 같습니다
#!/usr/bin/env bash
cmd="\
time \
./buildroot/output.x86_64~/host/usr/bin/qemu-system-x86_64 \
-M pc \
-append 'root=/dev/sda console=ttyS0 nokaslr printk.time=y - lkmc_eval=\"/rand_check.out;wget -S google.com;/poweroff.out;\"' \
-kernel './buildroot/output.x86_64~/images/bzImage' \
-nographic \
\
-drive file=./buildroot/output.x86_64~/images/rootfs.ext2,if=none,id=img-direct,format=raw \
-drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay \
-device ide-hd,drive=img-blkreplay \
\
-netdev user,id=net1 \
-device rtl8139,netdev=net1 \
-object filter-replay,id=replay,netdev=net1 \
"
echo "$cmd"
eval "$cmd -icount 'shift=7,rr=record,rrfile=replay.bin'"
# Different than previous.
eval "$cmd -icount 'shift=7,rr=record,rrfile=replay.bin'"
# Same as previous.
eval "$cmd -icount 'shift=7,rr=replay,rrfile=replay.bin'"
내 커널과 루트 파일 시스템이 Buildroot 설치로 생성 된 : QEMU의 v2.9.0을 사용 https://github.com/cirosantilli/linux-kernel-module-cheat/tree/0a1a600d49d1292be82a47cfde6f0355996478f0.
lkmc_eval
은 내 init
개의 스크립트로 평가됩니다. 여기서 우리는 실제로 우리가 실제로 결정적이라고 확인하는 무작위 인 사용자 공간을 인쇄 한 다음 기계의 전원을 끕니다. 내가 그 명령 해낸 방법
: https://wiki.qemu.org/Features/record-replay : 나는
- 시작
in-tree 문서에는 네트워킹 지원이 없다고하지만 wiki와 git 로그에는 v2.9.0부터 추가되었다고되어 있으므로 위키와 비교했을 때 구식이라고 생각됩니다. 이 설정을 사용하여
이, 부트 재생은 매우까지 진행하지만, 메시지에 응답하지 :
[ 31.692427] NET: Registered protocol family 17
초기 기록에 다음 메시지가 있었을 것이다 :
[ 31.777326] sd 1:0:0:0: [sda] Attached SCSI disk
은 그래서 ' 블록 장치 문제인지 의심 스럽네.
그러나 타임 스탬프는 동일하므로 레코드와 재생이 지금까지 성공했다고 확신합니다.
는 네트워킹을 위해 난 그냥 사용하는 경우 :
는-net none
그 기록 자체에 달려 :
사람이에 대한 QEMU 패치를 시도하고자하는 경우[ 19.669685] ALSA device list: [ 19.670756] No soundcards found.
, 단지 내부 여러분의 패치에 체크 아웃
/qemu/
을 실행하고 실행하십시오 :./build -t host-qemu-reconfigure
다시 작성하십시오.
뉴스 파벨에게 감사드립니다. 문제가 해결되면 답변을 업데이트하고 댓글을 달아주세요. 이 기능은 매우 멋지다! 건배. –