# cat serial-pci.sh
#!/bin/bash
# set i to 0
i=0
while [ $i -le 32 ]
do
echo "{\"execute\":\"device_add\",\"arguments\":{\"driver\":\"virtio-serial-pci\",\"id\":\"virtio-serial$i\"}}"
i=$(( i+1 ))
done
virtserialport.sh
#!/bin/bash
# set i to 0
i=0
while [ $i -le 32 ]
do
echo "{\"execute\":\"device_add\",\"arguments\":{\"driver\":\"virtserialport\",\"bus\":\"virtio-serial$i.0\",\"chardev\":\"channel$i\",\"name\":\"org.linux-kvm.port.$i\",\"id\":\"port$i\"}}"
i=$(( i+1 ))
done
removeport.sh
===============
#!/bin/bash
# set i to 0
i=0
while [ $i -le 32 ]
do
echo "{\"execute\":\"device_del\",\"arguments\":{\"id\":\"port$i\"}}"
i=$(( i+1 ))
done
rm_pci.sh
#!/bin/bash
# set i to 0
i=0
while [ $i -le 32 ]
do
echo "{\"execute\":\"device_del\",\"arguments\":{\"id\":\"virtio-serial$i\"}}"
i=$(( i+1 ))
done
#!/bin/bash
# set i to 0
i=0
while [ $i -le 32 ]
do
echo "{\"execute\":\"device_add\",\"arguments\":{\"driver\":\"virtio-serial-pci\",\"id\":\"virtio-serial$i\"}}"
i=$(( i+1 ))
done
virtserialport.sh
#!/bin/bash
# set i to 0
i=0
while [ $i -le 32 ]
do
echo "{\"execute\":\"device_add\",\"arguments\":{\"driver\":\"virtserialport\",\"bus\":\"virtio-serial$i.0\",\"chardev\":\"channel$i\",\"name\":\"org.linux-kvm.port.$i\",\"id\":\"port$i\"}}"
i=$(( i+1 ))
done
removeport.sh
===============
#!/bin/bash
# set i to 0
i=0
while [ $i -le 32 ]
do
echo "{\"execute\":\"device_del\",\"arguments\":{\"id\":\"port$i\"}}"
i=$(( i+1 ))
done
rm_pci.sh
#!/bin/bash
# set i to 0
i=0
while [ $i -le 32 ]
do
echo "{\"execute\":\"device_del\",\"arguments\":{\"id\":\"virtio-serial$i\"}}"
i=$(( i+1 ))
done