virtinst: prefer SATA bus for bhyve

Choose SATA as a default bus for bhyve as it doesn't support IDE.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
This commit is contained in:
Roman Bogorodskiy 2021-02-11 19:41:11 +04:00 committed by Cole Robinson
parent 2d254f2815
commit dab099d413
3 changed files with 6 additions and 1 deletions

View File

@ -18,7 +18,7 @@
<emulator>bhyve</emulator>
<disk type="file" device="disk">
<source file="/var/lib/libvirt/images/foobhyve.img"/>
<target dev="hda" bus="ide"/>
<target dev="sda" bus="sata"/>
</disk>
<interface type="bridge">
<source bridge="testsuitebr0"/>

View File

@ -408,6 +408,8 @@ class VirtinstConnection(object):
def is_vz(self):
return (self._uriobj.scheme.startswith("vz") or
self._uriobj.scheme.startswith("parallels"))
def is_bhyve(self):
return self._uriobj.scheme.startswith("bhyve")
#########################

View File

@ -972,6 +972,9 @@ class DeviceDisk(Device):
return "sd"
if guest.os.is_q35():
return "sata"
if self.conn.is_bhyve():
# IDE bus is not supported by bhyve
return "sata"
return "ide"
def set_defaults(self, guest):