Skip to content

Commit

Permalink
Fix #67: Use unsafe as the cache mode disks
Browse files Browse the repository at this point in the history
This should improve performance.
  • Loading branch information
jacob-carlborg committed Dec 24, 2023
1 parent d918493 commit 20ad4b2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Expand Up @@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#61](https://github.com/cross-platform-actions/action/issues/61),
[#72](https://github.com/cross-platform-actions/action/issues/72)).

- Use `unsafe` as the cache mode for QEMU disks. This should improve performance ([#67](https://github.com/cross-platform-actions/action/issues/67)).

## [0.21.1] - 2023-11-03
### Fixed
- FreeBSD jobs occasionally fail when ejecting the disk ([#64](https://github.com/cross-platform-actions/action/issues/64))
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/operating_systems/freebsd/qemu_vm.ts
Expand Up @@ -5,10 +5,10 @@ export class QemuVm extends Vm {
// prettier-ignore
return [
'-device', 'virtio-blk-pci,drive=drive0,bootindex=0',
'-drive', `if=none,file=${this.configuration.diskImage},id=drive0,cache=writeback,discard=ignore,format=raw`,
'-drive', `if=none,file=${this.configuration.diskImage},id=drive0,cache=unsafe,discard=ignore,format=raw`,

'-device', 'virtio-blk-pci,drive=drive1,bootindex=1',
'-drive', `if=none,file=${this.configuration.resourcesDiskImage},id=drive1,cache=writeback,discard=ignore,format=raw`,
'-drive', `if=none,file=${this.configuration.resourcesDiskImage},id=drive1,cache=unsafe,discard=ignore,format=raw`,
]
}
}
4 changes: 2 additions & 2 deletions src/qemu_vm.ts
Expand Up @@ -61,10 +61,10 @@ export abstract class Vm extends vm.Vm {
'-device', 'virtio-scsi-pci',

'-device', 'scsi-hd,drive=drive0,bootindex=0',
'-drive', `if=none,file=${this.configuration.diskImage},id=drive0,cache=writeback,discard=ignore,format=raw`,
'-drive', `if=none,file=${this.configuration.diskImage},id=drive0,cache=unsafe,discard=ignore,format=raw`,

'-device', 'scsi-hd,drive=drive1,bootindex=1',
'-drive', `if=none,file=${this.configuration.resourcesDiskImage},id=drive1,cache=writeback,discard=ignore,format=raw`,
'-drive', `if=none,file=${this.configuration.resourcesDiskImage},id=drive1,cache=unsafe,discard=ignore,format=raw`,
]
}

Expand Down

0 comments on commit 20ad4b2

Please sign in to comment.