From 8b0d0f10187e7ceffd6bf751d2dcff0a218cb4ee Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sat, 11 Nov 2023 21:37:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=99=9A=E6=8B=9F=E6=9C=BA?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E5=9C=A8=E7=B3=BB=E7=BB=9F=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E7=AC=AC=205=20=E9=A1=B9=E5=8F=8A=E4=BB=A5?= =?UTF-8?q?=E5=90=8E=E5=87=BA=E7=8E=B0=E4=B8=8D=E4=BC=9A=E6=8C=82=E8=BD=BD?= =?UTF-8?q?=20ISO=20=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20Qemu=20=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VM-source/buildvbox.cpp | 3 ++- VM-source/qemu.cpp | 5 +++++ VM-source/qemu.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/VM-source/buildvbox.cpp b/VM-source/buildvbox.cpp index 734ee2d..89634ca 100644 --- a/VM-source/buildvbox.cpp +++ b/VM-source/buildvbox.cpp @@ -160,7 +160,8 @@ buildvbox::buildvbox(QString isoPath, int id, int vm){ } } else{ - vm.AutoInstall(isoPath); + //vm.AutoInstall(isoPath); + vm.MountMainISO(isoPath); } vm.SetCPU(get_nprocs(), GetCPUSocket(), GetCPUCore()); diff --git a/VM-source/qemu.cpp b/VM-source/qemu.cpp index 966e680..9145c12 100644 --- a/VM-source/qemu.cpp +++ b/VM-source/qemu.cpp @@ -105,6 +105,8 @@ int qemu::Start(bool unShown){ } int qemu::Stop(){ system("killall qemu-system-x86_64 -9"); + system("killall qemu-system-aarch64 -9"); + system("killall qemu-system-arm -9"); system("killall kvm -9"); return 0; } @@ -184,6 +186,9 @@ int qemu::EnabledUEFI(bool status){ } return 1; } +int qemu::MountMainISO(QString isoPath){ + commandOption += "--cdrom '" + isoPath + "' "; +} int qemu::AutoInstall(QString iso){ return 0; } diff --git a/VM-source/qemu.h b/VM-source/qemu.h index 385547d..84ebc8d 100644 --- a/VM-source/qemu.h +++ b/VM-source/qemu.h @@ -44,6 +44,7 @@ public: int OpenUSB(); int EnabledUEFI(bool status); int AutoInstall(QString iso); + int MountMainISO(QString isoPath); int UseAarch64EFI(); int UseArmhfEFI(); int UseLoongarch64EFI();