Skip to content

Commit

Permalink
virt-manager: don't warn about KVM; fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
danchr committed Jun 20, 2020
1 parent 20d5b17 commit a22f50c
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gnome/virt-manager/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PortGroup active_variants 1.1
PortGroup app 1.0

github.setup virt-manager virt-manager 2.2.1 v
revision 2
revision 3
categories gnome emulators
supported_archs noarch
maintainers {danchr @danchr} openmaintainer
Expand All @@ -33,11 +33,17 @@ checksums rmd160 9c06e912feb3f44f0ba4b50d94b22118106d380e \

platforms darwin

patchfiles no-kvm-warning.diff \
not-in-usr.diff

python.default_version 37

post-patch {
reinplace -W ${worksrcpath} "s|/usr/bin/env python3|${python.bin}|" \
virt-clone virt-convert virt-install virt-manager virt-xml

reinplace -W ${worksrcpath} "s|@PREFIX@|${prefix}|" \
virtManager/createconn.py
}

depends_build \
Expand Down
21 changes: 21 additions & 0 deletions gnome/virt-manager/files/no-kvm-warning.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git virtManager/createvm.py virtManager/createvm.py
--- virtManager/createvm.py
+++ virtManager/createvm.py
@@ -7,6 +7,7 @@
import io
import pkgutil
import os
+import sys
import threading
import time

@@ -609,7 +610,8 @@ class vmmCreateVM(vmmGObjectUI):
self._show_startup_warning(error)

elif self.conn.is_qemu():
- if not self._capsinfo.guest.is_kvm_available():
+ if (sys.platform == 'linux' and
+ not self._capsinfo.guest.is_kvm_available()):
error = _("KVM is not available. This may mean the KVM "
"package is not installed, or the KVM kernel modules "
"are not loaded. Your virtual machines may perform poorly.")
26 changes: 26 additions & 0 deletions gnome/virt-manager/files/not-in-usr.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git virtManager/createconn.py virtManager/createconn.py
--- virtManager/createconn.py
+++ virtManager/createconn.py
@@ -65,15 +65,15 @@ class vmmCreateConn(vmmGObjectUI):
os.path.exists("/proc/xen")):
return 'xen:///'

- if (os.path.exists("/usr/bin/qemu") or
- os.path.exists("/usr/bin/qemu-kvm") or
- os.path.exists("/usr/bin/kvm") or
- os.path.exists("/usr/libexec/qemu-kvm") or
- glob.glob("/usr/bin/qemu-system-*")):
+ if (os.path.exists("@PREFIX@/bin/qemu") or
+ os.path.exists("@PREFIX@/bin/qemu-kvm") or
+ os.path.exists("@PREFIX@/bin/kvm") or
+ os.path.exists("@PREFIX@/libexec/qemu-kvm") or
+ glob.glob("@PREFIX@/bin/qemu-system-*")):
return "qemu:///system"

- if (os.path.exists("/usr/lib/libvirt/libvirt_lxc") or
- os.path.exists("/usr/lib64/libvirt/libvirt_lxc")):
+ if (os.path.exists("@PREFIX@/lib/libvirt/libvirt_lxc") or
+ os.path.exists("@PREFIX@/lib64/libvirt/libvirt_lxc")):
return "lxc:///"
return None

0 comments on commit a22f50c

Please sign in to comment.