diff mbox series

[OSSTEST,1/2] all guest creation: Pause 10s to work around libxl/blkback races

Message ID 20191111115835.31285-1-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series [OSSTEST,1/2] all guest creation: Pause 10s to work around libxl/blkback races | expand

Commit Message

Ian Jackson Nov. 11, 2019, 11:58 a.m. UTC
In 1d3a97b06d2c
  xl guest creation: Pause 10s to work around libxl/blkback races
we added a 10s delay to work around a race bug in Linux blkback.

This was intended to be used in combination with ea6626f7edd9
  guest_prepare_disk: Only do the umount if we set an env var
after which it is only xl which is vulnerable to this race.
But that commit was wrong, so we must revert it.  After we do
that the sleep in the xl driver will come too late.

So, move the 10s sleep from the osstest xl and libvirt drivers to the
general guest preparation step, right next to where the affected lv in
use check is.

This is still a bodge, unfortunately.

CC: Jürgen Groß <jgross@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/TestSupport.pm       | 2 ++
 Osstest/Toolstack/libvirt.pm | 1 -
 Osstest/Toolstack/xl.pm      | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 9c99ee17..f2baa7c2 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1938,6 +1938,8 @@  sub guest_create_paused ($) {
 sub guest_prepare_disk ($) {
     my ($gho) = @_;
 
+    sleep(10);
+
     guest_umount_lv($gho->{Host}, $gho)
 	if $ENV{'OSSTEST_GUEST_DISK_MOUNT_CLEANUP'};
 
diff --git a/Osstest/Toolstack/libvirt.pm b/Osstest/Toolstack/libvirt.pm
index 23c76cc0..e817f5b4 100644
--- a/Osstest/Toolstack/libvirt.pm
+++ b/Osstest/Toolstack/libvirt.pm
@@ -55,7 +55,6 @@  sub create ($$) {
     my $lcfg = $cfg;
     $lcfg =~ s,/,-,g;
     $lcfg = hostnamepath($ho)."--$lcfg";
-    sleep(10);
     target_cmd_root($ho, "virsh domxml-from-native xen-xl $cfg > $cfg.xml", 30);
     target_getfile_root($ho,60,"$cfg.xml", "$stash/$lcfg");
     target_cmd_root($ho, "virsh create --file $cfg.xml", 100);
diff --git a/Osstest/Toolstack/xl.pm b/Osstest/Toolstack/xl.pm
index 517b0f4d..85972753 100644
--- a/Osstest/Toolstack/xl.pm
+++ b/Osstest/Toolstack/xl.pm
@@ -43,7 +43,6 @@  sub destroy ($$) {
 sub _create ($$$) {
     my ($self,$gho,$options) = @_;
     my $cfg = $gho->{CfgPath};
-    sleep(10);
     target_cmd_root($self->{Host},
 		    $self->{_VerboseCommand}." create $options $cfg", 100);
 }