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

[Xen-devel] [OSSTEST PATCH 8/9] Host install: Break out target_core_dump_setup



We are going to want to do this for nested HVM L1s too.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
v14: Split this nfc patch out from other changes
     Drop changes to whitespace usage
     Rename new function from `core_dump_setup'
     Drop introduction of an unnecessary mkdir -p
---
 Osstest/TestSupport.pm |   19 +++++++++++++++++++
 ts-host-install        |   15 +--------------
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index a3a9982..fb24a1e 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -116,6 +116,7 @@ BEGIN {
                       iso_copy_content_from_image
                       guest_editconfig_nocd
                       host_install_postboot_complete
+                      target_core_dump_setup
                       );
     %EXPORT_TAGS = ( );
 
@@ -2401,4 +2402,22 @@ sub host_install_postboot_complete ($) {
     target_cmd_root($ho, "update-rc.d osstest-confirm-booted start 99 2 .");
 }
 
+sub target_core_dump_setup ($) {
+    my ($ho) = @_;
+    target_cmd_root($ho, 'mkdir -p /var/core');
+    target_editfile_root($ho, '/etc/sysctl.conf',
+       sub { target_editfile_kvp_replace(
+                 "kernel.core_pattern",
+                 # %p==pid,%e==executable name,%t==timestamp
+                 "/var/core/%t.%p.%e.core") });
+    target_cmd_root($ho, "sysctl --load /etc/sysctl.conf");
+    my $coredumps_conf = <<'END';
+#<domain>      <type>  <item>       <value>
+*               soft    core         -1
+root            soft    core         -1
+END
+    target_putfilecontents_root_stash($ho,10,$coredumps_conf,
+                               '/etc/security/limits.d/coredumps.conf');
+}
+
 1;
diff --git a/ts-host-install b/ts-host-install
index 3f7f060..5bbc0a7 100755
--- a/ts-host-install
+++ b/ts-host-install
@@ -150,20 +150,7 @@ END
        });
     }
 
-    target_cmd_root($ho, 'mkdir -p /var/core');
-    target_editfile_root($ho, '/etc/sysctl.conf',
-       sub { target_editfile_kvp_replace(
-                 "kernel.core_pattern",
-                 # %p==pid,%e==executable name,%t==timestamp
-                 "/var/core/%t.%p.%e.core") });
-    target_cmd_root($ho, "sysctl --load /etc/sysctl.conf");
-    my $coredumps_conf = <<'END';
-#<domain>      <type>  <item>       <value>
-*               soft    core         -1
-root            soft    core         -1
-END
-    target_putfilecontents_root_stash($ho,10,$coredumps_conf,
-                               '/etc/security/limits.d/coredumps.conf');
+    target_core_dump_setup($ho);
 
     host_install_postboot_complete($ho);
 
-- 
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®.