Skip to content

Commit dab099d

Browse files
novelcrobinso
authored andcommitted
virtinst: prefer SATA bus for bhyve
Choose SATA as a default bus for bhyve as it doesn't support IDE. Reviewed-by: Cole Robinson <[email protected]> Signed-off-by: Roman Bogorodskiy <[email protected]>
1 parent 2d254f2 commit dab099d

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

tests/data/cli/compare/virt-install-bhyve-default-f27.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<emulator>bhyve</emulator>
1919
<disk type="file" device="disk">
2020
<source file="/var/lib/libvirt/images/foobhyve.img"/>
21-
<target dev="hda" bus="ide"/>
21+
<target dev="sda" bus="sata"/>
2222
</disk>
2323
<interface type="bridge">
2424
<source bridge="testsuitebr0"/>

virtinst/connection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ def is_container_only(self):
408408
def is_vz(self):
409409
return (self._uriobj.scheme.startswith("vz") or
410410
self._uriobj.scheme.startswith("parallels"))
411+
def is_bhyve(self):
412+
return self._uriobj.scheme.startswith("bhyve")
411413

412414

413415
#########################

virtinst/devices/disk.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,9 @@ def _default_bus(self, guest):
972972
return "sd"
973973
if guest.os.is_q35():
974974
return "sata"
975+
if self.conn.is_bhyve():
976+
# IDE bus is not supported by bhyve
977+
return "sata"
975978
return "ide"
976979

977980
def set_defaults(self, guest):

0 commit comments

Comments
 (0)