Merge "XenAPI: specify block size for writing config drive."
This commit is contained in:
commit
52b9b1408a
@ -190,7 +190,7 @@ class GenerateConfigDriveTestCase(VMUtilsTestBase):
|
|||||||
'-publisher', mox.IgnoreArg(), '-quiet',
|
'-publisher', mox.IgnoreArg(), '-quiet',
|
||||||
'-J', '-r', '-V', 'config-2', mox.IgnoreArg(),
|
'-J', '-r', '-V', 'config-2', mox.IgnoreArg(),
|
||||||
attempts=1, run_as_root=False).AndReturn(None)
|
attempts=1, run_as_root=False).AndReturn(None)
|
||||||
utils.execute('dd', mox.IgnoreArg(), mox.IgnoreArg(),
|
utils.execute('dd', mox.IgnoreArg(), mox.IgnoreArg(), mox.IgnoreArg(),
|
||||||
mox.IgnoreArg(), run_as_root=True).AndReturn(None)
|
mox.IgnoreArg(), run_as_root=True).AndReturn(None)
|
||||||
|
|
||||||
self.mox.StubOutWithMock(vm_utils, 'create_vbd')
|
self.mox.StubOutWithMock(vm_utils, 'create_vbd')
|
||||||
|
@ -78,6 +78,7 @@ MBR_SIZE_BYTES = MBR_SIZE_SECTORS * SECTOR_SIZE
|
|||||||
KERNEL_DIR = '/boot/guest'
|
KERNEL_DIR = '/boot/guest'
|
||||||
MAX_VDI_CHAIN_SIZE = 16
|
MAX_VDI_CHAIN_SIZE = 16
|
||||||
PROGRESS_INTERVAL_SECONDS = 300
|
PROGRESS_INTERVAL_SECONDS = 300
|
||||||
|
DD_BLOCKSIZE = 65536
|
||||||
|
|
||||||
# Fudge factor to allow for the VHD chain to be slightly larger than
|
# Fudge factor to allow for the VHD chain to be slightly larger than
|
||||||
# the partitioned space. Otherwise, legitimate images near their
|
# the partitioned space. Otherwise, legitimate images near their
|
||||||
@ -1100,6 +1101,7 @@ def generate_configdrive(session, instance, vm_ref, userdevice,
|
|||||||
utils.execute('dd',
|
utils.execute('dd',
|
||||||
'if=%s' % tmp_file,
|
'if=%s' % tmp_file,
|
||||||
'of=%s' % dev_path,
|
'of=%s' % dev_path,
|
||||||
|
'bs=%d' % DD_BLOCKSIZE,
|
||||||
'oflag=direct,sync',
|
'oflag=direct,sync',
|
||||||
run_as_root=True)
|
run_as_root=True)
|
||||||
|
|
||||||
@ -2367,6 +2369,7 @@ def _copy_partition(session, src_ref, dst_ref, partition, virtual_size):
|
|||||||
utils.execute('dd',
|
utils.execute('dd',
|
||||||
'if=%s' % src_path,
|
'if=%s' % src_path,
|
||||||
'of=%s' % dst_path,
|
'of=%s' % dst_path,
|
||||||
|
'bs=%d' % DD_BLOCKSIZE,
|
||||||
'count=%d' % num_blocks,
|
'count=%d' % num_blocks,
|
||||||
'iflag=direct,sync',
|
'iflag=direct,sync',
|
||||||
'oflag=direct,sync',
|
'oflag=direct,sync',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user