Merge "xenapi: ephemeral disk partition should fill disk"
This commit is contained in:
commit
3ef37f73ef
@ -977,7 +977,7 @@ class GenerateDiskTestCase(VMUtilsTestBase):
|
|||||||
utils.execute('parted', '--script', '/dev/fakedev', 'mklabel',
|
utils.execute('parted', '--script', '/dev/fakedev', 'mklabel',
|
||||||
'msdos', check_exit_code=False, run_as_root=True)
|
'msdos', check_exit_code=False, run_as_root=True)
|
||||||
utils.execute('parted', '--script', '/dev/fakedev', 'mkpart',
|
utils.execute('parted', '--script', '/dev/fakedev', 'mkpart',
|
||||||
'primary', '0', '10',
|
'primary', '0', '-0',
|
||||||
check_exit_code=False, run_as_root=True)
|
check_exit_code=False, run_as_root=True)
|
||||||
vm_utils.os.path.exists('/dev/mapper/fakedev1').AndReturn(True)
|
vm_utils.os.path.exists('/dev/mapper/fakedev1').AndReturn(True)
|
||||||
utils.trycmd('kpartx', '-a', '/dev/fakedev',
|
utils.trycmd('kpartx', '-a', '/dev/fakedev',
|
||||||
@ -986,7 +986,7 @@ class GenerateDiskTestCase(VMUtilsTestBase):
|
|||||||
utils.execute('parted', '--script', '/dev/fakedev', 'mklabel',
|
utils.execute('parted', '--script', '/dev/fakedev', 'mklabel',
|
||||||
'msdos', check_exit_code=True, run_as_root=True)
|
'msdos', check_exit_code=True, run_as_root=True)
|
||||||
utils.execute('parted', '--script', '/dev/fakedev', 'mkpart',
|
utils.execute('parted', '--script', '/dev/fakedev', 'mkpart',
|
||||||
'primary', '0', '10',
|
'primary', '0', '-0',
|
||||||
check_exit_code=True, run_as_root=True)
|
check_exit_code=True, run_as_root=True)
|
||||||
|
|
||||||
def _check_vdi(self, vdi_ref):
|
def _check_vdi(self, vdi_ref):
|
||||||
|
@ -954,12 +954,11 @@ def _generate_disk(session, instance, vm_ref, userdevice, name_label,
|
|||||||
# 2. Attach VDI to compute worker (VBD hotplug)
|
# 2. Attach VDI to compute worker (VBD hotplug)
|
||||||
with vdi_attached_here(session, vdi_ref, read_only=False) as dev:
|
with vdi_attached_here(session, vdi_ref, read_only=False) as dev:
|
||||||
# 3. Create partition
|
# 3. Create partition
|
||||||
partition_start = 0
|
partition_start = "0"
|
||||||
partition_end = size_mb
|
partition_end = "-0"
|
||||||
|
|
||||||
partition_path = _make_partition(session, dev,
|
partition_path = _make_partition(session, dev,
|
||||||
"%d" % partition_start,
|
partition_start, partition_end)
|
||||||
"%d" % partition_end)
|
|
||||||
|
|
||||||
if fs_type == 'linux-swap':
|
if fs_type == 'linux-swap':
|
||||||
utils.execute('mkswap', partition_path, run_as_root=True)
|
utils.execute('mkswap', partition_path, run_as_root=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user