From patchwork Thu Mar 7 07:22:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 10842329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D8C01515 for ; Thu, 7 Mar 2019 07:47:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE4D32E98A for ; Thu, 7 Mar 2019 07:47:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2B382E99C; Thu, 7 Mar 2019 07:47:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5BA472E98A for ; Thu, 7 Mar 2019 07:47:39 +0000 (UTC) Received: from localhost ([127.0.0.1]:46931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1nkg-00077G-Ie for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Mar 2019 02:47:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1nMa-0002lw-CJ for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1nMX-0005in-H7 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:42 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:50788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1nMU-0005fG-ND for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:39 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x277K2cM034689; Thu, 7 Mar 2019 07:22:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=bMHXWCDOh88mVzH3CmtMetjAgAzXJRLxnpq9rpK1nqk=; b=yZP4atsqUiwUjknmzTbD8gmf5n1D4VGTp67MnS1yiJwC3nbXU5kr7bOdnjv9E6Hl6SIq NBhnZ36fX1Fac+xe+LQJTmaOYgHV4wVF8Nwju1AVysp9jH77CMVQzmzeMZ9QwXurgT+P EFCytEhR1RizQLaegidhRc8C6e55HIo2qiDCMbS6uEXsxFC9Qk8aZFWHe7B8HENgpfcV E6Hx0ZVfUz9A7gaMcFaHePRKLWtbOut9dizHbOXrSdMZxFK9pg448jCINEGQYePB8CR8 g82SvlPrzpY1A3fgI59A42zsFLaS0XT2EjheIo9WZJvxP265H9mGJrIG02WK9qOoRfBH sw== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2qyfbeggje-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Mar 2019 07:22:30 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x277MO7P006808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Mar 2019 07:22:24 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x277MOxF011783; Thu, 7 Mar 2019 07:22:24 GMT Received: from heatpipe.hsd1.ca.comcast.net (/73.170.27.202) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Mar 2019 23:22:23 -0800 From: elena.ufimtseva@oracle.com To: qemu-devel@nongnu.org Date: Wed, 6 Mar 2019 23:22:20 -0800 Message-Id: <20190307072220.9207-1-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9187 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903070053 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 141.146.126.79 Subject: [Qemu-devel] [multiprocess RFC PATCH 23/37] multi-process: add command line options rdrive and rdevice X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: elena.ufimtseva@oracle.com, john.g.johnson@oracle.com, sstabellini@kernel.org, jag.raman@oracle.com, konrad.wilk@oracle.com, armbru@redhat.com, mreitz@redhat.com, ross.lagerwall@citrix.com, liran.alon@oracle.com, stefanha@redhat.com, kanth.ghatraju@oracle.com, kwolf@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Elena Ufimtseva 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 Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John G Johnson --- blockdev.c | 12 ++++++++++++ include/sysemu/sysemu.h | 2 ++ qdev-monitor.c | 9 +++++++++ qemu-options.hx | 26 ++++++++++++++++++++++++++ 4 files changed, 49 insertions(+) diff --git a/blockdev.c b/blockdev.c index 7e6bf99..c03a09f 100644 --- a/blockdev.c +++ b/blockdev.c @@ -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 */ } + }, +}; diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 89604a8..82622be 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -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 diff --git a/qdev-monitor.c b/qdev-monitor.c index 46d0ad0..eb7e542 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -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]; diff --git a/qemu-options.hx b/qemu-options.hx index 1cf9aac..0b82013 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -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"