Skip to content

Commit

Permalink
Merge pull request #699 from stgraber/main
Browse files Browse the repository at this point in the history
incusd/instance/qemu: Make rootfs.img be 0600
  • Loading branch information
brauner authored Mar 29, 2024
2 parents 8c6d7d6 + 60ce910 commit ec8d61a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/server/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -6284,7 +6284,7 @@ func (d *qemu) Export(w io.Writer, properties map[string]string, expiration time
_ = from.Close()
}

to, err := os.OpenFile(fPath, unix.O_DIRECT|unix.O_CREAT, 0)
to, err := os.OpenFile(fPath, unix.O_DIRECT|unix.O_CREAT, 0600)
if err == nil {
cmd = append(cmd, "-t", "none")
_ = to.Close()
Expand Down
4 changes: 2 additions & 2 deletions internal/server/storage/drivers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ func copyDevice(inputPath string, outputPath string) error {
cmd := []string{
"nice", "-n19", // Run dd with low priority to reduce CPU impact on other processes.
"dd", fmt.Sprintf("if=%s", inputPath), fmt.Sprintf("of=%s", outputPath),
"bs=16M", // Use large buffer to reduce syscalls and speed up copy.
"conv=nocreat", // Don't create output file if missing (expect caller to have created output file).
"bs=16M", // Use large buffer to reduce syscalls and speed up copy.
"conv=nocreat,sparse", // Don't create output file if missing (expect caller to have created output file), also attempt to make a sparse file.
}

// Check for Direct I/O support.
Expand Down

0 comments on commit ec8d61a

Please sign in to comment.