]> xenbits.xensource.com Git - osstest.git/commitdiff
Host install: Break out target_core_dump_setup
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 25 Sep 2015 11:09:09 +0000 (12:09 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 25 Sep 2015 11:26:57 +0000 (12:26 +0100)
We are going to want to do this for nested HVM L1s too.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
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
ts-host-install

index a3a99822f9ce6aa48299b67a32d1117871846cd4..fb24a1e8715a11c9656ce3a0fbc743770b0533b0 100644 (file)
@@ -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;
index 3f7f060237086d9c6ab2139cf4a54685e10553ea..5bbc0a78c7d6466bc84c1ae63f692b3ca821162f 100755 (executable)
@@ -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);