From nobody Mon Feb 9 10:34:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1582578892; cv=none; d=zohomail.com; s=zohoarc; b=GTgBHDPfg49cZL1MKglbnJ/sVg6/cqqeadRMO05YI1f+8uGMBX9kQDHANRgWoAmXge/Vz2jJGceBl45Tz6R3x5/rRZsmHGKyTYa0vf5H5VwwgxK+82+Nv+LIjKAOkHcRED9i5DS75vcRKSth3WShKBaSRdATXzjv74oibuJ3njw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582578892; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=vpe0/c5G0MXd4JAhsy6/u+S1fhUP7KtMyY9f4+3J9y0=; b=SXCGwbCONGZKGAy8L/4INQdbEllgSjtnkNwn8/EBget8hOZ1tXHQRdWjIClLP9DBMekKzAGMZaBhZWo27B5QfKUJnI9sqo+YyFxXq07b/NYRtlMOXx4HSaY5tn7u2rMnjKLrZ4vwt7c7ONhIoM1wYXIGLs6uUxtFgWExgDeaaho= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582578892736213.37818066030638; Mon, 24 Feb 2020 13:14:52 -0800 (PST) Received: from localhost ([::1]:43518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6L3z-00048J-Ff for importer@patchew.org; Mon, 24 Feb 2020 16:14:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50789) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6Kmf-0007VN-Tn for qemu-devel@nongnu.org; Mon, 24 Feb 2020 15:56:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6Kme-0003jn-1Z for qemu-devel@nongnu.org; Mon, 24 Feb 2020 15:56:57 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:44798) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6Kmd-0003ih-OW for qemu-devel@nongnu.org; Mon, 24 Feb 2020 15:56:55 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01OKrXG6032136; Mon, 24 Feb 2020 20:56:51 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2yauqua0pk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Feb 2020 20:56:50 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01OKq5u5171230; Mon, 24 Feb 2020 20:56:50 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 2ybdshksbm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Feb 2020 20:56:50 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 01OKunv2028718; Mon, 24 Feb 2020 20:56:49 GMT Received: from jaraman-bur-1.us.oracle.com (/10.152.33.39) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 24 Feb 2020 12:56:49 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : in-reply-to : references; s=corp-2020-01-29; bh=vpe0/c5G0MXd4JAhsy6/u+S1fhUP7KtMyY9f4+3J9y0=; b=uykGE8go7EUwEw0hPoulYcC8MArfUGyM7lglFb7LD0RmG/br2pOVg+YuNJxKoZbKSPvJ BxWcdiD7LkL0E1mA1Ed/ZkC623UJlHGbS19T6vz3uW4DtD4naD3+yejUVDBOCv7EHSrr /S8SKPcYUR6gCaVG8rBJyQoZKD+ZVKHgNQ5v3cNStnMt25fIYCl82bYJEZrwI3Ivbk2N 7ElRFkPzgSebxb7IQfWfV+ya3P5dwU9fyVF3Zh4lZJkQPV/dGTdHki/JtW68L66079yF oBJIjmQK+jUkl94GCLReh/WbLh5UxzVyGaDbvMHd+RMk9VVcDiQSKYiTa+VVVdyKXDAl Pg== From: Jagannathan Raman To: qemu-devel@nongnu.org Subject: [PATCH v5 34/50] multi-process/mon: choose HMP commands based on target Date: Mon, 24 Feb 2020 15:55:25 -0500 Message-Id: X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9541 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=1 spamscore=0 malwarescore=0 mlxscore=0 bulkscore=0 mlxlogscore=964 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002240153 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9541 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 adultscore=0 phishscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002240153 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.86 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: elena.ufimtseva@oracle.com, fam@euphon.net, swapnil.ingle@nutanix.com, john.g.johnson@oracle.com, kraxel@redhat.com, jag.raman@oracle.com, quintela@redhat.com, mst@redhat.com, armbru@redhat.com, kanth.ghatraju@oracle.com, felipe@nutanix.com, thuth@redhat.com, ehabkost@redhat.com, konrad.wilk@oracle.com, dgilbert@redhat.com, liran.alon@oracle.com, stefanha@redhat.com, thanos.makatos@nutanix.com, rth@twiddle.net, kwolf@redhat.com, berrange@redhat.com, mreitz@redhat.com, ross.lagerwall@citrix.com, marcandre.lureau@gmail.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Elena Ufimtseva Add "targets" field to HMP command definition to select the targets which would be supported by each command Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hmp-commands-info.hx | 10 ++++++++++ hmp-commands.hx | 20 ++++++++++++++++++++ scripts/hxtool | 44 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 72 insertions(+), 2 deletions(-) mode change 100644 =3D> 100755 scripts/hxtool diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 257ee7d..631cc76 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -19,6 +19,7 @@ ETEXI .params =3D "", .help =3D "show the version of QEMU", .cmd =3D hmp_info_version, + .targets =3D "scsi", .flags =3D "p", }, =20 @@ -48,6 +49,7 @@ ETEXI .params =3D "", .help =3D "show the character devices", .cmd =3D hmp_info_chardev, + .targets =3D "scsi", .flags =3D "p", }, =20 @@ -64,6 +66,7 @@ ETEXI .help =3D "show info of one block device or all block device= s " "(-n: show named nodes; -v: show details)", .cmd =3D hmp_info_block, + .targets =3D "scsi", }, =20 STEXI @@ -78,6 +81,7 @@ ETEXI .params =3D "", .help =3D "show block device statistics", .cmd =3D hmp_info_blockstats, + .targets =3D "scsi", }, =20 STEXI @@ -92,6 +96,7 @@ ETEXI .params =3D "", .help =3D "show progress of ongoing block device operations", .cmd =3D hmp_info_block_jobs, + .targets =3D "scsi", }, =20 STEXI @@ -167,6 +172,7 @@ ETEXI .params =3D "", .help =3D "show the command line history", .cmd =3D hmp_info_history, + .targets =3D "scsi", .flags =3D "p", }, =20 @@ -224,6 +230,7 @@ ETEXI .params =3D "", .help =3D "show PCI info", .cmd =3D hmp_info_pci, + .targets =3D "scsi", }, =20 STEXI @@ -630,6 +637,7 @@ ETEXI .params =3D "", .help =3D "show device tree", .cmd =3D hmp_info_qtree, + .targets =3D "scsi", }, =20 STEXI @@ -644,6 +652,7 @@ ETEXI .params =3D "", .help =3D "show qdev device model list", .cmd =3D hmp_info_qdm, + .targets =3D "scsi", }, =20 STEXI @@ -658,6 +667,7 @@ ETEXI .params =3D "[path]", .help =3D "show QOM composition tree", .cmd =3D hmp_info_qom_tree, + .targets =3D "scsi", .flags =3D "p", }, =20 diff --git a/hmp-commands.hx b/hmp-commands.hx index dc23185..ecc6169 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -49,6 +49,7 @@ ETEXI .params =3D "", .help =3D "quit the emulator", .cmd =3D hmp_quit, + .targets =3D "scsi", }, =20 STEXI @@ -82,6 +83,7 @@ ETEXI .params =3D "device size", .help =3D "resize a block image", .cmd =3D hmp_block_resize, + .targets =3D "scsi", }, =20 STEXI @@ -99,6 +101,7 @@ ETEXI .params =3D "device [speed [base]]", .help =3D "copy data from a backing file into a block device= ", .cmd =3D hmp_block_stream, + .targets =3D "scsi", }, =20 STEXI @@ -113,6 +116,7 @@ ETEXI .params =3D "device speed", .help =3D "set maximum speed for a background block operatio= n", .cmd =3D hmp_block_job_set_speed, + .targets =3D "scsi", }, =20 STEXI @@ -129,6 +133,7 @@ ETEXI "\n\t\t\t if you want to abort the operation immedia= tely" "\n\t\t\t instead of keep running until data is in s= ync)", .cmd =3D hmp_block_job_cancel, + .targets =3D "scsi", }, =20 STEXI @@ -143,6 +148,7 @@ ETEXI .params =3D "device", .help =3D "stop an active background block operation", .cmd =3D hmp_block_job_complete, + .targets =3D "scsi", }, =20 STEXI @@ -158,6 +164,7 @@ ETEXI .params =3D "device", .help =3D "pause an active background block operation", .cmd =3D hmp_block_job_pause, + .targets =3D "scsi", }, =20 STEXI @@ -172,6 +179,7 @@ ETEXI .params =3D "device", .help =3D "resume a paused background block operation", .cmd =3D hmp_block_job_resume, + .targets =3D "scsi", }, =20 STEXI @@ -186,6 +194,7 @@ ETEXI .params =3D "[-f] device", .help =3D "eject a removable medium (use -f to force it)", .cmd =3D hmp_eject, + .targets =3D "scsi", }, =20 STEXI @@ -200,6 +209,7 @@ ETEXI .params =3D "device", .help =3D "remove host block device", .cmd =3D hmp_drive_del, + .targets =3D "scsi", }, =20 STEXI @@ -219,6 +229,7 @@ ETEXI .params =3D "device filename [format [read-only-mode]]", .help =3D "change a removable medium, optional format", .cmd =3D hmp_change, + .targets =3D "scsi", }, =20 STEXI @@ -732,6 +743,7 @@ ETEXI .help =3D "add device, like -device on the command line", .cmd =3D hmp_device_add, .command_completion =3D device_add_completion, + .targets =3D "scsi", }, =20 STEXI @@ -747,6 +759,7 @@ ETEXI .help =3D "remove device", .cmd =3D hmp_device_del, .command_completion =3D device_del_completion, + .targets =3D "scsi", }, =20 STEXI @@ -1351,6 +1364,7 @@ ETEXI "The -c flag requests QEMU to compress backup data\n= \t\t\t" "(if the target format supports it).\n\t\t\t", .cmd =3D hmp_drive_backup, + .targets =3D "scsi", }, STEXI @item drive_backup @@ -1368,6 +1382,7 @@ ETEXI "[,readonly=3Don|off][,copy-on-read=3Don|off]", .help =3D "add drive to PCI storage controller", .cmd =3D hmp_drive_add, + .targets =3D "scsi", }, =20 STEXI @@ -1816,6 +1831,7 @@ ETEXI .help =3D "add chardev", .cmd =3D hmp_chardev_add, .command_completion =3D chardev_add_completion, + .targets =3D "scsi", }, =20 STEXI @@ -1831,6 +1847,7 @@ ETEXI .params =3D "id args", .help =3D "change chardev", .cmd =3D hmp_chardev_change, + .targets =3D "scsi", }, =20 STEXI @@ -1848,6 +1865,7 @@ ETEXI .help =3D "remove chardev", .cmd =3D hmp_chardev_remove, .command_completion =3D chardev_remove_completion, + .targets =3D "scsi", }, =20 STEXI @@ -1864,6 +1882,7 @@ ETEXI .help =3D "send a break on chardev", .cmd =3D hmp_chardev_send_break, .command_completion =3D chardev_remove_completion, + .targets =3D "scsi", }, =20 STEXI @@ -1940,6 +1959,7 @@ ETEXI .params =3D "[subcommand]", .help =3D "show various information about the system state", .cmd =3D hmp_info_help, + .targets =3D "scsi", .sub_table =3D hmp_info_cmds, .flags =3D "p", }, diff --git a/scripts/hxtool b/scripts/hxtool old mode 100644 new mode 100755 index 0003e7b..802cbd4 --- a/scripts/hxtool +++ b/scripts/hxtool @@ -10,7 +10,14 @@ hxtoh() STEXI*|ETEXI*|SRST*|ERST*) flag=3D$(($flag^1)) ;; *) - test $flag -eq 1 && printf "%s\n" "$str" + # Skip line that has ".targets" as it is for multi-process tar= gets based hmp + # commands generation. + echo $str | grep -q '.targets' + if [ $? -eq 0 ]; then + continue + else + test $flag -eq 1 && printf "%s\n" "$str" + fi ;; esac done @@ -84,16 +91,49 @@ hxtotexi() print_texi_heading "$(expr "$str" : "ARCHHEADING(\(.*\),.*)")" ;; *) - test $flag -eq 1 && printf '%s\n' "$str" + # Skip line that has ".targets" as it is for multi-process tar= gets based hmp + # commands generation. + echo $str | grep -q '.targetss' + if [ $? -eq 0 ]; then + continue + else + test $flag -eq 1 && printf '%s\n' "$str" + fi ;; esac line=3D$((line+1)) done } =20 +hxtoh_tgt() +{ + section=3D"" + flag=3D1 + use_section=3D0 + while read -r str; do + # Print section if it has ".targets" and the second argument passe= d to the + # script, such as "scsi". + echo "$str" | grep -q -E ".targets.*$1" + if [ $? -eq 0 ]; then + use_section=3D1 + continue + fi + case $str in + HXCOMM*) + ;; + STEXI*|ETEXI*) flag=3D$(($flag^1)); test $use_section -eq 1 &&= printf '%s' "$section"; section=3D""; use_section=3D0 + ;; + *) + test $flag -eq 1 && section=3D"${section} ${str} ${IFS}" + ;; + esac + done +} + case "$1" in "-h") hxtoh ;; "-t") hxtotexi ;; +"-tgt") hxtoh_tgt $2 ;; *) exit 1 ;; esac =20 --=20 1.8.3.1