Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incusd/instance/qemu enable s4 by default #1820

Merged
merged 2 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions doc/reference/instance_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,17 @@ value = "1"
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"
```

To specify which section to override, specify an index.
For example:
The first `global` section disabled S3(Suspend to RAM), the second `global`
section enabled S4(suspend to disk). In order to disable S4, the second `global`
section index needs to be specified:

```
raw.qemu.conf: |-
[global][1]
value = "0"
value = "1"
```

Section indexes start at 0 (which is the default value when not specified), so the above example would generate the following configuration:
Expand All @@ -322,7 +323,7 @@ value = "1"
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "0"
value = "1"
```

### Override QEMU runtime objects
Expand Down
22 changes: 11 additions & 11 deletions internal/server/instance/drivers/driver_qemu_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestQemuConfigTemplates(t *testing.T) {
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"

[boot-opts]
strict = "on"`,
Expand Down Expand Up @@ -1097,7 +1097,7 @@ func TestQemuConfigTemplates(t *testing.T) {
Entries: []cfg.Entry{
{Key: "driver", Value: "ICH9-LPC"},
{Key: "property", Value: "disable_s4"},
{Key: "value", Value: "1"},
{Key: "value", Value: "0"},
},
}, {
Name: "memory",
Expand Down Expand Up @@ -1135,7 +1135,7 @@ func TestQemuConfigTemplates(t *testing.T) {
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"

[memory]
size = "1024M"
Expand Down Expand Up @@ -1168,7 +1168,7 @@ func TestQemuConfigTemplates(t *testing.T) {
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"

[memory]
size = "4096M"
Expand Down Expand Up @@ -1201,7 +1201,7 @@ func TestQemuConfigTemplates(t *testing.T) {
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"

[memory]
size = "1024M"
Expand Down Expand Up @@ -1238,7 +1238,7 @@ func TestQemuConfigTemplates(t *testing.T) {
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"

[memory]
size = "1024M"
Expand Down Expand Up @@ -1279,7 +1279,7 @@ func TestQemuConfigTemplates(t *testing.T) {
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"

[memory]
size = "2048M"
Expand Down Expand Up @@ -1338,7 +1338,7 @@ func TestQemuConfigTemplates(t *testing.T) {
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"

[memory]
size = "1024M"
Expand Down Expand Up @@ -1385,7 +1385,7 @@ func TestQemuConfigTemplates(t *testing.T) {
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"

[memory]
size = "1024M"
Expand Down Expand Up @@ -1470,7 +1470,7 @@ func TestQemuConfigTemplates(t *testing.T) {
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"

[memory]
size = "1024M"
Expand Down Expand Up @@ -1525,7 +1525,7 @@ func TestQemuConfigTemplates(t *testing.T) {
[global]
driver = "ICH9-LPC"
property = "disable_s4"
value = "1"
value = "0"

[memory]
size = "8192M"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func qemuBase(opts *qemuBaseOpts) []cfg.Section {
Entries: []cfg.Entry{
{Key: "driver", Value: "ICH9-LPC"},
{Key: "property", Value: "disable_s4"},
{Key: "value", Value: "1"},
{Key: "value", Value: "0"},
},
}}...)
}
Expand Down