Merge "Move xenapi partition copies to privsep."
This commit is contained in:
commit
35e9c2bccf
@ -24,3 +24,14 @@ import nova.privsep
|
|||||||
@nova.privsep.sys_admin_pctxt.entrypoint
|
@nova.privsep.sys_admin_pctxt.entrypoint
|
||||||
def xenstore_read(path):
|
def xenstore_read(path):
|
||||||
return processutils.execute('xenstore-read', path)
|
return processutils.execute('xenstore-read', path)
|
||||||
|
|
||||||
|
|
||||||
|
@nova.privsep.sys_admin_pctxt.entrypoint
|
||||||
|
def block_copy(src_path, dst_path, block_size, num_blocks):
|
||||||
|
processutils.execute('dd',
|
||||||
|
'if=%s' % src_path,
|
||||||
|
'of=%s' % dst_path,
|
||||||
|
'bs=%d' % block_size,
|
||||||
|
'count=%d' % num_blocks,
|
||||||
|
'iflag=direct,sync',
|
||||||
|
'oflag=direct,sync')
|
||||||
|
@ -2399,14 +2399,8 @@ def _copy_partition(session, src_ref, dst_ref, partition, virtual_size):
|
|||||||
_sparse_copy(src_path, dst_path, virtual_size)
|
_sparse_copy(src_path, dst_path, virtual_size)
|
||||||
else:
|
else:
|
||||||
num_blocks = virtual_size / SECTOR_SIZE
|
num_blocks = virtual_size / SECTOR_SIZE
|
||||||
utils.execute('dd',
|
nova.privsep.xenapi.block_copy(
|
||||||
'if=%s' % src_path,
|
src_path, dst_path, DD_BLOCKSIZE, num_blocks)
|
||||||
'of=%s' % dst_path,
|
|
||||||
'bs=%d' % DD_BLOCKSIZE,
|
|
||||||
'count=%d' % num_blocks,
|
|
||||||
'iflag=direct,sync',
|
|
||||||
'oflag=direct,sync',
|
|
||||||
run_as_root=True)
|
|
||||||
|
|
||||||
|
|
||||||
def _mount_filesystem(dev_path, mount_point):
|
def _mount_filesystem(dev_path, mount_point):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user