@@ -74,6 +74,21 @@ Create a virtio-vsock tunnel for Guest-to-Host communication.
7474 --vsock /tmp/vsock.sock create;
7575```
7676
77+ Create virtio-net devices.
78+
79+ > The type of the ` --virnets ` receives an array of VirtioNetDeviceConfigInfo in the
80+ > format of JSON.
81+
82+ ```
83+ ./dbs-cli \
84+ --log-file dbs-cli.log --log-level ERROR \
85+ --kernel-path ~/path/to/kernel/vmlinux.bin \
86+ --rootfs ~/path/to/rootfs/bionic.rootfs.ext4 \
87+ --boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" \
88+ --virnets "[{\"iface_id\":\"eth0\",\"host_dev_name\":\"tap0\",\"num_queues\":2,\"queue_size\":0,\"guest_mac\":\"43:2D:9C:13:71:48\",\"allow_duplicate_mac\":true}]" \
89+ create;
90+ ```
91+
7792# 2. Usage
7893
7994## 1. Create API Server and Update VM
@@ -85,6 +100,19 @@ After api socket created, you could use `./dbs-cli --api-sock-path [socket path]
85100Right now, we have only one command for cpu resizing, and here is the command example.
86101
87102` sudo ./dbs-cli --api-sock-path [socket path] --vcpu-resize 2 update `
103+
104+ Create hot-plug virtio-net devices via API Server.
105+
106+ > The type of the ` --hotplug-virnets ` receives an array of
107+ > VirtioNetDeviceConfigInfo in the format of JSON.
108+
109+ ```
110+ sudo ./dbs-cli \
111+ --api-sock-path [socket path]
112+ --hotplug-virnets "[{\"iface_id\":\"eth0\",\"host_dev_name\":\"tap0\",\"num_queues\":2,\"queue_size\":0,\"guest_mac\":\"43:2D:9C:13:71:48\",\"allow_duplicate_mac\":true}]" \
113+ update
114+ ```
115+
88116## 2. Exit vm
89117
90118> If you want to exit vm, just input ` reboot ` in vm's console.
0 commit comments