Skip to contentSkip to conversation

all guest creation: Pause 10s to work around libxl/blkback races

PATCH New Ian Jackson 1 participant 2 messages Nov 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 all guest creation: Pause 10s to work around libxl/blkback races

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ß <[email protected]>
CC Wei Liu <[email protected]>
CC Anthony PERARD <[email protected]>
---
 Osstest/TestSupport.pm       | 2 ++
 Osstest/Toolstack/libvirt.pm | 1 -
 Osstest/Toolstack/xl.pm      | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)
Osstest/TestSupport.pm +2 -0
index 9c99ee17..f2baa7c2 100644
@@ -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'};
 
Osstest/Toolstack/libvirt.pm +0 -1
index 23c76cc0..e817f5b4 100644
@@ -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);
Osstest/Toolstack/xl.pm +0 -1
index 517b0f4d..85972753 100644
@@ -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);
 }
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

PATCH 2/2 Revert "guest_prepare_disk: Only do the umount if we set an env var"

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";
---
 Osstest/TestSupport.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Osstest/TestSupport.pm +1 -2
index f2baa7c2..44f01a86 100644
@@ -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";
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel