Skip to content

Commit

Permalink
adding logs
Browse files Browse the repository at this point in the history
Signed-off-by: Bella Khizgiyaev <[email protected]>
  • Loading branch information
bkhizgiy committed May 20, 2024
1 parent 133a960 commit d74f474
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/virt-v2v-monitor/virt-v2v-monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 4 additions & 1 deletion virt-v2v/cold/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -224,19 +225,22 @@ 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)
scanner.Buffer(buf, maxCapacity)

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
Expand All @@ -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
}

Expand Down

0 comments on commit d74f474

Please sign in to comment.