summaryrefslogtreecommitdiff
path: root/src/import/import-raw.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-20 01:36:11 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-20 15:06:58 +0100
commit56ebfaf1ca185a93ffb372b6e1a1fa3a957d93cd (patch)
tree247317cdedacfbbc7771e450076e91f08c8ce115 /src/import/import-raw.c
parenta2e0337875addaf08225fbf9b231435ba12a88b5 (diff)
import: add support for pulling raw tar balls as containers
Ubuntu provides their cloud images optionally as tarball, hence also support downloading those.
Diffstat (limited to 'src/import/import-raw.c')
-rw-r--r--src/import/import-raw.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c
index 486157aa96..1fe27b6932 100644
--- a/src/import/import-raw.c
+++ b/src/import/import-raw.c
@@ -30,6 +30,7 @@
#include "qcow2-util.h"
#include "strv.h"
#include "copy.h"
+#include "import-util.h"
#include "import-raw.h"
typedef struct RawImportFile RawImportFile;
@@ -691,17 +692,6 @@ static int raw_import_file_progress_callback(void *userdata, curl_off_t dltotal,
return 0;
}
-static bool etag_is_valid(const char *etag) {
-
- if (!endswith(etag, "\""))
- return false;
-
- if (!startswith(etag, "\"") && !startswith(etag, "W/\""))
- return false;
-
- return true;
-}
-
static int raw_import_file_find_old_etags(RawImportFile *f) {
_cleanup_free_ char *escaped_url = NULL;
_cleanup_closedir_ DIR *d = NULL;
@@ -751,7 +741,7 @@ static int raw_import_file_find_old_etags(RawImportFile *f) {
if (!u)
return -ENOMEM;
- if (!etag_is_valid(u)) {
+ if (!http_etag_is_valid(u)) {
free(u);
continue;
}