multi-process: add command line options rdrive and rdevice
RFC PATCH 23/37 multi-process: add command line options rdrive and rdevice
From: Elena Ufimtseva <[email protected]>
These command option have the same notion as the drive and device, except these will be emulated in remote process.
Added parameter rid identified the remote process group.
As an example, this will create the device emulated by the remote process:
/usr/local/bin/qemu-system-x86_64 -name vm -m 6G -drive file=/root/ol7.qcow2,format=raw
-enable-kvm -machine q35,accel=kvm
-rdevice lsi53c895a,rid=0,id=scsi0,command=qemu-scsi-dev
-rdevice scsi-hd,rid=0,drive=drive0,bus=scsi0.0,scsi-id=0
-rdrive id=drive0,rid=0,file=/root/cirros-0.4.0-x86_64-disk.img,format=qcow3 -object memory-backend-file,id=mem,mem-path=/dev/shm/,size=6G,share=on -numa node,memdev=mem -display none -vnc :0 -monitor stdio
--- blockdev.c | 12 ++++++++++++ include/sysemu/sysemu.h | 2 ++ qdev-monitor.c | 9 +++++++++ qemu-options.hx | 26 ++++++++++++++++++++++++++ 4 files changed, 49 insertions(+)
blockdev.c +12 -0
@@ -4580,3 +4580,15 @@ QemuOptsList qemu_drive_opts = { {/* end of list */ } }, }; + +QemuOptsList qemu_rdrive_opts = { + .name ="rdrive" , + .head =QTAILQ_HEAD_INITIALIZER (qemu_rdrive_opts.head), + .desc = { +/* +* no elements => accept any params +* validation will happen later +*/ + {/* end of list */ } + }, +};
include/sysemu/sysemu.h +2 -0
@@ -193,5 +193,7 @@ extern QemuOptsList qemu_nic_opts;extern QemuOptsList qemu_net_opts;extern QemuOptsList qemu_global_opts;extern QemuOptsList qemu_mon_opts; +extern QemuOptsList qemu_rdevice_opts; +extern QemuOptsList qemu_rdrive_opts;#endif
qdev-monitor.c +9 -0
@@ -964,6 +964,15 @@ QemuOptsList qemu_global_opts = { }, }; +QemuOptsList qemu_rdevice_opts = { + .name ="rdevice" , + .implied_opt_name ="driver" , + .head =QTAILQ_HEAD_INITIALIZER (qemu_rdevice_opts.head), + .desc = { + {/* end of list */ } + }, +}; +int qemu_global_option (const char *str) {char driver[64 ], property[64 ];
qemu-options.hx +26 -0
@@ -535,6 +535,17 @@ Like the KCS interface, but defines a BT interface. The default port is ETEXI +DEF("rdevice", HAS_ARG, QEMU_OPTION_rdevice, + "-rdevice driver[,prop[=value][,...]]\n" + " add device (based on driver)\n" + " prop=value,... sets driver properties\n" + " use '-device help' to print all possible drivers\n" + " use '-device driver,help' to print all possible properties\n", + QEMU_ARCH_ALL) +STEXI +Remote device options. +ETEXI + DEF("name", HAS_ARG, QEMU_OPTION_name, "-name string1[,process=string2][,debug-threads=on|off]\n" " set the name of the guest\n"
@@ -786,6 +797,21 @@ Please refer to the QAPI documentation of the @code{blockdev-add} QMP command. ETEXI +DEF("rdrive", HAS_ARG, QEMU_OPTION_rdrive, + "-rdrive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" + " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n" + " [,snapshot=on|off][,rerror=ignore|stop|report]\n" + " [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n" + " [,readonly=on|off][,copy-on-read=on|off]\n" + " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n" + " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n" + " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n" + " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n" + " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n" + " [[,iops_size=is]]\n" + " [[,group=g]]\n" + " use 'file' as a drive image\n", QEMU_ARCH_ALL) + DEF("drive", HAS_ARG, QEMU_OPTION_drive, "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
Signature · 1 line
1.8.3.1