Skip to content

Commit a0e61df

Browse files
committed
fwcfg: update command to make it more accurate and general
Currently, this command can not get available disk in bootc host, besides that, this command also not setup the output's units, it will get a wrong number if the command execute in a large system( disk size > 1T).So update the command to fix above errors Signed-off-by: Leidong Wang <[email protected]>
1 parent d84af53 commit a0e61df

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

qemu/tests/cfg/fwcfg.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
vmcoreinfo = yes
77
start_vm = no
88
tmp_dir = "/var/tmp"
9-
get_avail_disk = df -h /home | grep home | awk -F "G" '{print $3}'
9+
get_avail_disk = df -BG /home | awk 'NR==2 {print $4}' | sed 's/G//'
1010
unzip_cmd = 'powershell -command "Expand-Archive %s:\Memory.dmp.zip %s:"'
1111
unzip_timeout = 1800
1212
dump_file = Memory.dmp

qemu/tests/cfg/fwcfg_enable.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
start_vm = no
1010
setup_verifier = no
1111
tmp_dir = "/home/tmp"
12-
get_avail_disk = df -h /home | grep home | awk -F "G" '{print $3}'
12+
get_avail_disk = df -BG /home | awk 'NR==2 {print $4}' | sed 's/G//'
1313
unzip_cmd = 'powershell -command "Expand-Archive %s:\Memory.dmp.zip %s:"'
1414
unzip_timeout = 1800
1515
dump_file = Memory.dmp

qemu/tests/cfg/win_virtio_driver_update_test.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
device_name = "QEMU FwCfg Device"
289289
device_hwid = '"ACPI\VEN_QEMU&DEV_0002"'
290290
tmp_dir = "/home/tmp"
291-
get_avail_disk = df -h /home | grep home | awk -F "G" '{print $3}'
291+
get_avail_disk = df -BG /home | awk 'NR==2 {print $4}' | sed 's/G//'
292292
unzip_cmd = 'powershell -command "Expand-Archive %s:\Memory.dmp.zip %s:"'
293293
unzip_timeout = 1800
294294
dump_file = Memory.dmp

0 commit comments

Comments
 (0)