From patchwork Thu Mar 7 07:22:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 10842325 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 2CCA914DE for ; Thu, 7 Mar 2019 07:45:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19A5B2E8F0 for ; Thu, 7 Mar 2019 07:45:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D8A62E925; Thu, 7 Mar 2019 07:45:25 +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 77FC82E8F0 for ; Thu, 7 Mar 2019 07:45:24 +0000 (UTC) Received: from localhost ([127.0.0.1]:46864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1niV-0003jG-Oo for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Mar 2019 02:45:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1nMx-00039F-Hl for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:23:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1nMw-0006lO-9U for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:23:07 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:51310) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1nMv-0006at-6G for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:23:05 -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 x277JHcZ033911; Thu, 7 Mar 2019 07:23:01 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=Y9ZGZypfPiibPbuFNxFWllovtDXnMgtqxUCSlAf0dDA=; b=yarli5LgXNPtPUoD+nrFPWrPdlNIzfp7OgbGPKonHniu1Gl0CrKwt98T9yC5Hhs3GhIW EXq2tyA6Uc3PaiV0LMxE2FPaNtB7qLEZ2ujJPXu2fUtCYZKwqvUAuCR2zRGQhjJi13ZF JPvr4AuMhj0dXfOB1X2WQJyv/g9jJCVaIAylUpe+H5GVeZCa8lAT6V/znV29YXY2plVK ObjtiumKP4DADz51xNQG7PnB/0djYQJ7AfzxM/w4DmlVHZAE8s/1XE2wL+aYoBwEbTTL Qfzg1ORERS+WAxwLoCP4YUflGNW9IuuR6kq/6W1UBOW5+RDmZSJzJQ5qbaWy+r9USFX5 6A== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2qyfbeggmd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Mar 2019 07:23:01 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x277N0xn003103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Mar 2019 07:23:00 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x277MwZY005824; Thu, 7 Mar 2019 07:23:00 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:58 -0800 From: elena.ufimtseva@oracle.com To: qemu-devel@nongnu.org Date: Wed, 6 Mar 2019 23:22:56 -0800 Message-Id: <20190307072256.9917-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 37/37] multi-process: add configure and usage information 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, ross.lagerwall@citrix.com, liran.alon@oracle.com, stefanha@redhat.com, kanth.ghatraju@oracle.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 Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John G Johnson --- docs/qemu-multiprocess.txt | 104 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 docs/qemu-multiprocess.txt diff --git a/docs/qemu-multiprocess.txt b/docs/qemu-multiprocess.txt new file mode 100644 index 0000000..b0428da --- /dev/null +++ b/docs/qemu-multiprocess.txt @@ -0,0 +1,104 @@ +/* + * Copyright 2019, Oracle and/or its affiliates. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +Multi-process QEMU + +This document describes how to configure and use multi-process qemu. +For the design document refer to docs/devel/qemu-multiprocess. + +Configure + +To enable support for multi-process add --enable-mpqemu +to the list of options for configure. + +Usage + +Command line + +To start qemu with devices intended to run in the separate emulation +process, the following options are used: + + -rdevice, -rdrive: + this is similar to -device option, with only difference being + the "rid" option that identifies the remote process. + +For exmaple, for non multi-process qemu: + -device lsi53c895a,id=scsi0 device + -device scsi-hd,drive=drive0,bus=scsi0.0,scsi-id=0 + -drive id=drive0,file=data-disk.img + +and for multi-process qemu: + -rdevice lsi53c895a,id=scsi0,rid=0 + -rdevice scsi-hd,drive=drive0,bus=scsi0.0,scsi-id=0,rid=0 + -rdrive id=drive0,file=data-disk.img,rid=0 + + +The memorybackend object has to be specified on the command line: +-object memory-backend-file,id=mem,mem-path=/dev/shm/,size=4096M,share=on + + +Example of running scsi drive in the guest in separate qemu +process: + +qemu-system-x86_64 -enable-kvm -machine q35 -smp 4 -m 4096M -vnc :0 \ +-net nic -net user,hostfwd=tcp::5022-:22 -hda os.qcow2 \ +-rdevice lsi53c895a,rid=0,id=scsi0 \ +-rdevice scsi-hd,rid=0,drive=drive0,bus=scsi0.0,scsi-id=0 \ +-rdrive id=drive0,rid=0,file=data-disk.img \ +-object memory-backend-file,id=mem,mem-path=/dev/shm/,size=4096M,share=on -numa node,memdev=mem + +HMP commands + +For hotplugging in multi-process qemu the following commands +can be used: + +- rdevice_add; +- rdevice_del; +- rdrive_add; +- rdrive_del; +- remote_proc_list + +Example: + +qemu-system-x86_64 -enable-kvm -machine q35 -smp 4 -m 4096M -vnc :0 \ +-net nic -net user,hostfwd=tcp::5022-:22 \ +-drive file=/root/ol7.qcow2,format=raw \ +-rdevice lsi53c895a,rid=0,id=scsi0 \ +-object memory-backend-file,id=mem,mem-path=/dev/shm/,size=4096M,share=on \ +-numa node,memdev=mem \ +-monitor stdio + +(qemu) rdrive_add 0 drive0 file=/root/cirros-0.4.0-x86_64-disk.img +(qemu) rdevice_add 0 scsi-hd drive1 drive0 scsi0.0 +(qemu) remote_proc_list + PID RID QEMU ID PROCESS NAME + +00011079 0 drive0 qemu-scsi-dev +00011079 0 drive1 qemu-scsi-dev +00011079 0 0 qemu-scsi-dev + +After running rescan_scsi_bus.sh -a, guest will be able to identify newly +added devices. + + +