qemu - Qemu 原生到 Libvirt XML
问题描述
我已经使用 qemu cli 创建了一个 macos 虚拟机,到目前为止一切似乎都很好。我的挑战是现在将其转换为 libvirt xml。
我正在尝试使用此命令:virsh domxml-from-native qemu-argv
但我收到以下错误,没有其他信息error: this function is not supported by the connection driver: virConnectDomainXMLFromNative
这是我的 cli 命令,我使用的是 Fedora 31
qemu-system-x86_64 -enable-kvm -m 16G \
-cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+aes,+xsave,+avx,+xsaveopt,avx2,+smep \
-boot order=c \
-machine pc-q35-2.9 \
-smp 16,sockets=1,cores=8,threads=2 \
-usb -device usb-kbd -device usb-tablet \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=OVMF_CODE.fd \
-drive if=pflash,format=raw,file=OVMF_VARS-3440x1440.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ide-drive,bus=ide.0,drive=Clover \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'HighSierra/Clover.qcow2' \
-device ide-drive,bus=ide.1,drive=MacHDD \
-drive id=MacHDD,if=none,file=/dev/disk/by-id/ata-SanDisk_SDSSDA120G_163757447010,format=raw \
-nic user,model=e1000-82545em \
-device vfio-pci,host=08:00.0,multifunction=on \
-device vfio-pci,host=08:00.1 \
-rtc clock=host,base=localtime \
-vga none \
-nographic \
-serial none \
-parallel none \
-usb \
-device usb-host,hostbus=5,hostport=4 \
-device usb-host,hostbus=5,hostport=4.1 \
-device usb-host,hostbus=5,hostport=4.2 \
-device usb-host,hostbus=5,hostport=4.3 \
-device usb-host,hostbus=5,hostport=4.4
我不知道从哪里开始,这个函数的文档几乎不存在
解决方案
不幸的是,domxml-from-native
从最近的 libvirt 中删除了对该命令的支持,因为我们发现在实践中它太不可靠和不完整而没有用处。
将预先存在的磁盘映像导入 libvirt 的最佳选择是使用带有“ ”标志的“ virt-install
”命令。--import
您可以使用各种其他参数来定义磁盘、NIC 等。
我认为你唯一会遇到的问题是 " isa-applesmc
" 设备,因为我认为 libvirt 不支持它。为此,您需要编辑已创建的 XML virt-intsall,然后添加一个直通选项,如此处所示https://libvirt.org/drvqemu.html#qemucommand
推荐阅读
- c++ - 我可以使用什么现成的组件来存储整数部分中具有任意精度的数字而小数部分中的精度有限?
- airflow - 气流连接字符串格式?
- ssis - 来自excel源数据的SSIS增量负载
- java - 在 java 中使用自定义序列化时,我们是否必须调用父类的 readObject() 方法?
- asp.net - 选择列表时的引导模式弹出问题已关闭?
- java - Glide 4.7.1 监听器不适用于 onResourceReady 方法和异常监听器
- python - 使用 python 和 lxml 访问重复的特定 xml 元素
- node.js - 尝试在发布路线上发表评论时出错
- apache-spark - Hive 外部表无法查看分区 Parquet 文件
- uwp - Windows 商店发布 Change App 图标