mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-03 15:55:53 +00:00
img: Introduce the notion of a raw image
Raw images are supposed to be files with non-crtools contents. E.g. tarballs with tmpfs contents or iptables-save output. Another example is -- ip tool addr and route dumps we're about to merge soon. Having these type of images allows to use the open_image and the cr_fdset engine easily. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
4
image.c
4
image.c
@@ -240,6 +240,9 @@ int open_image(int type, unsigned long flags, ...)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (fdset_template[type].magic == RAW_IMAGE_MAGIC)
|
||||
goto skip_magic;
|
||||
|
||||
if (flags == O_RDONLY) {
|
||||
u32 magic;
|
||||
|
||||
@@ -254,6 +257,7 @@ int open_image(int type, unsigned long flags, ...)
|
||||
goto err;
|
||||
}
|
||||
|
||||
skip_magic:
|
||||
return ret;
|
||||
err:
|
||||
return -1;
|
||||
|
@@ -10,6 +10,13 @@
|
||||
|
||||
#define CRTOOLS_IMAGES_V1 1
|
||||
|
||||
/*
|
||||
* Raw images are images in which data is stored in some
|
||||
* non-crtool format (ip tool dumps, tarballs, etc.)
|
||||
*/
|
||||
|
||||
#define RAW_IMAGE_MAGIC 0x0
|
||||
|
||||
/*
|
||||
* The magic-s below correspond to coordinates
|
||||
* of various Russian towns in the NNNNEEEE form.
|
||||
|
Reference in New Issue
Block a user