diff options
| author | Lucas Alvares Gomes <lucasagomes@gmail.com> | 2017-01-19 17:16:38 +0000 |
|---|---|---|
| committer | Lucas Alvares Gomes <lucasagomes@gmail.com> | 2017-01-19 18:01:30 +0000 |
| commit | 449cda4fed51250992446c83a4b50bc45fd10c6d (patch) | |
| tree | f0ad775ea3a0da7f12a84ebe9c84d8ccea620575 /ironic_python_agent/shell | |
| parent | 7680625994093f39fa9eec8aa2d8c17c35f44e81 (diff) | |
| download | ironic-python-agent-449cda4fed51250992446c83a4b50bc45fd10c6d.tar.gz | |
Limit memory usage when running qemu-img convert
This patch is limiting the memory address space to 1 GiB when invoking
qemu-img convert. The qemu-img command can be exploited so we better
play on the safe side (See: bug #1449062).
Change-Id: I2088f74b32d1392310c569cfaa7fd368cb737421
Closes-Bug: #1657808
Diffstat (limited to 'ironic_python_agent/shell')
| -rwxr-xr-x | ironic_python_agent/shell/write_image.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ironic_python_agent/shell/write_image.sh b/ironic_python_agent/shell/write_image.sh index 11abb9fc..c8cd3880 100755 --- a/ironic_python_agent/shell/write_image.sh +++ b/ironic_python_agent/shell/write_image.sh @@ -39,6 +39,9 @@ log "Erasing existing GPT and MBR data structures from ${DEVICE}" sgdisk -Z $DEVICE log "Imaging $IMAGEFILE to $DEVICE" + +# limit the memory usage for qemu-img to 1 GiB +ulimit -v 1048576 qemu-img convert -t directsync -O host_device $IMAGEFILE $DEVICE sync |
