Skip to content

Commit c8684f2

Browse files
committed
Storage: fix resize check fail issue
In image mode, the volume size of netfs pool will be affected by the metadata size. So it has size change and this change is within a reasonable range. So cover this size change in code. Signed-off-by: meinaLi <[email protected]>
1 parent f69f72e commit c8684f2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

libvirt/tests/src/virsh_cmd/volume/virsh_vol_resize.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,15 @@ def check_vol_info(pool_vol, vol_name, test, expect_info=None):
217217
if expect_info['Allocation'] != img_info['dsize']:
218218
logging.debug("Allocation(Disk size) is %s bytes",
219219
img_info['dsize'])
220-
logging.error("Volume Allocation not equal to expect value %s",
221-
expect_info['Allocation'])
222-
check_allocation_pass = False
220+
image_mode = utils_sys.is_image_mode()
221+
if image_mode:
222+
max_allow = expect_info['Allocation'] * 1.4
223+
if img_info['dsize'] <= max_allow:
224+
check_allocation_pass = True
225+
else:
226+
logging.error("Volume Allocation not equal to expect value %s",
227+
expect_info['Allocation'])
228+
check_allocation_pass = False
223229
return check_capacity_pass & check_allocation_pass
224230
except KeyError as detail:
225231
test.error("Fail to check volume info:\n%s" % detail)

0 commit comments

Comments
 (0)