Skip to content

Commit

Permalink
Merge pull request #2923 from tamird/cleaner-writing
Browse files Browse the repository at this point in the history
Simplify QEMU write path
  • Loading branch information
jandubois authored Nov 24, 2024
2 parents c10cb9c + 6916da5 commit 1be5489
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/vz/network_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,12 @@ func (c *qemuPacketConn) Write(b []byte) (int, error) {
return 0, err
}

start := 0
for start < size {
nw, err := c.Conn.Write(b[start:])
for len(b) != 0 {
n, err := c.Conn.Write(b)
if err != nil {
return 0, err
}
start += nw
b = b[n:]
}
return size, nil
}
Expand Down

0 comments on commit 1be5489

Please sign in to comment.