From 93cb65c5dc58bdb4ed9532748593d717cc2b68a6 Mon Sep 17 00:00:00 2001
From: Manuel Franceschini <manuel.franceschini@gmail.com>
Date: Mon, 28 Apr 2008 15:24:20 +0000
Subject: [PATCH] Add file backend storage options to ImportInstance

This patch adds the file storage options to gnt-backup import which
would otherwise fail since the values of file_storage_dir and
file_driver are accessed in LUCreateInstance.

Reviewed-by: ultrotter
---
 scripts/gnt-backup | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/gnt-backup b/scripts/gnt-backup
index 538b9eca6..e11b43896 100755
--- a/scripts/gnt-backup
+++ b/scripts/gnt-backup
@@ -100,6 +100,8 @@ def ImportInstance(opts, args):
                                 ip=opts.ip, bridge=opts.bridge, start=False,
                                 src_node=opts.src_node, src_path=opts.src_dir,
                                 wait_for_sync=opts.wait_for_sync, mac="auto",
+                                file_storage_dir=opts.file_storage_dir,
+                                file_driver=opts.file_driver,
                                 iallocator=opts.iallocator)
   SubmitOpCode(op)
   return 0
@@ -160,6 +162,12 @@ import_opts = [
   make_option("--iallocator", metavar="<NAME>",
               help="Select nodes for the instance automatically using the"
               " <NAME> iallocator plugin", default=None, type="string"),
+  make_option("--file-storage-dir", dest="file_storage_dir",
+              help="Relative path under default cluster-wide file storage dir"
+              " to store file-based disks", default=None,
+              metavar="<DIR>"),
+  make_option("--file-driver", dest="file_driver", help="Driver to use"
+              " for image files", default="loop", metavar="<DRIVER>"),
   ]
 
 commands = {
-- 
GitLab