From 151a1b88cb2c700ed1c5bf14e0d6f9dc737c010e Mon Sep 17 00:00:00 2001 From: Bella Khizgiyaev Date: Tue, 21 May 2024 14:24:43 +0300 Subject: [PATCH] OVA: remove synchronization for firmware detection scanner Signed-off-by: Bella Khizgiyaev --- virt-v2v/cold/entrypoint.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/virt-v2v/cold/entrypoint.go b/virt-v2v/cold/entrypoint.go index fa010a1a4..2a053b3f7 100644 --- a/virt-v2v/cold/entrypoint.go +++ b/virt-v2v/cold/entrypoint.go @@ -203,7 +203,6 @@ func executeVirtV2v(source string, args []string) error { v2vCmd.Stderr = writer defer writer.Close() - done := make(chan error, 1) if source == OVA { monitorStdoutPipe, err := monitorCmd.StdoutPipe() if err != nil { @@ -211,10 +210,9 @@ func executeVirtV2v(source string, args []string) error { return err } monitorOut := io.TeeReader(monitorStdoutPipe, os.Stdout) - go parseFirmware(monitorOut, done) + go parseFirmware(monitorOut) } else { monitorCmd.Stdout = os.Stdout - done <- nil } if err := monitorCmd.Start(); err != nil { @@ -236,15 +234,10 @@ func executeVirtV2v(source string, args []string) error { return err } - if err := <-done; err != nil { - fmt.Printf("Error getting output from monitor command: %v\n", err) - return err - } - return nil } -func parseFirmware(reader io.Reader, done chan error) { +func parseFirmware(reader io.Reader) { scanner := bufio.NewScanner(reader) const maxCapacity = 1024 * 1024 buf := make([]byte, 0, 64*1024) @@ -257,8 +250,6 @@ func parseFirmware(reader io.Reader, done chan error) { firmware = "efi" } } - - done <- scanner.Err() } func getXMLFile(dir, fileExtension string) (string, error) {