tests/nbd: Unlink pidfile before running qemu-nbd

It might be left over from a previous failed run.  Best to unlink the
old file before starting qemu-nbd, so there's no possibility of
getting confused later when we wait for the file to appear.
This commit is contained in:
Richard W.M. Jones
2022-12-02 11:57:16 +00:00
parent 98ab261a05
commit dc9bdda084

View File

@@ -52,6 +52,7 @@ sub run_test {
my $cwd = getcwd ();
my $server;
my $pidfile = "$cwd/nbd/nbd.pid";
unlink "$pidfile";
my @qemu_nbd = ("qemu-nbd", $disk, "-t", "--pid-file", $pidfile);
if ($has_format_opt) {
push @qemu_nbd, "--format", "raw";