[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH V4 03/12] TestSupport.pm: move rewrite_config_nocd to support library



Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 Osstest/TestSupport.pm |   11 +++++++++++
 ts-redhat-install      |   11 +----------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 228389c..2a36d9d 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -99,6 +99,7 @@ BEGIN {
                       setup_pxeboot setup_pxeboot_local host_pxefile
 
                       create_iso_xorriso
+                      rewrite_config_nocd
                       );
     %EXPORT_TAGS = ( );
 
@@ -1874,4 +1875,14 @@ END
 
 }
 
+sub rewrite_config_nocd ($$$) {
+    my ($ho,$gho,$emptyiso) = @_;
+    guest_editconfig($ho, $gho, sub {
+        if (m/^\s*disk\s*\=/ .. /\]/) {
+            s/\Q$gho->{Rimage}\E/$emptyiso/;
+        }
+        s/^on_reboot.*/on_reboot='restart'/;
+    });
+}
+
 1;
diff --git a/ts-redhat-install b/ts-redhat-install
index 1a81ec9..c0f4e76 100755
--- a/ts-redhat-install
+++ b/ts-redhat-install
@@ -168,15 +168,6 @@ sub start () {
     target_cmd_root($ho, "$xl create $gho->{CfgPath}", 100);
 }
 
-sub rewrite_config_nocd () {
-    guest_editconfig($ho, $gho, sub {
-        if (m/^\s*disk\s*\=/ .. /\]/) {
-            s/\Q$gho->{Rimage}\E/$emptyiso/;
-        }
-        s/^on_reboot.*/on_reboot='restart'/;
-    });
-}
-
 if (!$stage) {
     prep();
     start();
@@ -188,7 +179,7 @@ if ($stage<2) {
     guest_destroy($ho,$gho);
 }
 
-rewrite_config_nocd();
+rewrite_config_nocd($ho,$gho,$emptyiso);
 start();
 guest_await_dhcp_tcp($gho,300);
 guest_check_up($gho);
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.