Skip to content

Commit 9f977b4

Browse files
authored
Merge pull request #1820 from nanjj/enable_s4
incusd/instance/qemu: Enable s4 by default
2 parents 5e3483a + 7b96874 commit 9f977b4

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

doc/reference/instance_options.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -299,16 +299,17 @@ value = "1"
299299
[global]
300300
driver = "ICH9-LPC"
301301
property = "disable_s4"
302-
value = "1"
302+
value = "0"
303303
```
304304

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

308309
```
309310
raw.qemu.conf: |-
310311
[global][1]
311-
value = "0"
312+
value = "1"
312313
```
313314

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

328329
### Override QEMU runtime objects

internal/server/instance/drivers/driver_qemu_config_test.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestQemuConfigTemplates(t *testing.T) {
4848
[global]
4949
driver = "ICH9-LPC"
5050
property = "disable_s4"
51-
value = "1"
51+
value = "0"
5252
5353
[boot-opts]
5454
strict = "on"`,
@@ -1097,7 +1097,7 @@ func TestQemuConfigTemplates(t *testing.T) {
10971097
Entries: []cfg.Entry{
10981098
{Key: "driver", Value: "ICH9-LPC"},
10991099
{Key: "property", Value: "disable_s4"},
1100-
{Key: "value", Value: "1"},
1100+
{Key: "value", Value: "0"},
11011101
},
11021102
}, {
11031103
Name: "memory",
@@ -1135,7 +1135,7 @@ func TestQemuConfigTemplates(t *testing.T) {
11351135
[global]
11361136
driver = "ICH9-LPC"
11371137
property = "disable_s4"
1138-
value = "1"
1138+
value = "0"
11391139
11401140
[memory]
11411141
size = "1024M"
@@ -1168,7 +1168,7 @@ func TestQemuConfigTemplates(t *testing.T) {
11681168
[global]
11691169
driver = "ICH9-LPC"
11701170
property = "disable_s4"
1171-
value = "1"
1171+
value = "0"
11721172
11731173
[memory]
11741174
size = "4096M"
@@ -1201,7 +1201,7 @@ func TestQemuConfigTemplates(t *testing.T) {
12011201
[global]
12021202
driver = "ICH9-LPC"
12031203
property = "disable_s4"
1204-
value = "1"
1204+
value = "0"
12051205
12061206
[memory]
12071207
size = "1024M"
@@ -1238,7 +1238,7 @@ func TestQemuConfigTemplates(t *testing.T) {
12381238
[global]
12391239
driver = "ICH9-LPC"
12401240
property = "disable_s4"
1241-
value = "1"
1241+
value = "0"
12421242
12431243
[memory]
12441244
size = "1024M"
@@ -1279,7 +1279,7 @@ func TestQemuConfigTemplates(t *testing.T) {
12791279
[global]
12801280
driver = "ICH9-LPC"
12811281
property = "disable_s4"
1282-
value = "1"
1282+
value = "0"
12831283
12841284
[memory]
12851285
size = "2048M"
@@ -1338,7 +1338,7 @@ func TestQemuConfigTemplates(t *testing.T) {
13381338
[global]
13391339
driver = "ICH9-LPC"
13401340
property = "disable_s4"
1341-
value = "1"
1341+
value = "0"
13421342
13431343
[memory]
13441344
size = "1024M"
@@ -1385,7 +1385,7 @@ func TestQemuConfigTemplates(t *testing.T) {
13851385
[global]
13861386
driver = "ICH9-LPC"
13871387
property = "disable_s4"
1388-
value = "1"
1388+
value = "0"
13891389
13901390
[memory]
13911391
size = "1024M"
@@ -1470,7 +1470,7 @@ func TestQemuConfigTemplates(t *testing.T) {
14701470
[global]
14711471
driver = "ICH9-LPC"
14721472
property = "disable_s4"
1473-
value = "1"
1473+
value = "0"
14741474
14751475
[memory]
14761476
size = "1024M"
@@ -1525,7 +1525,7 @@ func TestQemuConfigTemplates(t *testing.T) {
15251525
[global]
15261526
driver = "ICH9-LPC"
15271527
property = "disable_s4"
1528-
value = "1"
1528+
value = "0"
15291529
15301530
[memory]
15311531
size = "8192M"

internal/server/instance/drivers/driver_qemu_templates.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func qemuBase(opts *qemuBaseOpts) []cfg.Section {
101101
Entries: []cfg.Entry{
102102
{Key: "driver", Value: "ICH9-LPC"},
103103
{Key: "property", Value: "disable_s4"},
104-
{Key: "value", Value: "1"},
104+
{Key: "value", Value: "0"},
105105
},
106106
}}...)
107107
}

0 commit comments

Comments
 (0)