Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ISC2
virtu
scripts
Commits
f60f378d
Verified
Commit
f60f378d
authored
1 year ago
by
iliya.saroukha
Browse files
Options
Downloads
Patches
Plain Diff
fix: correctly creating VM when both options are enabled (previously ifs were cascading)
parent
d2d399e4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vm_run.sh
+15
-10
15 additions, 10 deletions
vm_run.sh
with
15 additions
and
10 deletions
vm_run.sh
+
15
−
10
View file @
f60f378d
...
@@ -52,28 +52,33 @@ CPU_COUNT="2"
...
@@ -52,28 +52,33 @@ CPU_COUNT="2"
NET_PV
=
"-nic user,model=virtio-net-pci"
NET_PV
=
"-nic user,model=virtio-net-pci"
GPU_PV
=
"-vga virtio"
GPU_PV
=
"-vga virtio"
# SPICE_SERVER="-device virtio-serial-pci \
# -spice port=8000,disable-ticketing=on \
# -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
# -chardev spicevmc,id=spicechannel0,name=vdagent,clipboard=on"
QEMU_GA
=
"-device virtio-serial
\
QEMU_GA
=
"-device virtio-serial
\
-device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0
\
-device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0
\
-chardev socket,path=/tmp/qga.sock,server=on,wait=off,id=qga0"
-chardev socket,path=/tmp/qga.sock,server=on,wait=off,id=qga0"
SPICE_GA
=
"-device virtio-serial-pci
\
SPICE_GA
=
"-device virtio-serial-pci
\
-
chardev qemu-vdagent,id=ch1,name=vdagent,clipboard=on
\
-
device virtserialport,chardev=ch1,id=ch1,name=com.redhat.spice.0
\
-
device virtserialport,chardev=ch1,id=ch1,name=com.redhat.spice.0
"
-
chardev qemu-vdagent,id=ch1,name=vdagent,clipboard=on
"
if
$DISK_OPT
&&
$ISO_OPT
;
then
qemu-system-x86_64
-boot
order
=
d
-cdrom
$ISO_PATH
-m
$MEM_COUNT
-smp
\
cpus
=
$CPU_COUNT
-enable-kvm
$NET_PV
$GPU_PV
\
-drive
file
=
$DISK_PATH
,index
=
0,media
=
disk,format
=
qcow2,if
=
virtio
\
$QEMU_GA
$SPICE_GA
fi
if
$DISK_OPT
;
then
if
$DISK_OPT
;
then
qemu-system-x86_64
-m
$MEM_COUNT
-smp
cpus
=
$CPU_COUNT
-enable-kvm
$NET_PV
\
qemu-system-x86_64
-m
$MEM_COUNT
-smp
cpus
=
$CPU_COUNT
-enable-kvm
$NET_PV
\
$GPU_PV
$DISK_PATH
$QEMU_GA
$SPICE_GA
$GPU_PV
$DISK_PATH
$QEMU_GA
$SPICE_GA
$SPICE_SERVER
fi
fi
if
$ISO_OPT
;
then
if
$ISO_OPT
;
then
qemu-system-x86_64
-cdrom
$ISO_PATH
-m
$MEM_COUNT
-smp
cpus
=
$CPU_COUNT
\
qemu-system-x86_64
-cdrom
$ISO_PATH
-m
$MEM_COUNT
-smp
cpus
=
$CPU_COUNT
\
-enable-kvm
$NET_PV
$GPU_PV
$QEMU_GA
$SPICE_GA
-enable-kvm
$NET_PV
$GPU_PV
$QEMU_GA
$SPICE_GA
fi
fi
if
$DISK_OPT
&&
$ISO_OPT
;
then
qemu-system-x86_64
-boot
=
d
-cdrom
$ISO_PATH
-m
$MEM_COUNT
-smp
\
cpus
=
$CPU_COUNT
-enable-kvm
$NET_PV
$GPU_PV
\
-drive
file
=
$DISK_PATH
,index
=
0,media
=
disk,format
=
qcow2,if
=
virtio
\
$QEMU_GA
$SPICE_GA
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment