From d74f4741e7116946d07db7708e1673dbe06c61ef Mon Sep 17 00:00:00 2001 From: Bella Khizgiyaev Date: Mon, 20 May 2024 19:59:55 +0300 Subject: [PATCH] adding logs Signed-off-by: Bella Khizgiyaev --- cmd/virt-v2v-monitor/virt-v2v-monitor.go | 2 +- virt-v2v/cold/entrypoint.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/virt-v2v-monitor/virt-v2v-monitor.go b/cmd/virt-v2v-monitor/virt-v2v-monitor.go index 5e4a8fbf2..53cc51e6d 100644 --- a/cmd/virt-v2v-monitor/virt-v2v-monitor.go +++ b/cmd/virt-v2v-monitor/virt-v2v-monitor.go @@ -58,7 +58,7 @@ func updateProgress(progressCounter *prometheus.CounterVec, disk, progress uint6 func main() { // Start prometheus metrics HTTP handler - fmt.Println("virt-v2v monitoring: Setting up prometheus endpoint :2112/metrics") + fmt.Println("virt-v2v monitoring: Bella Setting up prometheus endpoint :2112/metrics") http.Handle("/metrics", promhttp.Handler()) go http.ListenAndServe(":2112", nil) diff --git a/virt-v2v/cold/entrypoint.go b/virt-v2v/cold/entrypoint.go index 5c47fe383..212128ff7 100644 --- a/virt-v2v/cold/entrypoint.go +++ b/virt-v2v/cold/entrypoint.go @@ -197,6 +197,7 @@ func executeVirtV2v(source string, args []string) (err error) { r, w := io.Pipe() virtV2vCmd.Stdout = w virtV2vCmd.Stderr = w + defer w.Close() fmt.Println("exec ", virtV2vCmd) if err = virtV2vCmd.Start(); err != nil { @@ -224,6 +225,7 @@ func executeVirtV2v(source string, args []string) (err error) { } if source == OVA { + fmt.Println("we are in the ova scanner") scanner := bufio.NewScanner(teeOut) const maxCapacity = 1024 * 1024 buf := make([]byte, 0, 64*1024) @@ -231,12 +233,14 @@ func executeVirtV2v(source string, args []string) (err error) { for scanner.Scan() { line := scanner.Bytes() + fmt.Println("this is the line", string(line)) if match := UEFI_RE.FindSubmatch(line); match != nil { fmt.Println("UEFI firmware detected") firmware = "efi" } } + fmt.Println("we are here - after the loop") if err = scanner.Err(); err != nil { fmt.Println("Output query failed:", err) return @@ -247,7 +251,6 @@ func executeVirtV2v(source string, args []string) (err error) { fmt.Printf("Error waiting for virt-v2v to finish: %v\n", err) return } - w.Close() return }