xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [Xen-devel] [OSSTEST PATCH 1/2] all guest creation: Pause 10s to work around libxl/blkback races
@ 2019-11-11 11:58 Ian Jackson
  2019-11-11 11:58 ` [Xen-devel] [OSSTEST PATCH 2/2] Revert "guest_prepare_disk: Only do the umount if we set an env var" Ian Jackson
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Jackson @ 2019-11-11 11:58 UTC (permalink / raw)
  To: xen-devel; +Cc: Jürgen Groß, Anthony PERARD, Ian Jackson, Wei Liu

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 --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);
 }
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Xen-devel] [OSSTEST PATCH 2/2] Revert "guest_prepare_disk: Only do the umount if we set an env var"
  2019-11-11 11:58 [Xen-devel] [OSSTEST PATCH 1/2] all guest creation: Pause 10s to work around libxl/blkback races Ian Jackson
@ 2019-11-11 11:58 ` Ian Jackson
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Jackson @ 2019-11-11 11:58 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

This reverts commit ea6626f7edd9eb40a3510eaf6816a77cac4f63d0.

Contrary to the assertions in the commit message, this unmount etc. is
actually used by some tests.  So removing it breaks things.

Now, we have a different workaround: a 10s sleep before we attempt the
umount.  The combination of
  ea6626f7 guest_prepare_disk: Only do the umount if we set an env var
  1d3a97b0 xl guest creation: Pause 10s to work around libxl/blkback races
  3a208c18 all guest creation: Pause 10s to work around libxl/blkback races
and this revert is simply this:

  @@ -1938,6 +1938,8 @@ sub guest_create_paused ($) {
   sub guest_prepare_disk ($) {
       my ($gho) = @_;

  +    sleep(10);
  +
       guest_umount_lv($gho->{Host}, $gho);

       return if ($gho->{Diskfmt} // 'none') eq "none";

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/TestSupport.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index f2baa7c2..44f01a86 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1940,8 +1940,7 @@ sub guest_prepare_disk ($) {
 
     sleep(10);
 
-    guest_umount_lv($gho->{Host}, $gho)
-	if $ENV{'OSSTEST_GUEST_DISK_MOUNT_CLEANUP'};
+    guest_umount_lv($gho->{Host}, $gho);
 
     return if ($gho->{Diskfmt} // 'none') eq "none";
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-11 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 11:58 [Xen-devel] [OSSTEST PATCH 1/2] all guest creation: Pause 10s to work around libxl/blkback races Ian Jackson
2019-11-11 11:58 ` [Xen-devel] [OSSTEST PATCH 2/2] Revert "guest_prepare_disk: Only do the umount if we set an env var" Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).