before: -initrd $initrd after: -initrd concatenated-initrd
[why] 1. concatenated-initrd is a file, no path involved, can use directly, so remove $initrd. 2. set_initrd() also unnecessary if directly use concatenated-initrd, so remove set_initrd(). 3. naming the file concatenated-initrd to make it more obvious and searchable.
refer: [PATCH v5 compass-ci 2/2] providers/qemu: remove unnecessary variable
Signed-off-by: Liu Yinsi liuyinsi@163.com --- providers/qemu/kvm.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/providers/qemu/kvm.sh b/providers/qemu/kvm.sh index 103e9e6..68b9a62 100755 --- a/providers/qemu/kvm.sh +++ b/providers/qemu/kvm.sh @@ -76,16 +76,12 @@ check_qemu()
check_initrds() { - [ -n "$initrds" ] || { + if [ -n "$initrds" ]; then + cat $initrds > concatenated-initrd + else log_error "The current initrds is null." exit 1 - } -} - -set_initrd() -{ - initrd=initrd - cat $initrds > $initrd + fi }
set_bios() @@ -148,7 +144,7 @@ public_option() $qemu -name guest=$hostname,process=$job_id -kernel $kernel - -initrd $initrd + -initrd concatenated-initrd -smp $nr_cpu -m $memory -rtc base=localtime @@ -211,7 +207,6 @@ run_qemu()
set_options() { - set_initrd set_bios set_helper set_nic