Skip to content

Commit

Permalink
CP-47742 Allow non-4kn-capable SR type use
Browse files Browse the repository at this point in the history
In the situation where there is no 4kn capable SR type available (which
is to say, when there is no large-block-capable-sr-type feature file),
but one is needed, remove the block on lvn or ext being used. This is
for consistency with previous releases.

Signed-off-by: Robin Newton <[email protected]>
  • Loading branch information
Robin Newton authored and liulinC committed Jul 30, 2024
1 parent 3e585a1 commit 0e3dfe4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion answerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def parseDisks(self):
sr_type_mapping,
default=default_sr_type)

if sr_type != SR_TYPE_LARGE_BLOCK and len(large_block_disks) > 0:
if SR_TYPE_LARGE_BLOCK and sr_type != SR_TYPE_LARGE_BLOCK and len(large_block_disks) > 0:
raise AnswerfileException("%s not compatible with SR type %s"
% (", ".join(large_block_disks), sr_type))

Expand Down
13 changes: 2 additions & 11 deletions tui/installer/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ def get_sr_type(answers):
need_large_block_sr_type = any(diskutil.isLargeBlockDisk(disk)
for disk in guest_disks)

if not need_large_block_sr_type:
if not need_large_block_sr_type or not constants.SR_TYPE_LARGE_BLOCK:
srtype = answers.get('sr-type', constants.SR_TYPE_LVM)
txt = "Enable thin provisioning"
if len(BRAND_VDI) > 0:
Expand All @@ -726,22 +726,13 @@ def get_sr_type(answers):
content = tb
get_type = lambda: tb.selected() and constants.SR_TYPE_EXT or constants.SR_TYPE_LVM
buttons = ButtonBar(tui.screen, [('Ok', 'ok'), ('Back', 'back')])
elif constants.SR_TYPE_LARGE_BLOCK:
else:
content = TextboxReflowed(40,
"%s storage will be configured for"
" large disk block size."
% BRAND_GUEST)
get_type = lambda: constants.SR_TYPE_LARGE_BLOCK
buttons = ButtonBar(tui.screen, [('Ok', 'ok'), ('Back', 'back')])
else:
content = TextboxReflowed(54,
"Only disks with a block size of 512 bytes"
" can be used for %s storage. Please"
" unselect any disks where the block size"
" is different from this."
% BRAND_GUEST)
buttons = ButtonBar(tui.screen, [('Back', 'back')])
get_type = None

gf = GridFormHelp(tui.screen, 'Virtual Machine Storage Type', 'guestdisk:info2', 1, 4)
gf.add(content, 0, 0, padding=(0, 0, 0, 1))
Expand Down

0 comments on commit 0e3dfe4

Please sign in to comment.