Skip to content

Commit 9f83839

Browse files
cfergeaupraveenkumar
authored andcommitted
preflight: Use read-only qemu:///system when calling virsh capabilities
crc's preflight check use virsh capabilities to make sure a qemu binary supporting kvm is installed. It currently calls 'virsh capabilities' which is apparently disabled on some setups. This commit tries to use qemu:///system instead, but it only uses a read-only connection as we don't know yet if the user is in the libvirt group and has read/write access to qemu:///system. This should fix #1994
1 parent 70b65fb commit 9f83839

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/crc/preflight/preflight_checks_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func fixKvmEnabled() error {
8888
}
8989

9090
func getLibvirtCapabilities() (*libvirtxml.Caps, error) {
91-
stdOut, _, err := crcos.RunWithDefaultLocale("virsh", "capabilities")
91+
stdOut, _, err := crcos.RunWithDefaultLocale("virsh", "--readonly", "--connect", "qemu:///system", "capabilities")
9292
if err != nil {
9393
return nil, fmt.Errorf("Failed to run 'virsh capabilities': %v", err)
9494
}

0 commit comments

Comments
 (0)