V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
cy18
V2EX  ›  问与答

qemu 选用 virt 虚拟机的时候怎么添加除 virtio 之外其他类型的块设备?

  •  
  •   cy18 · Jun 22, 2022 · 856 views
    This topic created in 1409 days ago, the information mentioned may be changed or developed.

    用下面的命令可以正常启动,但是块设备是 virtio 类型的,需要在内核里面额外添加 virtio 的驱动。

    qemu-system-aarch64 -M virt-6.2 -cpu cortex-a53 -m 1G -smp 4\
    	-kernel Image.gz \
    	-append 'earlycon=pl011,0x9000000 console=ttyAMA0 root=/dev/vda rw' \
    	-drive file=base.img,format=raw,if=virtio \
    	-nographic
    	
    

    有没有办法用另外一种设备类型来模拟块设备,从而避免在内核里面添加 virtio 驱动? Google 了半天,只找到一个

    -device sdhci-pci -device sd-card,drive=mydrive -drive id=mydrive,if=none,format=raw,file=base.img
    

    命令没有能正常运行,但是内核没有识别到块设备。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2687 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 13:20 · PVG 21:20 · LAX 06:20 · JFK 09:20
    ♥ Do have faith in what you're doing.