Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4002CC43334 for ; Wed, 15 Jun 2022 15:26:48 +0000 (UTC) Received: from localhost ([::1]:47552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1Uut-0003cA-2t for qemu-devel@archiver.kernel.org; Wed, 15 Jun 2022 11:26:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1UOv-0007tO-GO for qemu-devel@nongnu.org; Wed, 15 Jun 2022 10:53:45 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:27086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1UOt-00017n-8u for qemu-devel@nongnu.org; Wed, 15 Jun 2022 10:53:44 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25FE0c2Z001492; Wed, 15 Jun 2022 14:53:15 GMT 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; s=corp-2021-07-09; bh=7tyxW1gFURtYbDz4zwB3N0WvJeD2az8xGMuQaS2NWYk=; b=PtfZUHLrja8xtEiovHTMVpo5bhmTBGHR4vgWLK3moguRnglc0OVKPIQDkZLPLmZ51dZN Fon32RVnwBP+gVcWUnbzWvZcQs53WqVooAInIebpGNNqA6o8Xp8xlMoPErjKDvJ03NkH Jhhq+YW87/mfRZVk0WmjhB3HH65CukgUUtgipB/kcY7rnWKHK8FqGGVmhxIEKCYNRr9J t7vd5GhMWJB5aVzhLzwyCyU7DAHmivwCvAfIqMTI1Y3ziiFnYcmWmPtBecFKmD+b+uFt UjZiM+LIRblu+UD9WYxyOjYqsMA1wNVLfSFAtyN4q0jXw11hU/kfa89ZDQaaUS0MKA2K Yg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gmjns8tnr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Jun 2022 14:53:15 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25FEQ7AB023097; Wed, 15 Jun 2022 14:53:14 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gpr25vq8e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Jun 2022 14:53:14 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 25FEqSNx018501; Wed, 15 Jun 2022 14:53:14 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gpr25vpfm-39; Wed, 15 Jun 2022 14:53:14 +0000 From: Steve Sistare To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Stefan Hajnoczi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , Marcel Apfelbaum , Alex Williamson , "Daniel P. Berrange" , Juan Quintela , Markus Armbruster , Eric Blake , Jason Zeng , Zheng Chuan , Steve Sistare , Mark Kanda , Guoyi Tu , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Igor Mammedov , David Hildenbrand , John Snow Subject: [PATCH V8 38/39] python/machine: add QEMUMachine accessors Date: Wed, 15 Jun 2022 07:52:25 -0700 Message-Id: <1655304746-102776-39-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1655304746-102776-1-git-send-email-steven.sistare@oracle.com> References: <1655304746-102776-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-GUID: Hqdt7RJzoybz-tl9O1lKE1rTKbli5s8- X-Proofpoint-ORIG-GUID: Hqdt7RJzoybz-tl9O1lKE1rTKbli5s8- Received-SPF: pass client-ip=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Provide full_args() to return all command-line arguments used to start a vm, some of which are not otherwise visible to QEMUMachine clients. This is needed by the cpr test, which must start a vm, then pass all qemu command-line arguments to the cpr-exec monitor call. Provide reopen_qmp_connection() to reopen a closed monitor connection. This is needed by cpr, because qemu-exec closes the monitor socket. Signed-off-by: Steve Sistare --- python/qemu/machine/machine.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 37191f4..60b934d 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -332,6 +332,11 @@ def args(self) -> List[str]: """Returns the list of arguments given to the QEMU binary.""" return self._args + @property + def full_args(self) -> List[str]: + """Returns the full list of arguments used to launch QEMU.""" + return list(self._qemu_full_args) + def _pre_launch(self) -> None: if self._console_set: self._remove_files.append(self._console_address) @@ -486,6 +491,15 @@ def _close_qmp_connection(self) -> None: finally: self._qmp_connection = None + def reopen_qmp_connection(self): + self._close_qmp_connection() + self._qmp_connection = QEMUMonitorProtocol( + self._monitor_address, + server=True, + nickname=self._name + ) + self._qmp.accept(self._qmp_timer) + def _early_cleanup(self) -> None: """ Perform any cleanup that needs to happen before the VM exits. -- 1.8.3.1