Skip to content

Commit c5336be

Browse files
kk7dsmarkgoddard
authored andcommitted
Check images with format_inspector for safety
It has been asserted that we should not be calling qemu-img info on untrusted files. That means we need to know if they have a backing_file, data_file or other unsafe configuration *before* we use qemu-img to probe or convert them. This grafts glance's format_inspector module into nova/images so we can use it to check the file early for safety. The expectation is that this will be moved to oslo.utils (or something) later and thus we will just delete the file from nova and change our import when that happens. NOTE: This includes whitespace changes from the glance version of format_inspector.py because of autopep8 demands. Change-Id: Iaefbe41b4c4bf0cf95d8f621653fdf65062aaa59 Closes-Bug: #2059809 (cherry picked from commit 966cd5a1f3119d47eeb985eea2385bd12148c320) (cherry picked from commit 4d5824f03310cbc2aa32fa8e4b27a98a9b7d9a81) (cherry picked from commit 210ad1f04c2f20374b323e64b9ef62d1eff5cc36)
1 parent 50d7492 commit c5336be

File tree

5 files changed

+1103
-9
lines changed

5 files changed

+1103
-9
lines changed

nova/conf/workarounds.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,16 @@
431431
Howerver, if you don't use automatic cleaning, it can cause an
432432
extra delay before and Ironic node is available for building a
433433
new Nova instance.
434+
"""),
435+
cfg.BoolOpt(
436+
'disable_deep_image_inspection',
437+
default=False,
438+
help="""
439+
This disables the additional deep image inspection that the compute node does
440+
when downloading from glance. This includes backing-file, data-file, and
441+
known-features detection *before* passing the image to qemu-img. Generally,
442+
this inspection should be enabled for maximum safety, but this workaround
443+
option allows disabling it if there is a compatibility concern.
434444
"""),
435445
]
436446

0 commit comments

Comments
 (0)