From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056067; cv=none; d=zohomail.com; s=zohoarc; b=bHlqJhnmjPvWGywmxqwEf86Ihj9iaGL1mGBxsG/fYoE0Fr2OFoc28SD/dfNSc92QoROilhjtPhZDjf3fj2TYEY3Hic4/H7ycyjiYuPlew63OWrFlUTvN/HveqBijP0O8igbzBixNGgI6TnR1nhGyjSK663k/cREmunpKUtDIMgI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056067; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7g4ik3n9rXKLqV5tQr9q5/mKNM9KZrY7Adp1jHZ1wXc=; b=NgSQvE0vTUkF0YilimbN5OeaWvg7Mzh+K4XQVzUM4pRX+nvuUZk0h83+HlRPMojLCGcdxCUr06DZdNICbiwtqXgGVv98GkhA9xoxW2pNe5ITmspmejp9uCZnBtsBhr0FzLpRlT7xHFFtAUKTPPqXVrr8SItTRDypZkDmZbloERE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056067045927.2704551327172; Tue, 14 Jan 2020 18:41:07 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbb-0004sJ-2L; Wed, 15 Jan 2020 02:40:27 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbZ-0004rT-F1 for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:25 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5abbccaa-3740-11ea-b89f-bc764e2007e4; Wed, 15 Jan 2020 02:40:12 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B80F3221D8; Tue, 14 Jan 2020 21:40:12 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:12 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 4A6FA30607B0; Tue, 14 Jan 2020 21:40:11 -0500 (EST) X-Inumbo-ID: 5abbccaa-3740-11ea-b89f-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=4AkMKCE/qXH5e58ZM24BOy6reR36X75ZiqMz4JRPO O0=; b=eaRiYlLRPOnTDMT9v3J97l2vXPjUlHAVO9r3naVRZ56TAjvy8MUkuGoiT aMJmlUxQzfiu7zHYbGWlw3idzFclR4PKydyGlqX25qRCuIc47Q6TyDn76pa91QKD 8ngoERNT+ZfZr703iBAzx1BtHzNv4iuvLcsSt2GXiDz7Fr5eDZog6jzINEBfVGpt wSU+6KhjUG5a4+Gf28ZhMa/COpObgOdwfAkuoXDH/7b+iVLw8IwD92lptER9V9ie YTXs45W6VVHVi0PPEan65M8jY3fbdgYCN7kYeXdDBydaM2UR90sCeeotL9VEaJQE h0Zjoog3xG7TAGhlwMFpZ1StW7gNw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucffohhmrghinhepgigvnhdrohhr ghenucfkphepledurdeihedrfeegrdeffeenucfrrghrrghmpehmrghilhhfrhhomhepmh grrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomhenucevlhhu shhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:40 +0100 Message-Id: <901ff35e0410fe9b871169383984f1e48850a836.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 01/16] Document ioemu MiniOS stubdomain protocol X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Add documentation based on reverse-engineered toolstack-ioemu stubdomain protocol. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- docs/misc/stubdom.txt | 53 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+) diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt index de7b6c7..4c524f2 100644 --- a/docs/misc/stubdom.txt +++ b/docs/misc/stubdom.txt @@ -23,6 +23,59 @@ and http://wiki.xen.org/wiki/Device_Model_Stub_Domains f= or more information on device model stub domains =20 =20 +Toolstack to MiniOS ioemu stubdomain protocol +--------------------------------------------- + +This section describe communication protocol between toolstack and +qemu-traditional running in MiniOS stubdomain. The protocol include +expectations of both qemu and stubdomain itself. + +Setup (done by toolstack, expected by stubdomain): + - Block devices for target domain are connected as PV disks to stubdomain, + according to configuration order, starting with xvda + - Network devices for target domain are connected as PV nics to stubdomai= n, + according to configuration order, starting with 0 + - if graphics output is expected, VFB and VKB devices are set for stubdom= ain + (its backend is responsible for exposing them using appropriate protocol + like VNC or Spice) + - other target domain's devices are not connected at this point to stubdo= main + (may be hot-plugged later) + - QEMU command line (space separated arguments) is stored in + /vm//image/dmargs xenstore path + - target domain id is stored in /local/domain//target xenstor= e path +?? - bios type is stored in /local/domain//hvmloader/bios + - stubdomain's console 0 is connected to qemu log file + - stubdomain's console 1 is connected to qemu save file (for saving state) + - stubdomain's console 2 is connected to qemu save file (for restoring st= ate) + - next consoles are connected according to target guest's serial console = configuration + +Startup: +1. PV stubdomain is started with ioemu-stubdom.gz kernel and no initrd +2. stubdomain initialize relevant devices +2. stubdoma signal readiness by writing "running" to /local/domain//device-model//state xenstore path +3. now stubdomain is considered running + +Runtime control (hotplug etc): +Toolstack can issue command through xenstore. The sequence is (from toolst= ack POV): +1. Write parameter to /local/domain//device-model//= parameter. +2. Write command to /local/domain//device-model//co= mmand. +3. Wait for command result in /local/domain//device-model//state (command specific value). +4. Write "running" back to /local/domain//device-model//state. + +Defined commands: + - "pci-ins" - PCI hot plug, results: + - "pci-inserted" - success + - "pci-insert-failed" - failure + - "pci-rem" - PCI hot remove, results: + - "pci-removed" - success + - ?? + - "save" - save domain state to console 1, results: + - "paused" - success + - "continue" - resume domain execution, after loading state from console = 2 (require -loadvm command argument), results: + - "running" - success + + + PV-GRUB =3D=3D=3D=3D=3D=3D=3D =20 --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056064; cv=none; d=zohomail.com; s=zohoarc; b=aHGwy1dMiEJQXdunERVfYRCwsCitoZYIkeQ7tc96bbyREla1FP8X2o/NPlpS5UvJuBrAAhfa8AT6emMtJPqcu+9VbSphgA7gbsm5sdBM2mQCX9uBMcBnChAuHVtpyoYPUZ9jMY8ATkr34OHnCX/T6xnPMzNxrV/j0joo3/mfw5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056064; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2gQMLnlmGtkUrhxJ2mlV3LUVNeXr8KU5pVk1CZiXdPY=; b=hyO0Dp39vQ1Q9t95SLm6RPfyW7KyylwGqK4UJNF8Y/uuZMoWtUJuon+4K3a8ypso6kvjBgIZkfqKTrIhg9GMRmIJhqlNxBg71a/79wo0Ivk+AA28GgQ+1JO/2vLfYv3OCN2jqvMyz0Gpgd2CztI0wF2M0ccQZ8JLmsOIhKmCO7Q= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15790560648271021.008443016883; Tue, 14 Jan 2020 18:41:04 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbQ-0004pt-JT; Wed, 15 Jan 2020 02:40:16 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbP-0004po-CF for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:15 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5b881940-3740-11ea-84ba-12813bfff9fa; Wed, 15 Jan 2020 02:40:14 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 17008221F9; Tue, 14 Jan 2020 21:40:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:14 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id AAA6A30602DB; Tue, 14 Jan 2020 21:40:12 -0500 (EST) X-Inumbo-ID: 5b881940-3740-11ea-84ba-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=Yk+Jh+9dFTaSYNIv2aJlrU8WEPUf/EMEun9OiqiWE Gc=; b=IbhOxRoU3j7ITw3+cd569MlmzHgb38LH+xQr4Dy68ZWzjC06QU87qQVk3 w09U+Ui7+WFS0cu4lRDc47mtqpdnr+1XhmAkC65t6hkjrYZV354bNvDXYre2j6La cj/04ADfrgYwgQgfkTm6G4ZIlcqRgUGvE9iWMbCS4q/e2MnMQU5dJW+4oZt9vM5q 616pKUQqJLt1iv3bnmYEQ5rhTgz88vueJqsUmadDTMxLnmb+C0C2Es6+Lglgc1/r 65ZSMZbUFVhKyW9/358U04b2c07jLtMCuxk7+0qfUMVtQQjLq6MIOt/82JJEt0ST 9KyrUI9YJj16VV8mot+uEzwhlM3TQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:41 +0100 Message-Id: <5f675457fe322c265b3337607bc78f07ffdb43bb.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 02/16] Document ioemu Linux stubdomain protocol X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Add documentation for upcoming Linux stubdomain for qemu-upstream. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- docs/misc/stubdom.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+) diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt index 4c524f2..9c94c6b 100644 --- a/docs/misc/stubdom.txt +++ b/docs/misc/stubdom.txt @@ -75,6 +75,56 @@ Defined commands: - "running" - success =20 =20 +Toolstack to Linux ioemu stubdomain protocol +-------------------------------------------- + +This section describe communication protocol between toolstack and +qemu-upstream running in Linux stubdomain. The protocol include +expectations of both stubdomain, and qemu. + +Setup (done by toolstack, expected by stubdomain): + - Block devices for target domain are connected as PV disks to stubdomain, + according to configuration order, starting with xvda + - Network devices for target domain are connected as PV nics to stubdomai= n, + according to configuration order, starting with 0 + - [not implemented] if graphics output is expected, VFB and VKB devices a= re set for stubdomain + (its backend is responsible for exposing them using appropriate protocol + like VNC or Spice) + - other target domain's devices are not connected at this point to stubdo= main + (may be hot-plugged later) + - QEMU command line is stored in + /vm//image/dmargs xenstore dir, each argument as separate = key + in form /vm//image/dmargs/NNN, where NNN is 0-padded argum= ent + number + - target domain id is stored in /local/domain//target xenstor= e path +?? - bios type is stored in /local/domain//hvmloader/bios + - stubdomain's console 0 is connected to qemu log file + - stubdomain's console 1 is connected to qemu save file (for saving state) + - stubdomain's console 2 is connected to qemu save file (for restoring st= ate) + - next consoles are connected according to target guest's serial console = configuration + +Environment exposed by stubdomain to qemu (needed to construct appropriate= qemu command line and later interact with qmp): + - target domain's disks are available as /dev/xvd[a-z] + - console 2 (incoming domain state) is connected with FD 3 + - console 1 (saving domain state) is added over QMP to qemu as "fdset-id = 1" (done by stubdomain, toolstack doesn't need to care about it) + - nics are connected to relevant stubdomain PV vifs when available (qemu = -netdev should specify ifname=3D explicitly) + +Startup: +1. toolstack starts PV stubdomain with stubdom-linux-kernel kernel and stu= bdom-linux-initrd initrd +2. stubdomain initialize relevant devices +3. stubdomain starts qemu with requested command line, plus few stubdomain= specific ones - including local qmp access options +4. stubdomain starts vchan server on /local/domain//device-mod= el//qmp-vchan, exposing qmp socket to the toolstack +5. qemu signal readiness by writing "running" to /local/domain//device-model//state xenstore path +6. now device model is considered running + +QEMU can be controlled using QMP over vchan at /local/domain//= device-model//qmp-vchan. Only one simultaneous connection is sup= ported and toolstack needs to ensure that. + +Limitations: + - PCI passthrough require permissive mode + - only one nic is supported + - at most 26 emulated disks are supported (more are still available as PV= disks) + - graphics output (VNC/SDL/Spice) not supported + =20 PV-GRUB =3D=3D=3D=3D=3D=3D=3D --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056065; cv=none; d=zohomail.com; s=zohoarc; b=cvu7LG0bU7KW2gOJfNXQSwFUI1YaTUn8lMHxBlq1wtOKVD/xQ/YzmbYfYOyVK7OLgwhr3Ga2/oeReB6Mbqfck7N0OcnoWFh4p/rnOv94Z9PoMhJ/eDYt0nb9Z+EVq9BQbVpSXIcR7U5YGxC2EESJ4dhSgFRLIegnQamuP+wHtUc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056065; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rrTsmV3E/vJAEMwKR3khkm1ECUtLQzIra/EZT9lQ54M=; b=KBw25yTM8mRQ6Ms0QYhBV8Yc1IU6nxLEjIAZs6tuRs78o73cycf5/T9D77Mv70uOTRiFMFiWcvoBE1cFYc8JzOlOPdhibKTFKnTgaWo3Z5YWwQR2GHAIHMTAaB8qAlsUVK9mLPwqh02KQ1VOe94BgiddHQ6w+rSeAXv9ddSp72M= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056065952802.4638612337808; Tue, 14 Jan 2020 18:41:05 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbf-0004ug-RX; Wed, 15 Jan 2020 02:40:31 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbe-0004u5-G4 for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:30 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5c30353a-3740-11ea-b89f-bc764e2007e4; Wed, 15 Jan 2020 02:40:15 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 2FA1E221FC; Tue, 14 Jan 2020 21:40:15 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:15 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 17C7E3060783; Tue, 14 Jan 2020 21:40:14 -0500 (EST) X-Inumbo-ID: 5c30353a-3740-11ea-b89f-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=hFatBVEceU0YzlJ8V5KA/QLgh7H6lFP0ti2NWesmG X0=; b=gw2ErxTX2wC7Qd44F0v3kByzrr/MP6mymoJOOIof7Vn3oNlWMpMVb2b91 dtP7VrYn6NQOzpAAQ/d5wKinR/zhOKX0S+/2sbc7jSCzkK3CA0oJdKHLhOwgrMsh UzpnZ0WZbyLwUuPMPGoRl3va0U4QGYzK3fgnl3yb3pDo/4RHCFqchFaJ8teGQXKY VF6NlB/cDVGI3dqBQ8a1qw9WswCPW50mKnY7hNSHCS6xvHa6aaCb2X1eyjnGeD5o GR4nEi6Q3EnfbETelHnQm6gDsaK9KuCiHLmC3BTJYqFUbeKvijPwi914REVPBW4k 8WyqHoFjrQqegr9Tka5X/S7UFCgug== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:42 +0100 Message-Id: <763f8aec657f880b29e495d4158db49c2afddbbe.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 03/16] libxl: fix qemu-trad cmdline for no sdl/vnc case X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Wei Liu , Jason Andryuk , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When qemu is running in stubdomain, any attempt to initialize vnc/sdl there will crash it (on failed attempt to load a keymap from a file). If vfb is present, all those cases are skipped. But since b053f0c4c9e533f3d97837cf897eb920b8355ed3 "libxl: do not start dom0 qemu for stubdomain when not needed" it is possible to create a stubdomain without vfb and contrary to the comment -vnc none do trigger VNC initialization code (just skips exposing it externally). Change the implicit SDL avoiding method to -nographics option, used when none of SDL or VNC is enabled. Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jason Andryuk Acked-by: Ian Jackson Acked-by: Wei Liu --- Changes in v2: - typo in qemu option Changes in v3: - add missing { } --- tools/libxl/libxl_dm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index e92e412..558cb41 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -718,14 +718,15 @@ static int libxl__build_device_model_args_old(libxl__= gc *gc, if (libxl_defbool_val(vnc->findunused)) { flexarray_append(dm_args, "-vncunused"); } - } else + } else if (!sdl) { /* * VNC is not enabled by default by qemu-xen-traditional, - * however passing -vnc none causes SDL to not be - * (unexpectedly) enabled by default. This is overridden by - * explicitly passing -sdl below as required. + * however skipping -vnc causes SDL to be + * (unexpectedly) enabled by default. If undesired, disable graphi= cs at + * all. */ - flexarray_append_pair(dm_args, "-vnc", "none"); + flexarray_append(dm_args, "-nographic"); + } =20 if (sdl) { flexarray_append(dm_args, "-sdl"); --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056070; cv=none; d=zohomail.com; s=zohoarc; b=iybnegzqmskbK4clQTjyuAwC7fO9ycPv+v20iMxdshkIaUu/eDjORnI2am7YVnR0D1fw6i7scPgCzULKEpyOmPSrosQuWXxje6sJlvZX/Gtu2Br3j4FOhObmp5XRIG6owpPv1PPOO7L4e4VFJwoBYnCgjVll8BJ9ZWM17S5B0Ak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056070; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WAvr3XxP32gp7JUc4c+VPlrz/zYJtds3KCFmHu2rV4Q=; b=XpdmXTOAn3wPCwwKJpJe/BPP5LQcOUOVehFjmtOgbYlH5X0cfjK3OZHJ4UdDXHjCzcZQEO2J4X5Su/WQQBiXOqr182+EDlfRpR6BwvAa5EPIEcVlK4aHTGxBBs1faJAg4jTpGczbhPzuyQt0w9d1RSUgift6aSrWHTqlLJ7mIzw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056070006803.6323501278382; Tue, 14 Jan 2020 18:41:10 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbk-0004y7-RT; Wed, 15 Jan 2020 02:40:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbj-0004xF-Ev for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:35 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5cb9fbc6-3740-11ea-b89f-bc764e2007e4; Wed, 15 Jan 2020 02:40:16 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 18C60221E9; Tue, 14 Jan 2020 21:40:16 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:16 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 3217530607B0; Tue, 14 Jan 2020 21:40:15 -0500 (EST) X-Inumbo-ID: 5cb9fbc6-3740-11ea-b89f-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=k5156GFHea9+goilYWv4iUhQJRTG8MkgyD01JF2Wy uo=; b=pgBV9h75MV/bPkFLO3Z61Am3W+fCwP+rdgH5tIUqEcLc1htC1nmKZd+Q+ qit3nS+qd6lLvGt1p1eq2d4ygvOmUwm30nBBmLCB/fTIcoMTJJidVTDge26vVj3a dy6XlvIqPcu2EJw8yjCjrJr7l1SrGP9LMLx+L7mkwON5lSubDHyACXxjGRnOL4FW p6NriVaR4ngQcfTC2+GMv7dgz83/7wU0qmsEScQfmSkwoSGUb96q5T/G5TpABy6k Tzd6rVJubNj2k6r5yDGsodbZYn7SLkB1lecbpixMaDVoLEugm1w3PNs3up++qlxD A5sC9cRZ7oVMtvELa+L5Vx0tT9Kqw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:43 +0100 Message-Id: X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 04/16] libxl: Allow running qemu-xen in stubdomain X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Do not prohibit anymore using stubdomain with qemu-xen. To help distingushing MiniOS and Linux stubdomain, add helper inline functions libxl__stubdomain_is_linux() and libxl__stubdomain_is_linux_running(). Those should be used where really the difference is about MiniOS/Linux, not qemu-xen/qemu-xen-traditional. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- Changes in v3: - new patch, instead of "libxl: Add "stubdomain_version" to domain_build_info" - helper functions as suggested by Ian Jackson --- tools/libxl/libxl_create.c | 9 --------- tools/libxl/libxl_internal.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 32d45dc..142b960 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -169,15 +169,6 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, } } =20 - if (b_info->type =3D=3D LIBXL_DOMAIN_TYPE_HVM && - b_info->device_model_version !=3D - LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL && - libxl_defbool_val(b_info->device_model_stubdomain)) { - LOG(ERROR, - "device model stubdomains require \"qemu-xen-traditional\""); - return ERROR_INVAL; - } - if (!b_info->max_vcpus) b_info->max_vcpus =3D 1; if (!b_info->avail_vcpus.size) { diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index ba8c9b4..cc3cf26 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -2299,6 +2299,23 @@ _hidden int libxl__device_model_version_running(libx= l__gc *gc, uint32_t domid); /* Return the system-wide default device model */ _hidden libxl_device_model_version libxl__default_device_model(libxl__gc *= gc); =20 +static inline +bool libxl__stubdomain_is_linux_running(libxl__gc *gc, uint32_t domid) +{ + /* same logic as in libxl__stubdomain_is_linux */ + return libxl__device_model_version_running(gc, domid) + =3D=3D LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; +} + +static inline +bool libxl__stubdomain_is_linux(libxl_domain_build_info *b_info) +{ + /* right now qemu-tranditional implies MiniOS stubdomain and qemu-xen + * implies Linux stubdomain */ + return libxl_defbool_val(b_info->device_model_stubdomain) && + b_info->device_model_version =3D=3D LIBXL_DEVICE_MODEL_VERSION_QEM= U_XEN; +} + #define DEVICE_MODEL_XS_PATH(gc, dm_domid, domid, fmt, _a...) = \ libxl__sprintf(gc, "/local/domain/%u/device-model/%u" fmt, dm_domid, = \ domid, ##_a) --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056065; cv=none; d=zohomail.com; s=zohoarc; b=nf/GWK5hYspjelQfbYbZ3py8KtjNFsvI0+TB43l7hxkyZFhDKh8uf1W0IYUk8z+9HbbvFGmPobHsGzoBbl5JydvsUIwU4r7dBmXtJDtvr50cesTzuRYLqzz4MzTj+r7f+LlnyvuJwhT0TAYz/VDVkpdIQsT0t5VEJYa3cTZOTOk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056065; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PHR0XL6qi4bVdV52abqvUXTsYhCAklEDdHdCKuxaNUM=; b=IdhXYgiLJAqcwdA9yKW3VpWLhtVHLw5NpU+L4t2J559X8qTKdQNwHmy4BgpbCv728RPMiJj/OrrSYWOYd1xVetqsR/89AFaDE8BCYFTKosVBHllk2lctieNiUdru3koHNUWcKA20Kaj+OqrxviNNyQWgxku0O/EF7+sxeojEXCo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056065261741.4352637842883; Tue, 14 Jan 2020 18:41:05 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbV-0004qC-Tb; Wed, 15 Jan 2020 02:40:21 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbU-0004pz-6a for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:20 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5d6c7670-3740-11ea-84ba-12813bfff9fa; Wed, 15 Jan 2020 02:40:17 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 41B1D221B6; Tue, 14 Jan 2020 21:40:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:17 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 1B9B030607B4; Tue, 14 Jan 2020 21:40:16 -0500 (EST) X-Inumbo-ID: 5d6c7670-3740-11ea-84ba-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=U2eTgmeN4K1ApHfEWQLVF3yo1h3QRz6FO7zSDZvWU xw=; b=RhRZ+Ys9OlK6uTjBnV5wnQFulGD4sinNmmxNpAUgNnguRsVBACbS0EIKl 03dXvIRekArANPbpk4nUFZFXHlNTwaIgnzMU27mvv3YPWT/gWaZdDlzjHLbFO/j+ Xg7tg5vsXJSPfHpS6Mc/DO+tcMNKOoVjn1oXu4cfBJ+DVMZCtH44CzFcH0PmLWn7 c67GZpijXTbVvopQ5hEnaFlF1MwWea7ncDmZ3tz7S36x6/gxtmBQO3EoPVDfVU17 dz+8lHaH6bQMjuv0FBfdXt6KnZ3Bh5WgzzFzPPW1Uhgp+zgxkDxXC5N80fla2EfP M3dzn9XkRpWF62jkz/9WYvzNm38Nw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:44 +0100 Message-Id: <27770209c1e2984cda8b9893ed6313fb2bdf30a6.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 05/16] libxl: Handle Linux stubdomain specific QEMU options. X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Simon Gaiser , Anthony PERARD , Eric Shelton Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Eric Shelton This patch creates an appropriate command line for the QEMU instance running in a Linux-based stubdomain. NOTE: a number of items are not currently implemented for Linux-based stubdomains, such as: - save/restore - QMP socket - graphics output (e.g., VNC) Signed-off-by: Eric Shelton Simon: * fix disk path * fix cdrom path and "format" * pass downscript for network interfaces Signed-off-by: Simon Gaiser [drop Qubes-specific parts] Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jason Andryuk --- Changes in v2: - fix serial specified with serial=3D[ ... ] syntax - error out on multiple consoles (incompatible with stubdom) - drop erroneous chunk about cdrom Changes in v3: - change to use libxl__stubdomain_is_linux instead of b_info->stubdomain_version - drop libxl__stubdomain_version_running, prefer libxl__stubdomain_is_linux_running introduced by previous patch - drop ifup/ifdown script - stubdomain will handle that with qemu events itself - slightly simplify -serial argument - add support for multiple serial consoles, do not ignore b_info.u.serial(_list) - add error checking for more than 26 emulated disks ("/dev/xvd%c" format string) --- tools/libxl/libxl_create.c | 36 +++++++- tools/libxl/libxl_dm.c | 190 ++++++++++++++++++++++++------------ tools/libxl/libxl_internal.h | 1 +- tools/libxl/libxl_mem.c | 6 +- tools/libxl/libxl_types.idl | 3 +- 5 files changed, 175 insertions(+), 61 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 142b960..a6d40b7 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -169,6 +169,31 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, } } =20 + if (b_info->type =3D=3D LIBXL_DOMAIN_TYPE_HVM && + libxl_defbool_val(b_info->device_model_stubdomain)) { + if (!b_info->stubdomain_kernel) { + switch (b_info->device_model_version) { + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: + b_info->stubdomain_kernel =3D + libxl__abs_path(NOGC, "ioemu-stubdom.gz", libxl__x= enfirmwaredir_path()); + b_info->stubdomain_ramdisk =3D NULL; + break; + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: + b_info->stubdomain_kernel =3D + libxl__abs_path(NOGC, + "stubdom-linux-kernel", + libxl__xenfirmwaredir_path()); + b_info->stubdomain_ramdisk =3D + libxl__abs_path(NOGC, + "stubdom-linux-rootfs", + libxl__xenfirmwaredir_path()); + break; + default: + abort(); + } + } + } + if (!b_info->max_vcpus) b_info->max_vcpus =3D 1; if (!b_info->avail_vcpus.size) { @@ -204,6 +229,17 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, if (b_info->target_memkb =3D=3D LIBXL_MEMKB_DEFAULT) b_info->target_memkb =3D b_info->max_memkb; =20 + if (b_info->stubdomain_memkb =3D=3D LIBXL_MEMKB_DEFAULT) { + if (libxl_defbool_val(b_info->device_model_stubdomain)) { + if (libxl__stubdomain_is_linux(b_info)) + b_info->stubdomain_memkb =3D LIBXL_LINUX_STUBDOM_MEM * 102= 4; + else + b_info->stubdomain_memkb =3D 28 * 1024; // MiniOS + } else { + b_info->stubdomain_memkb =3D 0; // no stubdomain + } + } + libxl_defbool_setdefault(&b_info->claim_mode, false); =20 libxl_defbool_setdefault(&b_info->localtime, false); diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 558cb41..926d963 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1172,6 +1172,7 @@ static int libxl__build_device_model_args_new(libxl__= gc *gc, int i, connection, devid; uint64_t ram_size; const char *path, *chardev; + bool is_stubdom =3D libxl_defbool_val(b_info->device_model_stubdomain); =20 dm_args =3D flexarray_make(gc, 16, 1); dm_envs =3D flexarray_make(gc, 16, 1); @@ -1182,38 +1183,41 @@ static int libxl__build_device_model_args_new(libxl= __gc *gc, "-xen-domid", GCSPRINTF("%d", guest_domid), NULL); =20 - flexarray_append(dm_args, "-chardev"); - if (state->dm_monitor_fd >=3D 0) { - flexarray_append(dm_args, - GCSPRINTF("socket,id=3Dlibxl-cmd,fd=3D%d,server,nowait", - state->dm_monitor_fd)); + /* There is currently no way to access the QMP socket in the stubdom */ + if (!is_stubdom) { + flexarray_append(dm_args, "-chardev"); + if (state->dm_monitor_fd >=3D 0) { + flexarray_append(dm_args, + GCSPRINTF("socket,id=3Dlibxl-cmd,fd=3D%d,server,nowait", + state->dm_monitor_fd)); =20 - /* - * Start QEMU with its "CPU" paused, it will not start any emulati= on - * until the QMP command "cont" is used. This also prevent QEMU fr= om - * writing "running" to the "state" xenstore node so we only use t= his - * flag when we have the QMP based startup notification. - * */ - flexarray_append(dm_args, "-S"); - } else { - flexarray_append(dm_args, - GCSPRINTF("socket,id=3Dlibxl-cmd," - "path=3D%s,server,nowait", - libxl__qemu_qmp_path(gc, guest_domid))); - } + /* + * Start QEMU with its "CPU" paused, it will not start any emu= lation + * until the QMP command "cont" is used. This also prevent QEM= U from + * writing "running" to the "state" xenstore node so we only u= se this + * flag when we have the QMP based startup notification. + * */ + flexarray_append(dm_args, "-S"); + } else { + flexarray_append(dm_args, + GCSPRINTF("socket,id=3Dlibxl-cmd," + "path=3D%s,server,nowait", + libxl__qemu_qmp_path(gc, guest_domi= d))); + } =20 - flexarray_append(dm_args, "-no-shutdown"); - flexarray_append(dm_args, "-mon"); - flexarray_append(dm_args, "chardev=3Dlibxl-cmd,mode=3Dcontrol"); + flexarray_append(dm_args, "-no-shutdown"); + flexarray_append(dm_args, "-mon"); + flexarray_append(dm_args, "chardev=3Dlibxl-cmd,mode=3Dcontrol"); =20 - flexarray_append(dm_args, "-chardev"); - flexarray_append(dm_args, - GCSPRINTF("socket,id=3Dlibxenstat-cmd," - "path=3D%s/qmp-libxenstat-%d,server,no= wait", - libxl__run_dir_path(), guest_domid)); + flexarray_append(dm_args, "-chardev"); + flexarray_append(dm_args, + GCSPRINTF("socket,id=3Dlibxenstat-cmd," + "path=3D%s/qmp-libxenstat-%d,serve= r,nowait", + libxl__run_dir_path(), guest_domid= )); =20 - flexarray_append(dm_args, "-mon"); - flexarray_append(dm_args, "chardev=3Dlibxenstat-cmd,mode=3Dcontrol"); + flexarray_append(dm_args, "-mon"); + flexarray_append(dm_args, "chardev=3Dlibxenstat-cmd,mode=3Dcontrol= "); + } =20 for (i =3D 0; i < guest_config->num_channels; i++) { connection =3D guest_config->channels[i].connection; @@ -1257,7 +1261,7 @@ static int libxl__build_device_model_args_new(libxl__= gc *gc, flexarray_vappend(dm_args, "-name", c_info->name, NULL); } =20 - if (vnc) { + if (vnc && !is_stubdom) { char *vncarg =3D NULL; =20 flexarray_append(dm_args, "-vnc"); @@ -1296,7 +1300,7 @@ static int libxl__build_device_model_args_new(libxl__= gc *gc, } =20 flexarray_append(dm_args, vncarg); - } else + } else if (!is_stubdom) /* * Ensure that by default no vnc server is created. */ @@ -1308,7 +1312,7 @@ static int libxl__build_device_model_args_new(libxl__= gc *gc, */ flexarray_append_pair(dm_args, "-display", "none"); =20 - if (sdl) { + if (sdl && !is_stubdom) { flexarray_append(dm_args, "-sdl"); if (sdl->display) flexarray_append_pair(dm_envs, "DISPLAY", sdl->display); @@ -1350,18 +1354,34 @@ static int libxl__build_device_model_args_new(libxl= __gc *gc, { LOGD(ERROR, guest_domid, "Both serial and serial_list set"= ); return ERROR_INVAL; - } - if (b_info->u.hvm.serial) { - flexarray_vappend(dm_args, - "-serial", b_info->u.hvm.serial, NULL); - } else if (b_info->u.hvm.serial_list) { - char **p; - for (p =3D b_info->u.hvm.serial_list; - *p; - p++) { - flexarray_vappend(dm_args, - "-serial", - *p, NULL); + } else { + if (b_info->u.hvm.serial) { + if (is_stubdom) { + /* see spawn_stub_launch_dm() for connecting STUBD= OM_CONSOLE_SERIAL */ + flexarray_vappend(dm_args, + "-serial", + GCSPRINTF("/dev/hvc%d", STUBDOM_= CONSOLE_SERIAL), + NULL); + } else { + flexarray_vappend(dm_args, + "-serial", b_info->u.hvm.serial,= NULL); + } + } else if (b_info->u.hvm.serial_list) { + char **p; + /* see spawn_stub_launch_dm() for connecting STUBDOM_C= ONSOLE_SERIAL */ + for (p =3D b_info->u.hvm.serial_list, i =3D 0; + *p; + p++, i++) { + if (is_stubdom) + flexarray_vappend(dm_args, + "-serial", + GCSPRINTF("/dev/hvc%d", STUB= DOM_CONSOLE_SERIAL + i), + NULL); + else + flexarray_vappend(dm_args, + "-serial", + *p, NULL); + } } } } @@ -1370,7 +1390,7 @@ static int libxl__build_device_model_args_new(libxl__= gc *gc, flexarray_append(dm_args, "-nographic"); } =20 - if (libxl_defbool_val(b_info->u.hvm.spice.enable)) { + if (libxl_defbool_val(b_info->u.hvm.spice.enable) && !is_stubdom) { const libxl_spice_info *spice =3D &b_info->u.hvm.spice; char *spiceoptions =3D dm_spice_options(gc, spice); if (!spiceoptions) @@ -1797,7 +1817,9 @@ static int libxl__build_device_model_args_new(libxl__= gc *gc, * If qemu isn't doing the interpreting, the parameter is * always raw */ - if (disks[i].backend =3D=3D LIBXL_DISK_BACKEND_QDISK) + if (libxl_defbool_val(b_info->device_model_stubdomain)) + format =3D "host_device"; + else if (disks[i].backend =3D=3D LIBXL_DISK_BACKEND_QDISK) format =3D libxl__qemu_disk_format_string(disks[i].format); else format =3D libxl__qemu_disk_format_string(LIBXL_DISK_FORMA= T_RAW); @@ -1808,6 +1830,16 @@ static int libxl__build_device_model_args_new(libxl_= _gc *gc, disks[i].vdev); continue; } + } else if (libxl_defbool_val(b_info->device_model_stubdomain))= { + if (disk > 'z' - 'a') { + LOGD(WARN, guest_domid, + "Emulation of only first %d disks is supported= with qemu-xen in stubdomain.\n" + "Disk %d will be available via PV drivers but = not as an emulated disk.", + 'z' - 'a', + disk); + continue; + } + target_path =3D GCSPRINTF("/dev/xvd%c", 'a' + disk); } else { if (format =3D=3D NULL) { LOGD(WARN, guest_domid, @@ -1948,7 +1980,7 @@ static int libxl__build_device_model_args(libxl__gc *= gc, char ***args, char ***envs, const libxl__domain_build_state *s= tate, int *dm_state_fd) -/* dm_state_fd may be NULL iff caller knows we are using old stubdom +/* dm_state_fd may be NULL iff caller knows we are using stubdom * and therefore will be passing a filename rather than a fd. */ { switch (guest_config->b_info.device_model_version) { @@ -1958,8 +1990,10 @@ static int libxl__build_device_model_args(libxl__gc = *gc, args, envs, state); case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: - assert(dm_state_fd !=3D NULL); - assert(*dm_state_fd < 0); + if (!libxl_defbool_val(guest_config->b_info.device_model_stubdomai= n)) { + assert(dm_state_fd !=3D NULL); + assert(*dm_state_fd < 0); + } return libxl__build_device_model_args_new(gc, dm, guest_domid, guest_confi= g, args, envs, @@ -2064,6 +2098,16 @@ retry_transaction: return 0; } =20 +static int libxl__store_libxl_entry(libxl__gc *gc, uint32_t domid, + const char *name, const char *value) +{ + char *path =3D NULL; + + path =3D libxl__xs_libxl_path(gc, domid); + path =3D libxl__sprintf(gc, "%s/%s", path, name); + return libxl__xs_printf(gc, XBT_NULL, path, "%s", value); +} + static void dmss_init(libxl__dm_spawn_state *dmss) { libxl__ev_qmp_init(&dmss->qmp); @@ -2122,10 +2166,14 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__s= tub_dm_spawn_state *sdss) dmss_init(&sdss->pvqemu); libxl__xswait_init(&sdss->xswait); =20 - if (guest_config->b_info.device_model_version !=3D - LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL) { - ret =3D ERROR_INVAL; - goto out; + assert(libxl_defbool_val(guest_config->b_info.device_model_stubdomain)= ); + + if (libxl__stubdomain_is_linux(&guest_config->b_info)) { + if (d_state->saved_state) { + LOG(ERROR, "Save/Restore not supported yet with Linux Stubdom.= "); + ret =3D -1; + goto out; + } } =20 sdss->pvqemu.guest_domid =3D 0; @@ -2147,8 +2195,8 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stu= b_dm_spawn_state *sdss) =20 dm_config->b_info.shadow_memkb =3D 0; dm_config->b_info.max_vcpus =3D 1; - dm_config->b_info.max_memkb =3D 28 * 1024 + - guest_config->b_info.video_memkb; + dm_config->b_info.max_memkb =3D guest_config->b_info.stubdomain_memkb; + dm_config->b_info.max_memkb +=3D guest_config->b_info.video_memkb; dm_config->b_info.target_memkb =3D dm_config->b_info.max_memkb; =20 dm_config->b_info.max_grant_frames =3D guest_config->b_info.max_grant_= frames; @@ -2187,10 +2235,8 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__st= ub_dm_spawn_state *sdss) dm_config->num_vkbs =3D 1; } =20 - stubdom_state->pv_kernel.path - =3D libxl__abs_path(gc, "ioemu-stubdom.gz", libxl__xenfirmwaredir_= path()); - stubdom_state->pv_cmdline =3D GCSPRINTF(" -d %d", guest_domid); - stubdom_state->pv_ramdisk.path =3D ""; + stubdom_state->pv_kernel.path =3D guest_config->b_info.stubdomain_kern= el; + stubdom_state->pv_ramdisk.path =3D guest_config->b_info.stubdomain_ram= disk; =20 /* fixme: this function can leak the stubdom if it fails */ ret =3D libxl__domain_make(gc, dm_config, stubdom_state, @@ -2210,6 +2256,8 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stu= b_dm_spawn_state *sdss) goto out; } =20 + libxl__store_libxl_entry(gc, guest_domid, "dm-version", + libxl_device_model_version_to_string(dm_config->b_info.device_mode= l_version)); libxl__write_stub_dmargs(gc, dm_domid, guest_domid, args); libxl__xs_printf(gc, XBT_NULL, GCSPRINTF("%s/image/device-model-domid", @@ -2219,6 +2267,15 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__st= ub_dm_spawn_state *sdss) GCSPRINTF("%s/target", libxl__xs_get_dompath(gc, dm_domid)), "%d", guest_domid); + if (guest_config->b_info.device_model_version =3D=3D LIBXL_DEVICE_MODE= L_VERSION_QEMU_XEN) { + /* qemu-xen is used as a dm in the stubdomain, so we set the bios + * accroding to this */ + libxl__xs_printf(gc, XBT_NULL, + libxl__sprintf(gc, "%s/hvmloader/bios", + libxl__xs_get_dompath(gc, guest_dom= id)), + "%s", + libxl_bios_type_to_string(guest_config->b_info.u.h= vm.bios)); + } ret =3D xc_domain_set_target(ctx->xch, dm_domid, guest_domid); if (ret<0) { LOGED(ERROR, guest_domid, "setting target domain %d -> %d", @@ -2300,6 +2357,11 @@ static void spawn_stub_launch_dm(libxl__egc *egc, =20 if (guest_config->b_info.u.hvm.serial) num_console++; + else if (guest_config->b_info.u.hvm.serial_list) { + char **serial =3D guest_config->b_info.u.hvm.serial_list; + while (*(serial++)) + num_console++; + } =20 console =3D libxl__calloc(gc, num_console, sizeof(libxl__device_consol= e)); =20 @@ -2333,8 +2395,18 @@ static void spawn_stub_launch_dm(libxl__egc *egc, console[i].output =3D GCSPRINTF("pipe:%s", d_state->saved_state); break; + case STUBDOM_CONSOLE_SERIAL: + if (guest_config->b_info.u.hvm.serial) { + console[i].output =3D guest_config->b_info.u.hvm.seria= l; + break; + } + /* fall-through */ default: - console[i].output =3D "pty"; + /* Serial_list is set, as otherwise num_consoles would be + * smaller and consoles 0-2 are handled above. */ + assert(guest_config->b_info.u.hvm.serial_list); + console[i].output =3D guest_config->b_info.u.hvm.serial_li= st[ + i-STUBDOM_CONSOLE_SERIAL]; break; } } diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index cc3cf26..2b4a1cc 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -119,6 +119,7 @@ #define STUBDOM_CONSOLE_RESTORE 2 #define STUBDOM_CONSOLE_SERIAL 3 #define STUBDOM_SPECIAL_CONSOLES 3 +#define LIBXL_LINUX_STUBDOM_MEM 128 #define TAP_DEVICE_SUFFIX "-emu" #define DOMID_XS_PATH "domid" #define INVALID_DOMID ~0 diff --git a/tools/libxl/libxl_mem.c b/tools/libxl/libxl_mem.c index 7c01fac..65957a4 100644 --- a/tools/libxl/libxl_mem.c +++ b/tools/libxl/libxl_mem.c @@ -459,8 +459,10 @@ int libxl__domain_need_memory_calculate(libxl__gc *gc, case LIBXL_DOMAIN_TYPE_PVH: case LIBXL_DOMAIN_TYPE_HVM: *need_memkb +=3D LIBXL_HVM_EXTRA_MEMORY; - if (libxl_defbool_val(b_info->device_model_stubdomain)) - *need_memkb +=3D 32 * 1024; + if (libxl_defbool_val(b_info->device_model_stubdomain)) { + *need_memkb +=3D b_info->stubdomain_memkb; + *need_memkb +=3D b_info->video_memkb; + } break; case LIBXL_DOMAIN_TYPE_PV: *need_memkb +=3D LIBXL_PV_EXTRA_MEMORY; diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index 7921950..011676f 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -516,6 +516,9 @@ libxl_domain_build_info =3D Struct("domain_build_info",[ =20 ("device_model_version", libxl_device_model_version), ("device_model_stubdomain", libxl_defbool), + ("stubdomain_memkb", MemKB), + ("stubdomain_kernel", string), + ("stubdomain_ramdisk", string), # if you set device_model you must set device_model_version too ("device_model", string), ("device_model_ssidref", uint32), --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056064; cv=none; d=zohomail.com; s=zohoarc; b=TLAUEw/0kDp6e8mF2yQmWpicNuawB1EownKNRL6fDIJInfiB0spz95aJRp56/XHLLukSxAZ4OlX8eTSwmUJmH9EMvwDW8Vs11FlKPSYt6Il8RYAg5MmDSDkgv6rpkLAJXSge94buIW8rZPp5tHWm5vTn5alNxmCKjn7ZUAALjHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056064; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VwRkl7dzRu+s+AZmjEG6p9w/2y2Se6X558j4q0LSa6M=; b=OhazG++rq+8fhIcs1xc94+3LKb25Dx/W+LTHcTXpIZOzjJwndPQTBdGoPG/X4TiUqwS+zoeHbGvRiJ/rBpRMg5GdJ9kZgFqgiiwZ491lar8C67ID9Jflszw7CO4jNypWVsilMkKoMwTg9OVClh5n/V/ORKThHFtB1ASOX2R3lw8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056064483146.50459434066977; Tue, 14 Jan 2020 18:41:04 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYba-0004rz-Mw; Wed, 15 Jan 2020 02:40:26 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbZ-0004rM-6o for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:25 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5d6c7672-3740-11ea-84ba-12813bfff9fa; Wed, 15 Jan 2020 02:40:18 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 2612821FE5; Tue, 14 Jan 2020 21:40:18 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:18 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 3506A30607CD; Tue, 14 Jan 2020 21:40:17 -0500 (EST) X-Inumbo-ID: 5d6c7672-3740-11ea-84ba-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=skDz0rnSNSBUBZiTqXtGnAuRJBovVCqbot5fp/R4L 5s=; b=sjfS03ycn4OsBreudydMSI8CBYt4GWOwDOjIG9LhwLieZOzMFjVAylY5Q gT8BkCnh9PjahdCQrsM57PJPzd0nEMr5trDf3NX++zbKrg96xlO7WfHXiSP56Cve yoiyuDG+FQc1N8x4QgDt8dYO60ZefIFJW6Hd0aEZszyR3v22hz2oEH2IUaTQI9x5 k/EXvOuXyVvMNlfclgwxJ1H/T/g6UXXff4jtjvyEZ6tTtleTmty3c7DmkwDnZhKF eZWKJ4f6hDJwetlbcDy4sYaLZvOq495WSzzjSS19f2DB+QDJg3+WakghXb9ffRfr 3OVvPSLarMaY78HFtC/h9QXSQ6qGw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:45 +0100 Message-Id: X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 06/16] libxl: write qemu arguments into separate xenstore keys X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This allows using arguments with spaces, like -append, without nominating any special "separator" character. Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jason Andryuk --- Changes in v3: - previous version of this patch "libxl: use \x1b to separate qemu arguments for linux stubdomain" used specific non-printable separator, but it was rejected as xenstore doesn't cope well with non-printable chars --- tools/libxl/libxl_dm.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 926d963..bf49262 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -2049,6 +2049,40 @@ static int libxl__vfb_and_vkb_from_hvm_guest_config(= libxl__gc *gc, return 0; } =20 +static int libxl__write_stub_linux_dmargs(libxl__gc *gc, + int dm_domid, int guest_domid, + char **args) +{ + libxl_ctx *ctx =3D libxl__gc_owner(gc); + int i; + char *vm_path; + char *path; + struct xs_permissions roperm[2]; + xs_transaction_t t; + + roperm[0].id =3D 0; + roperm[0].perms =3D XS_PERM_NONE; + roperm[1].id =3D dm_domid; + roperm[1].perms =3D XS_PERM_READ; + + vm_path =3D libxl__xs_read(gc, XBT_NULL, GCSPRINTF("/local/domain/%d/v= m", guest_domid)); + path =3D GCSPRINTF("%s/image/dmargs", vm_path); + +retry_transaction: + t =3D xs_transaction_start(ctx->xsh); + xs_write(ctx->xsh, t, path, "", 0); + xs_set_permissions(ctx->xsh, t, path, roperm, ARRAY_SIZE(roperm)); + i =3D 1; + for (i=3D1; args[i] !=3D NULL; i++) + xs_write(ctx->xsh, t, GCSPRINTF("%s/%03d", path, i), args[i], strl= en(args[i])); + + xs_set_permissions(ctx->xsh, t, GCSPRINTF("%s/rtc/timeoffset", vm_path= ), roperm, ARRAY_SIZE(roperm)); + if (!xs_transaction_end(ctx->xsh, t, 0)) + if (errno =3D=3D EAGAIN) + goto retry_transaction; + return 0; +} + static int libxl__write_stub_dmargs(libxl__gc *gc, int dm_domid, int guest_domid, char **args) @@ -2258,7 +2292,10 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__st= ub_dm_spawn_state *sdss) =20 libxl__store_libxl_entry(gc, guest_domid, "dm-version", libxl_device_model_version_to_string(dm_config->b_info.device_mode= l_version)); - libxl__write_stub_dmargs(gc, dm_domid, guest_domid, args); + if (libxl__stubdomain_is_linux(&guest_config->b_info)) + libxl__write_stub_linux_dmargs(gc, dm_domid, guest_domid, args); + else + libxl__write_stub_dmargs(gc, dm_domid, guest_domid, args); libxl__xs_printf(gc, XBT_NULL, GCSPRINTF("%s/image/device-model-domid", libxl__xs_get_dompath(gc, guest_domid)), --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056065; cv=none; d=zohomail.com; s=zohoarc; b=eH6E/FjHDWaekVwbpuanP4pRivykPvB8kd/Gr0hKLG702GaNfs3O8BJ8bq4fH7flSDI2WCSFM8WK4FxYnA+QEna/d8T3Js5t+C5bITov/ATPaFqUKAQfvoV6kNhf035WIWJPxr99jIxF/MKF7wVo4vIqfDde7XCQUj7aIGqUCjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056065; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LbkLqv/tJG+HULvrOvFomykN32Glm9+51bxszV4t7lc=; b=lL3NimxsZIBRPezyQQD16NtgN0dlEj11RRNZTyiJ8vp1fCFDWwPzOgLVkpL7PJdddgt8RCoG5xSDPw6nGRcMtdJXIAVB46dDXGYrSecvMPA7plhZxKC6YgACbE4h0pzVp2WQizk3sVyd8bnRk5P4Y5f+b63h9fi1VuRjAsLu/h8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056065859172.73829448222273; Tue, 14 Jan 2020 18:41:05 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbf-0004uM-Ex; Wed, 15 Jan 2020 02:40:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbe-0004ty-7I for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:30 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5e788a72-3740-11ea-84bb-12813bfff9fa; Wed, 15 Jan 2020 02:40:19 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 0656321FE6; Tue, 14 Jan 2020 21:40:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:19 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 1D05330607D0; Tue, 14 Jan 2020 21:40:18 -0500 (EST) X-Inumbo-ID: 5e788a72-3740-11ea-84bb-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=o9Zspwb8YcuEiaebf0Bp3ThGx1iC9Pe72x0VcPzTW xU=; b=c8BPP3upxaOV7KbRWs3NbYQ8H2bO63COOpHz173oWUJum96CrL66BjpY1 WOIoT1VoPnk/+T5D0/eeJDWXkUqkmtx+WPL9jqPALnC1N3Y9EZEKsHWTaR8G8zdQ Zk8cdHhmMEagzfJOicFBHHj7kneJ5VlD8EBvbvPRqc09+evJV2PXMF2rrxfDxTeN usJl3XYhHzsBfxR5ZtqN3WB4z5j4c5xY07x+DiJhtXlXqZUbvIwErHsXTqDN5l0O Q/gn+gOuW2DYQ5KUB8++nkESZ5N1cSZGPO+rgKswvtkyv0/4egohM6/vrqq8oUKK To2bIogYCvyxueASnnwFLgpNDv+Tw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucffohhmrghinhepphhougdrihhn necukfhppeeluddrieehrdefgedrfeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg hrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmnecuvehluhhs thgvrhfuihiivgeptd X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:46 +0100 Message-Id: <25fe2a1f9840ac0e6ca962b218013da0d1a46982.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 07/16] xl: add stubdomain related options to xl config parser X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu , Jason Andryuk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jason Andryuk --- docs/man/xl.cfg.5.pod.in | 23 +++++++++++++++++++---- tools/xl/xl_parse.c | 7 +++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index 245d3f9..6ae0bd0 100644 --- a/docs/man/xl.cfg.5.pod.in +++ b/docs/man/xl.cfg.5.pod.in @@ -2720,10 +2720,25 @@ model which they were installed with. =20 =3Ditem B =20 -Override the path to the binary to be used as the device-model. The -binary provided here MUST be consistent with the -B which you have specified. You should not -normally need to specify this option. +Override the path to the binary to be used as the device-model running in +toolstack domain. The binary provided here MUST be consistent with the +B which you have specified. You should not normally = need +to specify this option. + +=3Ditem B + +Override the path to the kernel image used as device-model stubdomain. +The binary provided here MUST be consistent with the +B which you have specified. +In case of B it is expected to be MiniOS-based stubd= omain +image, in case of B it is expected to be Linux-based stubdomain +kernel. + +=3Ditem B + +Override the path to the ramdisk image used as device-model stubdomain. +The binary provided here is to be used by a kernel pointed by B. +It is known to be used only by Linux-based stubdomain kernel. =20 =3Ditem B =20 diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index b881184..fc5dd65 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -2525,6 +2525,13 @@ skip_usbdev: xlu_cfg_replace_string(config, "device_model_user", &b_info->device_model_user, 0); =20 + xlu_cfg_replace_string (config, "stubdomain_kernel", + &b_info->stubdomain_kernel, 0); + xlu_cfg_replace_string (config, "stubdomain_ramdisk", + &b_info->stubdomain_ramdisk, 0); + if (!xlu_cfg_get_long (config, "stubdomain_memory", &l, 0)) + b_info->stubdomain_memkb =3D l * 1024; + #define parse_extra_args(type) \ e =3D xlu_cfg_get_list_as_string_list(config, "device_model_args"#type= , \ &b_info->extra##type, 0); \ --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056069; cv=none; d=zohomail.com; s=zohoarc; b=oKQHzxUydVZ3o0Ky9iMYyEZOx8zyZY8DvY5EMm3UR8zqpF8l1oRPq5T7x2x4O4ElorCs5OfyKMfUGobNfBwEJhiXwuxrPOrb4mvnOqf11DuYUa4uxSnpMKGP+ieR3BJb2nJXZgVpvC0wcb94FUmaLO3HdYqW9EfrDS6Nb73RUi8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056069; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Duu3h5Hj83b/CzusZLcRFWXQYxllj549w+ml7cdGdn4=; b=RU+tdEWV0751nWZDxqzhRwkzUA/KjDh9GR9JgwRLXpgBxtzY+WCkcdkfSqOcvFNodkcpG40KHxVSE3y2CnzRl7QEngPm+3EPjV2v3VIJPr8OThXSeW05J3cYNeeeux4EfTLBLottKfyeR3YS/1Scm1uNZ/102BNUe4sL0fcn7oo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 157905606915128.323699155452346; Tue, 14 Jan 2020 18:41:09 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbk-0004xi-FA; Wed, 15 Jan 2020 02:40:36 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbj-0004x2-7d for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:35 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5f084194-3740-11ea-84bb-12813bfff9fa; Wed, 15 Jan 2020 02:40:20 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id E2DED22206; Tue, 14 Jan 2020 21:40:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:19 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 0523230607B0; Tue, 14 Jan 2020 21:40:18 -0500 (EST) X-Inumbo-ID: 5f084194-3740-11ea-84bb-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=zG/nmIauw+uWJfff8qV/HuZnuRzcOW86SqAUgup91 x4=; b=JFSfGq8e+DPWDbLnzNMAqT0ZTWvEvfhE5Szz80jitjcFi3WhI82IKWyFS YtimcI+QJjl5KzV6IEtxGBt9PwcNK6N4l5L3ineq1/c/Z7GZz4dQqbv6iqHswI9c qcqQ7PqQdA0GRbsy8EBoTGNSnBhaGigLBuknxhJxgAgKkoiuehb7SeBJhsXZSR/p fZ9zLMoZvEhIQGxpiNxKP1gP8m8PC9AfgoLSoCRD4GkBbyt3r/NYtXPmL9KhzhLn W5uvCU9nkwe5c9yq6A0Rp1PJ8A+jHR77LouVGFWPitoKOAirsyTq2vl5nZX4dwaA lorfpnS/GK828wUWYGMYAi8bQSvuQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpeeh X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:47 +0100 Message-Id: <047e5ff567ac0c2e0bd92fd8741c03d07b548ab5.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 08/16] tools/libvchan: notify server when client is connected X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Let the server know when the client is connected. Otherwise server will notice only when client send some data. This change does not break existing clients, as libvchan user should handle spurious notifications anyway (for example acknowledge of remote side reading the data). Signed-off-by: Marek Marczykowski-G=C3=B3recki --- I had this patch in Qubes for a long time and totally forgot it wasn't upstream thing... --- tools/libvchan/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c index 180833d..50a64c1 100644 --- a/tools/libvchan/init.c +++ b/tools/libvchan/init.c @@ -447,6 +447,9 @@ struct libxenvchan *libxenvchan_client_init(struct xent= oollog_logger *logger, ctrl->ring->cli_live =3D 1; ctrl->ring->srv_notify =3D VCHAN_NOTIFY_WRITE; =20 + /* wake up the server */ + xenevtchn_notify(ctrl->event, ctrl->event_port); + out: if (xs) xs_daemon_close(xs); --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056076; cv=none; d=zohomail.com; s=zohoarc; b=QyYkVmylmgJ89qQvj0kQz5Q0eapYtOQnyNtjJE2tTdB4gWjgQFxbE858QgYFOylEsYRfrBRzjmD4J+aRWq3WUAbOS7HMwR//EHZ6b9OuwaZKxlfNSqjcCxh2OZLnsbA1Jh585xHrL/oKa6tU1YsHt8YaKful/0LPY9G2IBm27rs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056076; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VcSeYRDxPUclowga8GECwIoRusR7zHbBFj58ScgErEw=; b=nevR6N5W3Y/R5WGoud/D1zpzTn8UlVC/x51CIEYjTyCyVwyVJDe0ZQBUQFE/PvqkdEoO1aXZ2rHO1bx+7ay05tc5s5yeMMvrUUM3CeF3lJnyEoWWOD3qpFRpfke+wLTzFJZCNDaDRKlydc4je23V1sCtxv+s6Ujs8ePmjCyM53w= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15790560765344.176428421791684; Tue, 14 Jan 2020 18:41:16 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbu-00057L-DJ; Wed, 15 Jan 2020 02:40:46 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbt-00055h-8Q for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:45 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5fb597c3-3740-11ea-84bb-12813bfff9fa; Wed, 15 Jan 2020 02:40:21 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 1B2C121FE5; Tue, 14 Jan 2020 21:40:21 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:21 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id CAE11306080E; Tue, 14 Jan 2020 21:40:19 -0500 (EST) X-Inumbo-ID: 5fb597c3-3740-11ea-84bb-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=aWY4Ovzkm/CoWLS9XJcYhEWWwKS8NNPJ4rrxMcAV7 zE=; b=rUC2YxIFp1tWh6pfAa9hBJHQN4vdDo8GeH8/K2V+16Wq4a30vyEryLTQQ iaAjvMhalBlgV1c4IAFMTvk2sN0VScfzaIa2FXhwMGatkWHenH70HtpxUlnRfpSR mXV9V4VkVRNOYsOvVSsC78842blTl4N5yZROXVD6NrpRlfgkpwG3bnSveHcVtUgL /wnx7tnaxpcUrCGssLOSscbMlQOivYvOaPAgBv0AldXGKgde5JPUa4LmIPvqbzJ4 nSe6XrqPce4W4w8mmKoAhy3mODgxz50SNct2kfieXF1IgjHs2Z+cLlIMhOKuHOSt Oy0kHOiaKsWua0LXr5VTPaxoXggCw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpeeh X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:48 +0100 Message-Id: <69e9fee9c192d8ea77b1d618f4e25d8b59534346.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 09/16] libxl: add save/restore support for qemu-xen in stubdomain X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Rely on a wrapper script in stubdomain to attach FD 3/4 of qemu to relevant consoles. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- Changes in v3: - adjust for qmp_ev* - assume specific fdset id in qemu set in stubdomain --- tools/libxl/libxl_dm.c | 23 +++++++++++------------ tools/libxl/libxl_qmp.c | 25 ++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index bf49262..528ca3e 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1728,10 +1728,17 @@ static int libxl__build_device_model_args_new(libxl= __gc *gc, } =20 if (state->saved_state) { - /* This file descriptor is meant to be used by QEMU */ - *dm_state_fd =3D open(state->saved_state, O_RDONLY); - flexarray_append(dm_args, "-incoming"); - flexarray_append(dm_args, GCSPRINTF("fd:%d",*dm_state_fd)); + if (is_stubdom) { + /* Linux stubdomain connects specific FD to STUBDOM_CONSOLE_RE= STORE + */ + flexarray_append(dm_args, "-incoming"); + flexarray_append(dm_args, "fd:3"); + } else { + /* This file descriptor is meant to be used by QEMU */ + *dm_state_fd =3D open(state->saved_state, O_RDONLY); + flexarray_append(dm_args, "-incoming"); + flexarray_append(dm_args, GCSPRINTF("fd:%d",*dm_state_fd)); + } } for (i =3D 0; b_info->extra && b_info->extra[i] !=3D NULL; i++) flexarray_append(dm_args, b_info->extra[i]); @@ -2202,14 +2209,6 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__st= ub_dm_spawn_state *sdss) =20 assert(libxl_defbool_val(guest_config->b_info.device_model_stubdomain)= ); =20 - if (libxl__stubdomain_is_linux(&guest_config->b_info)) { - if (d_state->saved_state) { - LOG(ERROR, "Save/Restore not supported yet with Linux Stubdom.= "); - ret =3D -1; - goto out; - } - } - sdss->pvqemu.guest_domid =3D 0; =20 libxl_domain_create_info_init(&dm_config->c_info); diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c index efaba91..0f38546 100644 --- a/tools/libxl/libxl_qmp.c +++ b/tools/libxl/libxl_qmp.c @@ -962,6 +962,7 @@ static void dm_stopped(libxl__egc *egc, libxl__ev_qmp *= ev, const libxl__json_object *response, int rc); static void dm_state_fd_ready(libxl__egc *egc, libxl__ev_qmp *ev, const libxl__json_object *response, int rc); +static void dm_state_save_to_fdset(libxl__egc *egc, libxl__ev_qmp *ev, int= fdset); static void dm_state_saved(libxl__egc *egc, libxl__ev_qmp *ev, const libxl__json_object *response, int rc); =20 @@ -994,10 +995,17 @@ static void dm_stopped(libxl__egc *egc, libxl__ev_qmp= *ev, EGC_GC; libxl__domain_suspend_state *dsps =3D CONTAINER_OF(ev, *dsps, qmp); const char *const filename =3D dsps->dm_savefile; + uint32_t dm_domid =3D libxl_get_stubdom_id(CTX, dsps->domid); =20 if (rc) goto error; =20 + if (dm_domid) { + /* see Linux stubdom interface in docs/stubdom.txt */ + dm_state_save_to_fdset(egc, ev, 1); + return; + } + ev->payload_fd =3D open(filename, O_WRONLY | O_CREAT, 0600); if (ev->payload_fd < 0) { LOGED(ERROR, ev->domid, @@ -1028,7 +1036,6 @@ static void dm_state_fd_ready(libxl__egc *egc, libxl_= _ev_qmp *ev, EGC_GC; int fdset; const libxl__json_object *o; - libxl__json_object *args =3D NULL; libxl__domain_suspend_state *dsps =3D CONTAINER_OF(ev, *dsps, qmp); =20 close(ev->payload_fd); @@ -1043,6 +1050,21 @@ static void dm_state_fd_ready(libxl__egc *egc, libxl= __ev_qmp *ev, goto error; } fdset =3D libxl__json_object_get_integer(o); + dm_state_save_to_fdset(egc, ev, fdset); + return; + +error: + assert(rc); + libxl__remove_file(gc, dsps->dm_savefile); + dsps->callback_device_model_done(egc, dsps, rc); +} + +static void dm_state_save_to_fdset(libxl__egc *egc, libxl__ev_qmp *ev, int= fdset) +{ + EGC_GC; + int rc; + libxl__json_object *args =3D NULL; + libxl__domain_suspend_state *dsps =3D CONTAINER_OF(ev, *dsps, qmp); =20 ev->callback =3D dm_state_saved; =20 @@ -1060,6 +1082,7 @@ static void dm_state_fd_ready(libxl__egc *egc, libxl_= _ev_qmp *ev, =20 error: assert(rc); + /* TODO: only in non-stubdom case */ libxl__remove_file(gc, dsps->dm_savefile); dsps->callback_device_model_done(egc, dsps, rc); } --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056077; cv=none; d=zohomail.com; s=zohoarc; b=Wv2hhMSsmaY7AEiPjlMRryjDdBar5UTqddU/VLZNAmS0neAmX8wiZX58ONPrFD/4/x1FgXB6zBH1Bgl0lYVTGNwylWxqqtXGoO3DUT+oATnsJUKJArj66+OJQ3xQiNgWicKbtr4guwQDAbisXYJzfoJuNUdQIZ0ivm7AP+80bsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056077; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h+A24n762uoKDXTkgXdtlBBnaqr8lH8+8TfEFHyV1Ic=; b=MHQOCbQTt1CY5QX7hCHsTOJYyNfoSi/pHm9U1LSeLXN0i4D7eL9UgwfCr4PJ2g8+8tcOrjVSiypWWma4HZoj+5dkP8xuATE0FQgvasFrRKeqXd0tWJPzelXJqlvzfO4Yf4DQgLvhBQpAmOCj8lxYhgKisqZAmtcgpIsnfzl3xV4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056077004223.00224607704683; Tue, 14 Jan 2020 18:41:17 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbq-00051k-6N; Wed, 15 Jan 2020 02:40:42 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbo-00050V-7c for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:40 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 60128c98-3740-11ea-84bb-12813bfff9fa; Wed, 15 Jan 2020 02:40:21 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id A512D221E5; Tue, 14 Jan 2020 21:40:21 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:21 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id D64DA3060840; Tue, 14 Jan 2020 21:40:20 -0500 (EST) X-Inumbo-ID: 60128c98-3740-11ea-84bb-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=cMLuMoiO2GgiF+2yG6HCDZ12fKzKr3YMfoA82ikN+ Bk=; b=h0RxDCEzVpRE0IqNfukwU2YBKLLKVt/pCvis0Ns6uG9Tcv2F1Sqg7S5XN DyZASX0/WiSz6m5My0AdDaSdcP/zwlOxpFQX7CglQs7+/Ty02Z88MTxeLHufD3IL YA8rTDjuFZIc4Pwf8PSza0GP53zFD7wZxfWV3hFylUaAnCVTsmZIcLOm3E8TNHJ0 GuX23s5D2W3KfXxRWE6/+5fOF49wbjGjXKheV/cy/gZB5aJ9EseTnBVV4Ss8e5DK 3xP+qQ8/o4Yj9pRriAZ49wEIuWjFJF4YKoCUyv1A+d0TBXfqEXFwmRO2zqAWkgzT CeR0p2Ug67kbwb0/lJsY6ScurB/mw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpeeh X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:49 +0100 Message-Id: <11435f88fd5802b4c7c0197794d9832bd87093d7.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 10/16] tools: add missing libxenvchan cflags X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" libxenvchan.h include xenevtchn.h and xengnttab.h, so applications built with it needs applicable -I in CFLAGS too. Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jason Andryuk --- tools/Rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index 31cf419..9c550c1 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -159,7 +159,7 @@ SHDEPS_libxenstat =3D $(SHLIB_libxenctrl) $(SHLIB_libx= enstore) LDLIBS_libxenstat =3D $(SHDEPS_libxenstat) $(XEN_LIBXENSTAT)/libxenstat$(= libextension) SHLIB_libxenstat =3D $(SHDEPS_libxenstat) -Wl,-rpath-link=3D$(XEN_LIBXEN= STAT) =20 -CFLAGS_libxenvchan =3D -I$(XEN_LIBVCHAN) +CFLAGS_libxenvchan =3D -I$(XEN_LIBVCHAN) $(CFLAGS_libxengnttab) $(CFLAGS_l= ibxenevtchn) SHDEPS_libxenvchan =3D $(SHLIB_libxentoollog) $(SHLIB_libxenstore) $(SHLIB= _libxenevtchn) $(SHLIB_libxengnttab) LDLIBS_libxenvchan =3D $(SHDEPS_libxenvchan) $(XEN_LIBVCHAN)/libxenvchan$(= libextension) SHLIB_libxenvchan =3D $(SHDEPS_libxenvchan) -Wl,-rpath-link=3D$(XEN_LIBVC= HAN) --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056081; cv=none; d=zohomail.com; s=zohoarc; b=BhSndBiBk7dSFdZob22RwMIPJmbIJEdtVSo9oPU6Uk4rNlgAYL14tRPxJN0iwlGQF1bO6P4s1ZPiI234K4K8ZKSpciZe5u6pipulavoTxvZFrp+cHoCTRwVCCE8eQ0CYQL/8b16Z2obJd9C0thAkwrwS5zzy+ZmnXi2N3DkvAOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056081; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0+SoU1K1lIqaKY9lbn5iZVrZ8PFK9B4LOuSEDA5+C5w=; b=MwC637WGuuRq8RP1svs3x9KavyWcIst1ethSx2yvD7L1PfjZ3BJ83Lb9aE1p5CPkVWDlwbW/lw3lEQ4ICwUw+Lsm/1PJdESGOP1LguuUiQUoGD1IrRSCdxJ3+fQW7Q66/6b7MycEYdP+tRQl7dUwRG2R3L1kivXQOzeJP/MPW+g= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056081112773.8727357152384; Tue, 14 Jan 2020 18:41:21 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbq-00052H-K4; Wed, 15 Jan 2020 02:40:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbo-00050m-Ez for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:40 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 60fd6100-3740-11ea-b89f-bc764e2007e4; Wed, 15 Jan 2020 02:40:23 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 3D84321FE5; Tue, 14 Jan 2020 21:40:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:23 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id A930830607CD; Tue, 14 Jan 2020 21:40:21 -0500 (EST) X-Inumbo-ID: 60fd6100-3740-11ea-b89f-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=znpj4MOBHgOaDXOOEG4g7HWKKya24BWqqB4c3rFH2 OU=; b=sWGNCnnh0HQGic19JyfK8qPbn7LSqMCsRLipGr4Kv2vq8nstKWVDAxsNR iMTLFFRRExS69jiUVTznr9tHs9KAYJ77u51ueEJ6BVU9D/6V+G9U9nIwQwM5KtYc k3zdj3WiaevD04sjGHFywbxfcXwQom6Szspo2zUnVets0a9QiJ1x9yRXYukTCYdz pM8zsWH7AsH/nPIvGl57vIPcb+ybUzCc5iME68x5YRe7EGCld+9ui+0Ti85/1Bv3 ggIlLYskFiMKnAHDESM20TOSe39jVPYEIXcxs40uax1efRGs2AgUzSwZWrzzg9YL 1BS0hb7WXIGt8uFioJoHXdy3onqsw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculddqiedmnecujfgurhephffvufffkffojghfgggtgfesthekredtredt jeenucfhrhhomhepofgrrhgvkhcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuc eomhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecu ffhomhgrihhnpehgnhhurdhorhhgnecukfhppeeluddrieehrdefgedrfeefnecurfgrrh grmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhg shhlrggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:50 +0100 Message-Id: X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 11/16] tools: add simple vchan-socket-proxy X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Add a simple proxy for tunneling socket connection over vchan. This is based on existing vchan-node* applications, but extended with socket support. vchan-socket-proxy serves both as a client and as a server, depending on parameters. It can be used to transparently communicate with an application in another domian that normally expose UNIX socket interface. Specifically, it's written to communicate with qemu running within stubdom. Server mode listens for vchan connections and when one is opened, connects to a pointed UNIX socket. Client mode listens on UNIX socket and when someone connects, opens a vchan connection. Only a single connection at a time is supported. Additionally, socket can be provided as a number - in which case it's interpreted as already open FD (in case of UNIX listening socket - listen() needs to be already called). Or "-" meaning stdin/stdout - in which case it is reduced to vchan-node2 functionality. Example usage: 1. (in dom0) vchan-socket-proxy --mode=3Dclient /local/domain//data/vchan/1234 /run/qemu.(DOMID) 2. (in DOMID) vchan-socket-proxy --mode=3Dserver 0 /local/domain//data/vchan/1234 /run/qemu.(DOMID) This will listen on /run/qemu.(DOMID) in dom0 and whenever connection is made, it will connect to DOMID, where server process will connect to /run/qemu.(DOMID) there. When client disconnects, vchan connection is terminated and server vchan-socket-proxy process also disconnects from qemu. Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jason Andryuk --- .gitignore | 1 +- tools/libvchan/Makefile | 7 +- tools/libvchan/init.c.rej | 60 ++++- tools/libvchan/vchan-socket-proxy.c | 469 +++++++++++++++++++++++++++++- 4 files changed, 536 insertions(+), 1 deletion(-) create mode 100644 tools/libvchan/init.c.rej create mode 100644 tools/libvchan/vchan-socket-proxy.c diff --git a/.gitignore b/.gitignore index 017856c..1c9dd93 100644 --- a/.gitignore +++ b/.gitignore @@ -372,6 +372,7 @@ tools/misc/xenwatchdogd tools/misc/xen-hvmcrash tools/misc/xen-lowmemd tools/libvchan/vchan-node[12] +tools/libvchan/vchan-socket-proxy tools/ocaml/*/.ocamldep.make tools/ocaml/*/*.cm[ixao] tools/ocaml/*/*.cmxa diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile index 7892750..1c845ca 100644 --- a/tools/libvchan/Makefile +++ b/tools/libvchan/Makefile @@ -13,6 +13,7 @@ LIBVCHAN_PIC_OBJS =3D $(patsubst %.o,%.opic,$(LIBVCHAN_OB= JS)) LIBVCHAN_LIBS =3D $(LDLIBS_libxenstore) $(LDLIBS_libxengnttab) $(LDLIBS_li= bxenevtchn) $(LIBVCHAN_OBJS) $(LIBVCHAN_PIC_OBJS): CFLAGS +=3D $(CFLAGS_libxenstore) $= (CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) $(NODE_OBJS) $(NODE2_OBJS): CFLAGS +=3D $(CFLAGS_libxengnttab) $(CFLAGS_li= bxenevtchn) +vchan-socket-proxy.o: CFLAGS +=3D $(CFLAGS_libxenstore) $(CFLAGS_libxenctr= l) $(CFLAGS_libxengnttab) $(CFLAGS_libxenevtchn) =20 MAJOR =3D 4.14 MINOR =3D 0 @@ -39,7 +40,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR =3D $(CURDIR) $(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL =3D $(CFLAGS_xeninclude) =20 .PHONY: all -all: libxenvchan.so vchan-node1 vchan-node2 libxenvchan.a $(PKG_CONFIG_INS= T) $(PKG_CONFIG_LOCAL) +all: libxenvchan.so vchan-node1 vchan-node2 vchan-socket-proxy libxenvchan= .a $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) =20 libxenvchan.so: libxenvchan.so.$(MAJOR) ln -sf $< $@ @@ -59,6 +60,9 @@ vchan-node1: $(NODE_OBJS) libxenvchan.so vchan-node2: $(NODE2_OBJS) libxenvchan.so $(CC) $(LDFLAGS) -o $@ $(NODE2_OBJS) $(LDLIBS_libxenvchan) $(APPEND_LDFLA= GS) =20 +vchan-socket-proxy: vchan-socket-proxy.o libxenvchan.so + $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenvchan) $(LDLIBS_libxenstore) $(L= DLIBS_libxenctrl) $(APPEND_LDFLAGS) + .PHONY: install install: all $(INSTALL_DIR) $(DESTDIR)$(libdir) @@ -66,6 +70,7 @@ install: all $(INSTALL_PROG) libxenvchan.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir) ln -sf libxenvchan.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenvchan.s= o.$(MAJOR) ln -sf libxenvchan.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenvchan.so + $(INSTALL_PROG) vchan-socket-proxy $(DESTDIR)$(bindir) $(INSTALL_DATA) libxenvchan.h $(DESTDIR)$(includedir) $(INSTALL_DATA) libxenvchan.a $(DESTDIR)$(libdir) $(INSTALL_DATA) xenvchan.pc $(DESTDIR)$(PKG_INSTALLDIR) diff --git a/tools/libvchan/init.c.rej b/tools/libvchan/init.c.rej new file mode 100644 index 0000000..8b3ed73 --- /dev/null +++ b/tools/libvchan/init.c.rej @@ -0,0 +1,60 @@ +--- tools/libvchan/init.c ++++ tools/libvchan/init.c +@@ -266,31 +266,33 @@ static int init_xs_srv(struct libxenvchan *ctrl, int= domain, const char* xs_base + perms[1].id =3D domain; + perms[1].perms =3D XS_PERM_READ; +=20 +-retry_transaction: +- xs_trans =3D xs_transaction_start(xs); +- if (!xs_trans) +- goto fail; +- +- snprintf(ref, sizeof ref, "%d", ring_ref); +- snprintf(buf, sizeof buf, "%s/ring-ref", xs_base); +- if (!xs_write(xs, xs_trans, buf, ref, strlen(ref))) +- goto fail; +- if (!xs_set_permissions(xs, xs_trans, buf, perms, 2)) +- goto fail; +- +- snprintf(ref, sizeof ref, "%d", ctrl->event_port); +- snprintf(buf, sizeof buf, "%s/event-channel", xs_base); +- if (!xs_write(xs, xs_trans, buf, ref, strlen(ref))) +- goto fail; +- if (!xs_set_permissions(xs, xs_trans, buf, perms, 2)) +- goto fail; +- +- if (!xs_transaction_end(xs, xs_trans, 0)) { +- if (errno =3D=3D EAGAIN) +- goto retry_transaction; +- } else { +- ret =3D 0; ++ for (;;) { ++ xs_trans =3D xs_transaction_start(xs); ++ if (!xs_trans) ++ goto fail; ++ ++ snprintf(ref, sizeof ref, "%d", ring_ref); ++ snprintf(buf, sizeof buf, "%s/ring-ref", xs_base); ++ if (!xs_write(xs, xs_trans, buf, ref, strlen(ref))) ++ goto fail; ++ if (!xs_set_permissions(xs, xs_trans, buf, perms, 2)) ++ goto fail; ++ ++ snprintf(ref, sizeof ref, "%d", ctrl->event_port); ++ snprintf(buf, sizeof buf, "%s/event-channel", xs_base); ++ if (!xs_write(xs, xs_trans, buf, ref, strlen(ref))) ++ goto fail; ++ if (!xs_set_permissions(xs, xs_trans, buf, perms, 2)) ++ goto fail; ++ ++ if (xs_transaction_end(xs, xs_trans, 0)) ++ break; ++ else if (errno !=3D EAGAIN) ++ goto fail; ++ /* EAGAIN, retry */ + } ++ ret =3D 0; ++ + fail: + free(domid_str); + xs_close(xs); diff --git a/tools/libvchan/vchan-socket-proxy.c b/tools/libvchan/vchan-soc= ket-proxy.c new file mode 100644 index 0000000..6b4ae09 --- /dev/null +++ b/tools/libvchan/vchan-socket-proxy.c @@ -0,0 +1,469 @@ +/** + * @file + * @section AUTHORS + * + * Copyright (C) 2010 Rafal Wojtczuk + * + * Authors: + * Rafal Wojtczuk + * Daniel De Graaf + * Marek Marczykowski-G=C3=B3recki + * + * @section LICENSE + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; If not, see . + * + * @section DESCRIPTION + * + * This is a vchan to unix socket proxy. Vchan server is set, and on client + * connection, local socket connection is established. Communication is bi= directional. + * One client is served at a time, clients needs to coordinate this themse= lves. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static void usage(char** argv) +{ + fprintf(stderr, "usage:\n" + "\t%s [options] domainid nodepath [socket-path|file-no|-]\n" + "\n" + "options:\n" + "\t-m, --mode=3Dclient|server - vchan connection mode\n" + "\t-m, --state-path=3Dpath - xenstore path where write \"running\"= to at startup\n" + "\t-v, --verbose - verbose logging\n" + "\n" + "client: client of a vchan connection, fourth parameter can be:\n" + "\tsocket-path: listen on a UNIX socket at this path and connect t= o vchan\n" + "\t whenever new connection is accepted;\n" + "\t handle multiple _subsequent_ connections, until terminated\n" + "\tfile-no: except open FD of a socket in listen mode; otherwise s= imilar to socket-path\n" + "\t-: open vchan connection immediately and pass the data from std= in/stdout;\n" + "\t terminate when vchan connection is closed\n" + "server: server of a vchan connection, fourth parameter can be:\n" + "\tsocket-path: connect to this UNIX socket when new vchan connect= ion is accepted\n" + "\t handle multiple _subsequent_ connections, until terminated\n" + "\tfile-no: pass data to/from this FD; terminate when vchan connec= tion is closed\n" + "\t-: pass data to/from stdin/stdout; terminatate when vchan conne= ction is closed\n", + argv[0]); + exit(1); +} + +#define BUFSIZE 8192 +char inbuf[BUFSIZE]; +char outbuf[BUFSIZE]; +int insiz =3D 0; +int outsiz =3D 0; +int verbose =3D 0; + +static void vchan_wr(struct libxenvchan *ctrl) { + int ret; + + if (!insiz) + return; + ret =3D libxenvchan_write(ctrl, inbuf, insiz); + if (ret < 0) { + fprintf(stderr, "vchan write failed\n"); + exit(1); + } + if (verbose) + fprintf(stderr, "written %d bytes to vchan\n", ret); + if (ret > 0) { + insiz -=3D ret; + memmove(inbuf, inbuf + ret, insiz); + } +} + +static void socket_wr(int output_fd) { + int ret; + + if (!outsiz) + return; + ret =3D write(output_fd, outbuf, outsiz); + if (ret < 0 && errno !=3D EAGAIN) + exit(1); + if (ret > 0) { + outsiz -=3D ret; + memmove(outbuf, outbuf + ret, outsiz); + } +} + +static int set_nonblocking(int fd, int nonblocking) { + int flags =3D fcntl(fd, F_GETFL); + if (flags =3D=3D -1) + return -1; + + if (nonblocking) + flags |=3D O_NONBLOCK; + else + flags &=3D ~O_NONBLOCK; + + if (fcntl(fd, F_SETFL, flags) =3D=3D -1) + return -1; + + return 0; +} + +static int connect_socket(const char *path_or_fd) { + int fd; + char *endptr; + struct sockaddr_un addr; + + fd =3D strtoll(path_or_fd, &endptr, 0); + if (*endptr =3D=3D '\0') { + set_nonblocking(fd, 1); + return fd; + } + + fd =3D socket(AF_UNIX, SOCK_STREAM, 0); + if (fd =3D=3D -1) + return -1; + + addr.sun_family =3D AF_UNIX; + strncpy(addr.sun_path, path_or_fd, sizeof(addr.sun_path)); + if (connect(fd, (const struct sockaddr *)&addr, sizeof(addr)) =3D=3D -= 1) { + close(fd); + return -1; + } + + set_nonblocking(fd, 1); + + return fd; +} + +static int listen_socket(const char *path_or_fd) { + int fd; + char *endptr; + struct sockaddr_un addr; + + fd =3D strtoll(path_or_fd, &endptr, 0); + if (*endptr =3D=3D '\0') { + return fd; + } + + /* if not a number, assume a socket path */ + fd =3D socket(AF_UNIX, SOCK_STREAM, 0); + if (fd =3D=3D -1) + return -1; + + addr.sun_family =3D AF_UNIX; + strncpy(addr.sun_path, path_or_fd, sizeof(addr.sun_path)); + if (bind(fd, (const struct sockaddr *)&addr, sizeof(addr)) =3D=3D -1) { + close(fd); + return -1; + } + if (listen(fd, 5) !=3D 0) { + close(fd); + return -1; + } + + return fd; +} + +static struct libxenvchan *connect_vchan(int domid, const char *path) { + struct libxenvchan *ctrl =3D NULL; + struct xs_handle *xs =3D NULL; + xc_interface *xc =3D NULL; + xc_dominfo_t dominfo; + char **watch_ret; + unsigned int watch_num; + int ret; + + xs =3D xs_open(XS_OPEN_READONLY); + if (!xs) { + perror("xs_open"); + goto out; + } + xc =3D xc_interface_open(NULL, NULL, XC_OPENFLAG_NON_REENTRANT); + if (!xc) { + perror("xc_interface_open"); + goto out; + } + /* wait for vchan server to create *path* */ + xs_watch(xs, path, "path"); + xs_watch(xs, "@releaseDomain", "release"); + while ((watch_ret =3D xs_read_watch(xs, &watch_num))) { + /* don't care about exact which fired the watch */ + free(watch_ret); + ctrl =3D libxenvchan_client_init(NULL, domid, path); + if (ctrl) + break; + + ret =3D xc_domain_getinfo(xc, domid, 1, &dominfo); + /* break the loop if domain is definitely not there anymore, but + * continue if it is or the call failed (like EPERM) */ + if (ret =3D=3D -1 && errno =3D=3D ESRCH) + break; + if (ret =3D=3D 1 && (dominfo.domid !=3D (uint32_t)domid || dominfo= .dying)) + break; + } + +out: + if (xc) + xc_interface_close(xc); + if (xs) + xs_close(xs); + return ctrl; +} + + +static void discard_buffers(struct libxenvchan *ctrl) { + /* discard local buffers */ + insiz =3D 0; + outsiz =3D 0; + + /* discard remaining incoming data */ + while (libxenvchan_data_ready(ctrl)) { + if (libxenvchan_read(ctrl, inbuf, BUFSIZE) =3D=3D -1) { + perror("vchan read"); + exit(1); + } + } +} + +int data_loop(struct libxenvchan *ctrl, int input_fd, int output_fd) +{ + int ret; + int libxenvchan_fd; + int max_fd; + + libxenvchan_fd =3D libxenvchan_fd_for_select(ctrl); + for (;;) { + fd_set rfds; + fd_set wfds; + FD_ZERO(&rfds); + FD_ZERO(&wfds); + + max_fd =3D -1; + if (input_fd !=3D -1 && insiz !=3D BUFSIZE) { + FD_SET(input_fd, &rfds); + if (input_fd > max_fd) + max_fd =3D input_fd; + } + if (output_fd !=3D -1 && outsiz) { + FD_SET(output_fd, &wfds); + if (output_fd > max_fd) + max_fd =3D output_fd; + } + FD_SET(libxenvchan_fd, &rfds); + if (libxenvchan_fd > max_fd) + max_fd =3D libxenvchan_fd; + ret =3D select(max_fd + 1, &rfds, &wfds, NULL, NULL); + if (ret < 0) { + perror("select"); + exit(1); + } + if (FD_ISSET(libxenvchan_fd, &rfds)) { + libxenvchan_wait(ctrl); + if (!libxenvchan_is_open(ctrl)) { + if (verbose) + fprintf(stderr, "vchan client disconnected\n"); + while (outsiz) + socket_wr(output_fd); + close(output_fd); + close(input_fd); + discard_buffers(ctrl); + break; + } + vchan_wr(ctrl); + } + + /* socket_fd guaranteed to be !=3D -1 */ + + if (FD_ISSET(input_fd, &rfds)) { + ret =3D read(input_fd, inbuf + insiz, BUFSIZE - insiz); + if (ret < 0 && errno !=3D EAGAIN) + exit(1); + if (verbose) + fprintf(stderr, "from-unix: %.*s\n", ret, inbuf + insiz); + if (ret =3D=3D 0) { + /* EOF on socket, write everything in the buffer and close= the + * socket */ + while (insiz) { + vchan_wr(ctrl); + libxenvchan_wait(ctrl); + } + close(input_fd); + input_fd =3D -1; + /* TODO: maybe signal the vchan client somehow? */ + break; + } + if (ret) + insiz +=3D ret; + vchan_wr(ctrl); + } + if (FD_ISSET(output_fd, &wfds)) + socket_wr(output_fd); + while (libxenvchan_data_ready(ctrl) && outsiz < BUFSIZE) { + ret =3D libxenvchan_read(ctrl, outbuf + outsiz, BUFSIZE - outs= iz); + if (ret < 0) + exit(1); + if (verbose) + fprintf(stderr, "from-vchan: %.*s\n", ret, outbuf + outsiz= ); + outsiz +=3D ret; + socket_wr(output_fd); + } + } + return 0; +} + +/** + Simple libxenvchan application, both client and server. + Both sides may write and read, both from the libxenvchan and from + stdin/stdout (just like netcat). +*/ + +static struct option options[] =3D { + { "mode", required_argument, NULL, 'm' }, + { "verbose", no_argument, NULL, 'v' }, + { "state-path", required_argument, NULL, 's' }, + { } +}; + +int main(int argc, char **argv) +{ + int is_server =3D 0; + int socket_fd; + int input_fd, output_fd; + struct libxenvchan *ctrl =3D NULL; + const char *socket_path; + int domid; + const char *vchan_path; + const char *state_path =3D NULL; + int opt; + + while ((opt =3D getopt_long(argc, argv, "m:vs:", options, NULL)) !=3D = -1) { + switch (opt) { + case 'm': + if (strcmp(optarg, "server") =3D=3D 0) + is_server =3D 1; + else if (strcmp(optarg, "client") =3D=3D 0) + is_server =3D 0; + else { + fprintf(stderr, "invalid argument for --mode: %s\n", o= ptarg); + usage(argv); + return 1; + } + break; + case 'v': + verbose =3D 1; + break; + case 's': + state_path =3D optarg; + break; + case '?': + usage(argv); + } + } + + if (argc-optind !=3D 3) + usage(argv); + + domid =3D atoi(argv[optind]); + vchan_path =3D argv[optind+1]; + socket_path =3D argv[optind+2]; + + if (is_server) { + ctrl =3D libxenvchan_server_init(NULL, domid, vchan_path, 0, 0); + if (!ctrl) { + perror("libxenvchan_server_init"); + exit(1); + } + } else { + if (strcmp(socket_path, "-") =3D=3D 0) { + input_fd =3D 0; + output_fd =3D 1; + } else { + socket_fd =3D listen_socket(socket_path); + if (socket_fd =3D=3D -1) { + perror("listen socket"); + return 1; + } + } + } + + if (state_path) { + struct xs_handle *xs; + + xs =3D xs_open(0); + if (!xs) { + perror("xs_open"); + return 1; + } + if (!xs_write(xs, XBT_NULL, state_path, "running", strlen("running= "))) { + perror("xs_write"); + return 1; + } + xs_close(xs); + } + + for (;;) { + if (is_server) { + /* wait for vchan connection */ + while (libxenvchan_is_open(ctrl) !=3D 1) + libxenvchan_wait(ctrl); + /* vchan client connected, setup local FD if needed */ + if (strcmp(socket_path, "-") =3D=3D 0) { + input_fd =3D 0; + output_fd =3D 1; + } else { + input_fd =3D output_fd =3D connect_socket(socket_path); + } + if (input_fd =3D=3D -1) { + perror("connect socket"); + return 1; + } + if (data_loop(ctrl, input_fd, output_fd) !=3D 0) + break; + /* keep it running only when get UNIX socket path */ + if (socket_path[0] !=3D '/') + break; + } else { + /* wait for local socket connection */ + if (strcmp(socket_path, "-") !=3D 0) + input_fd =3D output_fd =3D accept(socket_fd, NULL, NULL); + if (input_fd =3D=3D -1) { + perror("accept"); + return 1; + } + set_nonblocking(input_fd, 1); + set_nonblocking(output_fd, 1); + ctrl =3D connect_vchan(domid, vchan_path); + if (!ctrl) { + perror("vchan client init"); + return 1; + } + if (data_loop(ctrl, input_fd, output_fd) !=3D 0) + break; + /* don't reconnect if output was stdout */ + if (strcmp(socket_path, "-") =3D=3D 0) + break; + + libxenvchan_close(ctrl); + ctrl =3D NULL; + } + } + return 0; +} --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056087; cv=none; d=zohomail.com; s=zohoarc; b=EsYkvzdxtLvkJ6ulrj4Wix/bXNAbNTzK6unJBoLIlRJemSIj6pVrLXNg6QeVuMweyi1kISJsMKjlhR7rh+gZcI50ZPWVfblyRZCNvK+Hvkq4IjkSjz4cbEZD0cOTQQheBpzsGJ+qtG9smy/O2I4vPAiF7TFHthpFtVOo+JzZk10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056087; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gzAeeM5gV/d7h/V0UgRLyNl4WK27phWF5NmDcNSdyUY=; b=YqgMyBwMCoJFoShFWrqa4zRuveQN9VhGN9s9E9AHKfFG9/zVqDUPSf+u5ZI2NC2tvCLUiEvCheN+CfOSQ2XtX/xeRKQNlffZjR/ofVlCAxKI0XUEhlg3hZ4J5TZ7DibRxBB9zKrA54urxDb7iVoX5bV3evjzlyA6CM7hJqWk+y0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056087512776.13414193021; Tue, 14 Jan 2020 18:41:27 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbu-000584-Ri; Wed, 15 Jan 2020 02:40:46 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbt-000563-FG for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:45 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 617cb482-3740-11ea-b89f-bc764e2007e4; Wed, 15 Jan 2020 02:40:24 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 161CF221BD; Tue, 14 Jan 2020 21:40:24 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:24 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 2C2CB30607B4; Tue, 14 Jan 2020 21:40:23 -0500 (EST) X-Inumbo-ID: 617cb482-3740-11ea-b89f-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=ZsOEiGo4bLBb/cJsQQgBXQAcppRT0uPThW/qIrcld oQ=; b=RPYeuwRjuB0Ig8qKMPyUD9iVkfS1lE7iM8daBpDlNRqCh5R9dyL5WfAEs w2zqfLRX5h0q846Ob9irqOpJTJdpi5WppPggK6Ov2Autlerh1BbJn4f++dfZD77E /vyhcopWQtwnxGOcqXMlumjbdyInyFfPoL5wkBGYRA6GODFnL87z9Rq0Ei5jmmYq UWzmoDseyGtC8jvAajUyalA0ark758uAjlSTG//Y3CcPoPEOZxazjDi8b/jTvmU2 A9LbnmdE6fYx/R8OF03yz2GK/liCbNAC+apMSP9g6wh86lF6AHhJUxTuqaimw19y UqdSeDCqjhzirE+93/7zoLn+BppSA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucffohhmrghinhepshhprgifnhdr rghonecukfhppeeluddrieehrdefgedrfeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmnecuvehl uhhsthgvrhfuihiivgeptd X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:51 +0100 Message-Id: <8d8515cabfdc666bd1afb40f6b7e44ccbe362dbf.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 12/16] libxl: use vchan for QMP access with Linux stubdomain X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Access to QMP of QEMU in Linux stubdomain is possible over vchan connection. Handle the actual vchan connection in a separate process (vchan-socket-proxy). This simplified integration with QMP (already quite complex), but also allows preliminary filtering of (potentially malicious) QMP input. Since only one client can be connected to vchan server at the same time and it is not enforced by the libxenvchan itself, additional client-side locking is needed. It is implicitly implemented by vchan-socket-proxy, as it handle only one connection at a time. Note that qemu supports only one simultaneous client on a control socket anyway (but in UNIX socket case, it enforce it server-side), so it doesn't add any extra limitation. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- Changes in v4: - new patch, in place of both "libxl: use vchan for QMP access ..." --- tools/configure.ac | 9 ++- tools/libxl/libxl_dm.c | 159 ++++++++++++++++++++++++++++++++++-- tools/libxl/libxl_internal.h | 1 +- 3 files changed, 161 insertions(+), 8 deletions(-) diff --git a/tools/configure.ac b/tools/configure.ac index 8d86c42..20bbdbf 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -192,6 +192,15 @@ AC_SUBST(qemu_xen) AC_SUBST(qemu_xen_path) AC_SUBST(qemu_xen_systemd) =20 +AC_ARG_WITH([stubdom-qmp-proxy], + AC_HELP_STRING([--stubdom-qmp-proxy@<:@=3DPATH@:>@], + [Use supplied binary PATH as a QMP proxy into stubdomain]),[ + stubdom_qmp_proxy=3D"$withval" +],[ + stubdom_qmp_proxy=3D"$bindir/vchan-socket-proxy" +]) +AC_DEFINE_UNQUOTED([STUBDOM_QMP_PROXY_PATH], ["$stubdom_qmp_proxy"], [QMP = proxy path]) + AC_ARG_WITH([system-seabios], AS_HELP_STRING([--with-system-seabios@<:@=3DPATH@:>@], [Use system supplied seabios PATH instead of building and installing diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 528ca3e..23ac7e4 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1183,7 +1183,7 @@ static int libxl__build_device_model_args_new(libxl__= gc *gc, "-xen-domid", GCSPRINTF("%d", guest_domid), NULL); =20 - /* There is currently no way to access the QMP socket in the stubdom */ + /* QMP access to qemu running in stubdomain is done over vchan, stubdo= main setup it itself */ if (!is_stubdom) { flexarray_append(dm_args, "-chardev"); if (state->dm_monitor_fd >=3D 0) { @@ -2178,6 +2178,23 @@ static void stubdom_pvqemu_unpaused(libxl__egc *egc, static void stubdom_xswait_cb(libxl__egc *egc, libxl__xswait_state *xswait, int rc, const char *p); =20 +static void spawn_qmp_proxy(libxl__egc *egc, + libxl__stub_dm_spawn_state *sdss); + +static void qmp_proxy_confirm(libxl__egc *egc, libxl__spawn_state *spawn, + const char *xsdata); + +static void qmp_proxy_startup_failed(libxl__egc *egc, + libxl__spawn_state *spawn, + int rc); + +static void qmp_proxy_detached(libxl__egc *egc, + libxl__spawn_state *spawn); + +static void qmp_proxy_spawn_outcome(libxl__egc *egc, + libxl__stub_dm_spawn_state *sdss, + int rc); + char *libxl__stub_dm_name(libxl__gc *gc, const char *guest_name) { return GCSPRINTF("%s-dm", guest_name); @@ -2460,24 +2477,150 @@ static void spawn_stub_launch_dm(libxl__egc *egc, goto out; } =20 + sdss->qmp_proxy_spawn.ao =3D ao; + if (libxl__stubdomain_is_linux(&guest_config->b_info)) { + spawn_qmp_proxy(egc, sdss); + } else { + qmp_proxy_spawn_outcome(egc, sdss, 0); + } + + return; + +out: + assert(ret); + qmp_proxy_spawn_outcome(egc, sdss, ret); +} + +static void spawn_qmp_proxy(libxl__egc *egc, + libxl__stub_dm_spawn_state *sdss) +{ + STATE_AO_GC(sdss->qmp_proxy_spawn.ao); + const uint32_t guest_domid =3D sdss->dm.guest_domid; + const uint32_t dm_domid =3D sdss->pvqemu.guest_domid; + const char *dom_path =3D libxl__xs_get_dompath(gc, dm_domid); + char **args; + int nr =3D 0; + int rc, logfile_w, null; + + if (access(STUBDOM_QMP_PROXY_PATH, X_OK) < 0) { + LOGED(ERROR, guest_domid, "qmp proxy %s is not executable", STUBDO= M_QMP_PROXY_PATH); + rc =3D ERROR_FAIL; + goto out; + } + + sdss->qmp_proxy_spawn.what =3D GCSPRINTF("domain %d device model qmp p= roxy", guest_domid); + sdss->qmp_proxy_spawn.pidpath =3D GCSPRINTF("%s/image/qmp-proxy-pid", = dom_path); + sdss->qmp_proxy_spawn.xspath =3D GCSPRINTF("%s/image/qmp-proxy-state",= dom_path); + + sdss->qmp_proxy_spawn.timeout_ms =3D LIBXL_DEVICE_MODEL_START_TIMEOUT = * 1000; + sdss->qmp_proxy_spawn.midproc_cb =3D libxl__spawn_record_pid; + sdss->qmp_proxy_spawn.confirm_cb =3D qmp_proxy_confirm; + sdss->qmp_proxy_spawn.failure_cb =3D qmp_proxy_startup_failed; + sdss->qmp_proxy_spawn.detached_cb =3D qmp_proxy_detached; + + const int arraysize =3D 6; + GCNEW_ARRAY(args, arraysize); + args[nr++] =3D STUBDOM_QMP_PROXY_PATH; + args[nr++] =3D GCSPRINTF("--state-path=3D%s", sdss->qmp_proxy_spawn.xs= path); + args[nr++] =3D GCSPRINTF("%u", dm_domid); + args[nr++] =3D GCSPRINTF("%s/device-model/%u/qmp-vchan", dom_path, gue= st_domid); + args[nr++] =3D (char*)libxl__qemu_qmp_path(gc, guest_domid); + args[nr++] =3D NULL; + assert(nr =3D=3D arraysize); + + logfile_w =3D libxl__create_qemu_logfile(gc, GCSPRINTF("qmp-proxy-%s", + sdss->dm_config.c= _info.name)); + if (logfile_w < 0) { + rc =3D logfile_w; + goto out; + } + null =3D open("/dev/null", O_RDWR); + if (null < 0) { + LOGED(ERROR, guest_domid, "unable to open /dev/null"); + rc =3D ERROR_FAIL; + goto out_close; + } + + rc =3D libxl__spawn_spawn(egc, &sdss->qmp_proxy_spawn); + if (rc < 0) + goto out_close; + if (!rc) { /* inner child */ + setsid(); + libxl__exec(gc, null, null, logfile_w, STUBDOM_QMP_PROXY_PATH, arg= s, NULL); + /* unreachable */ + } + + rc =3D 0; + +out_close: + if (logfile_w >=3D 0) + close(logfile_w); + if (null >=3D 0) + close(null); +out: + if (rc) + qmp_proxy_spawn_outcome(egc, sdss, rc); +} + +static void qmp_proxy_confirm(libxl__egc *egc, libxl__spawn_state *spawn, + const char *xsdata) +{ + STATE_AO_GC(spawn->ao); + + if (!xsdata) + return; + + if (strcmp(xsdata, "running")) + return; + + libxl__spawn_initiate_detach(gc, spawn); +} + +static void qmp_proxy_startup_failed(libxl__egc *egc, + libxl__spawn_state *spawn, + int rc) +{ + libxl__stub_dm_spawn_state *sdss =3D CONTAINER_OF(spawn, *sdss, qmp_pr= oxy_spawn); + qmp_proxy_spawn_outcome(egc, sdss, rc); +} + +static void qmp_proxy_detached(libxl__egc *egc, + libxl__spawn_state *spawn) +{ + libxl__stub_dm_spawn_state *sdss =3D CONTAINER_OF(spawn, *sdss, qmp_pr= oxy_spawn); + qmp_proxy_spawn_outcome(egc, sdss, 0); +} + +static void qmp_proxy_spawn_outcome(libxl__egc *egc, + libxl__stub_dm_spawn_state *sdss, + int rc) +{ + STATE_AO_GC(sdss->qmp_proxy_spawn.ao); + int need_pvqemu =3D libxl__need_xenpv_qemu(gc, &sdss->dm_config); + + if (rc) goto out; + + if (need_pvqemu < 0) { + rc =3D need_pvqemu; + goto out; + } + sdss->pvqemu.spawn.ao =3D ao; - sdss->pvqemu.guest_domid =3D dm_domid; sdss->pvqemu.guest_config =3D &sdss->dm_config; sdss->pvqemu.build_state =3D &sdss->dm_state; sdss->pvqemu.callback =3D spawn_stubdom_pvqemu_cb; - - if (!need_qemu) { + if (need_pvqemu) { + libxl__spawn_local_dm(egc, &sdss->pvqemu); + } else { /* If dom0 qemu not needed, do not launch it */ spawn_stubdom_pvqemu_cb(egc, &sdss->pvqemu, 0); - } else { - libxl__spawn_local_dm(egc, &sdss->pvqemu); } =20 return; =20 out: - assert(ret); - spawn_stubdom_pvqemu_cb(egc, &sdss->pvqemu, ret); + assert(rc); + spawn_stubdom_pvqemu_cb(egc, &sdss->pvqemu, rc); } =20 static void spawn_stubdom_pvqemu_cb(libxl__egc *egc, diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 2b4a1cc..895bb65 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -4129,6 +4129,7 @@ typedef struct { libxl__destroy_domid_state dis; libxl__multidev multidev; libxl__xswait_state xswait; + libxl__spawn_state qmp_proxy_spawn; } libxl__stub_dm_spawn_state; =20 _hidden void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_st= ate*); --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056097; cv=none; d=zohomail.com; s=zohoarc; b=PBAmCObyYskq4VBoWQCo1gF/i5NNsw3laGRh3U5tIYMvMn6T01BPGHmOuW4MYr6ya9Nz9fWvld//yyd4DK1R4UTFO0YKvq3bK6r0Is31pSp6EOO9v1P7abBEsLJ3oR0uaB46JaxAFfOdHrWUDQbIf0ZbrtYlcZWZZHH5i4oVPdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056097; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g3wlyR2j8KBPMQi5My6Vq3CrzbD2/TB7UZzDJI07lb4=; b=CPgWwLxnH9Py2u9ZccT4Yw1wnX/imWlFMx962XyGeY4NXy7SPULPivxekPtZRDJAE19VfCrnKu4KuY9xWNaYj4lGtvzXwaDTh84/AsgXlv14GtmjMeF3uI+jFf5AxtQopkLAcUKBlB7wmZZ8gRsVeBsHFAOz47mSigfDY+ClBVU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056097379277.47451113701163; Tue, 14 Jan 2020 18:41:37 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYc4-0005ML-QK; Wed, 15 Jan 2020 02:40:56 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYc3-0005KO-Fh for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:55 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 622226d8-3740-11ea-ac27-bc764e2007e4; Wed, 15 Jan 2020 02:40:25 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 24F73221FB; Tue, 14 Jan 2020 21:40:25 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:25 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 162A130607D0; Tue, 14 Jan 2020 21:40:23 -0500 (EST) X-Inumbo-ID: 622226d8-3740-11ea-ac27-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=XUoyc5ge8gaoTt+kRNb24DcZvfyliS+0TeVNbGt1z Go=; b=POz2yF36uHzf/SR9NODc43HYlKrTD5msV8YN9IdwlMLYv+UyvgIiaV9wj uro8X9GGX2h/HCTjEPHfjSndERd/FlE8vc/oV9xRIdUiV/Lg1RUhmHpf0spfeHNk 03+CwWiRFymX0HLDHzOPDpnt6Zj2Zg1hu/oad4sqBFj2rpW2ivMTFpn9dPElyQiN APgotZssDSQB38J4u8KM07hgkEP23u1xnf3wb74W+tiZmw0o/4Uw5vAWPSK4XbO3 y5/8P1InIXjyT/zPZnzGtUA/hfIH6ZNwT+3EOejKfqeDHj49yjBlRflpKq81XxGf 66vidmhp2Avg1+ZgikjcLFJe3aEqA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpeek X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:52 +0100 Message-Id: <844c2e98000772126a3168305d692192df90c204.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 13/16] Regenerate autotools files X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Samuel Thibault , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Since we have those generated files committed to the repo (why?!), update them after changing configure.ac. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- configure | 14 +------------- docs/configure | 14 +------------- stubdom/configure | 14 +------------- tools/config.h.in | 3 +++ tools/configure | 46 ++++++++++++++++++++++++++++------------------ 5 files changed, 34 insertions(+), 57 deletions(-) diff --git a/configure b/configure index 83f84b0..e5d14b7 100755 --- a/configure +++ b/configure @@ -644,7 +644,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -723,7 +722,6 @@ datadir=3D'${datarootdir}' sysconfdir=3D'${prefix}/etc' sharedstatedir=3D'${prefix}/com' localstatedir=3D'${prefix}/var' -runstatedir=3D'${localstatedir}/run' includedir=3D'${prefix}/include' oldincludedir=3D'/usr/include' docdir=3D'${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -976,15 +974,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=3Dyes ;; =20 - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=3Drunstatedir ;; - -runstatedir=3D* | --runstatedir=3D* | --runstatedi=3D* | --runstated=3D= * \ - | --runstate=3D* | --runstat=3D* | --runsta=3D* | --runst=3D* | --runs= =3D* \ - | --run=3D* | --ru=3D* | --r=3D*) - runstatedir=3D$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=3Dsbindir ;; -sbindir=3D* | --sbindir=3D* | --sbindi=3D* | --sbind=3D* | --sbin=3D* \ @@ -1122,7 +1111,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=3D\$$ac_var # Remove trailing slashes. @@ -1275,7 +1264,6 @@ Fine tuning of the installation directories: --sysconfdir=3DDIR read-only single-machine data [PREFIX/etc] --sharedstatedir=3DDIR modifiable architecture-independent data [PREF= IX/com] --localstatedir=3DDIR modifiable single-machine data [PREFIX/var] - --runstatedir=3DDIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=3DDIR object code libraries [EPREFIX/lib] --includedir=3DDIR C header files [PREFIX/include] --oldincludedir=3DDIR C header files for non-gcc [/usr/include] diff --git a/docs/configure b/docs/configure index fdfc110..598813d 100755 --- a/docs/configure +++ b/docs/configure @@ -634,7 +634,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -711,7 +710,6 @@ datadir=3D'${datarootdir}' sysconfdir=3D'${prefix}/etc' sharedstatedir=3D'${prefix}/com' localstatedir=3D'${prefix}/var' -runstatedir=3D'${localstatedir}/run' includedir=3D'${prefix}/include' oldincludedir=3D'/usr/include' docdir=3D'${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -964,15 +962,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=3Dyes ;; =20 - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=3Drunstatedir ;; - -runstatedir=3D* | --runstatedir=3D* | --runstatedi=3D* | --runstated=3D= * \ - | --runstate=3D* | --runstat=3D* | --runsta=3D* | --runst=3D* | --runs= =3D* \ - | --run=3D* | --ru=3D* | --r=3D*) - runstatedir=3D$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=3Dsbindir ;; -sbindir=3D* | --sbindir=3D* | --sbindi=3D* | --sbind=3D* | --sbin=3D* \ @@ -1110,7 +1099,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=3D\$$ac_var # Remove trailing slashes. @@ -1263,7 +1252,6 @@ Fine tuning of the installation directories: --sysconfdir=3DDIR read-only single-machine data [PREFIX/etc] --sharedstatedir=3DDIR modifiable architecture-independent data [PREF= IX/com] --localstatedir=3DDIR modifiable single-machine data [PREFIX/var] - --runstatedir=3DDIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=3DDIR object code libraries [EPREFIX/lib] --includedir=3DDIR C header files [PREFIX/include] --oldincludedir=3DDIR C header files for non-gcc [/usr/include] diff --git a/stubdom/configure b/stubdom/configure index 8f0bdcf..e2443e9 100755 --- a/stubdom/configure +++ b/stubdom/configure @@ -661,7 +661,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -751,7 +750,6 @@ datadir=3D'${datarootdir}' sysconfdir=3D'${prefix}/etc' sharedstatedir=3D'${prefix}/com' localstatedir=3D'${prefix}/var' -runstatedir=3D'${localstatedir}/run' includedir=3D'${prefix}/include' oldincludedir=3D'/usr/include' docdir=3D'${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1004,15 +1002,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=3Dyes ;; =20 - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=3Drunstatedir ;; - -runstatedir=3D* | --runstatedir=3D* | --runstatedi=3D* | --runstated=3D= * \ - | --runstate=3D* | --runstat=3D* | --runsta=3D* | --runst=3D* | --runs= =3D* \ - | --run=3D* | --ru=3D* | --r=3D*) - runstatedir=3D$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=3Dsbindir ;; -sbindir=3D* | --sbindir=3D* | --sbindi=3D* | --sbind=3D* | --sbin=3D* \ @@ -1150,7 +1139,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=3D\$$ac_var # Remove trailing slashes. @@ -1303,7 +1292,6 @@ Fine tuning of the installation directories: --sysconfdir=3DDIR read-only single-machine data [PREFIX/etc] --sharedstatedir=3DDIR modifiable architecture-independent data [PREF= IX/com] --localstatedir=3DDIR modifiable single-machine data [PREFIX/var] - --runstatedir=3DDIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=3DDIR object code libraries [EPREFIX/lib] --includedir=3DDIR C header files [PREFIX/include] --oldincludedir=3DDIR C header files for non-gcc [/usr/include] diff --git a/tools/config.h.in b/tools/config.h.in index 5a5944e..5abf609 100644 --- a/tools/config.h.in +++ b/tools/config.h.in @@ -123,6 +123,9 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS =20 +/* QMP proxy path */ +#undef STUBDOM_QMP_PROXY_PATH + /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 diff --git a/tools/configure b/tools/configure index 977a883..ef4b5d8 100755 --- a/tools/configure +++ b/tools/configure @@ -770,7 +770,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -811,6 +810,7 @@ with_linux_backend_modules enable_qemu_traditional enable_rombios with_system_qemu +with_stubdom_qmp_proxy with_system_seabios with_system_ovmf enable_ipxe @@ -896,7 +896,6 @@ datadir=3D'${datarootdir}' sysconfdir=3D'${prefix}/etc' sharedstatedir=3D'${prefix}/com' localstatedir=3D'${prefix}/var' -runstatedir=3D'${localstatedir}/run' includedir=3D'${prefix}/include' oldincludedir=3D'/usr/include' docdir=3D'${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1149,15 +1148,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=3Dyes ;; =20 - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=3Drunstatedir ;; - -runstatedir=3D* | --runstatedir=3D* | --runstatedi=3D* | --runstated=3D= * \ - | --runstate=3D* | --runstat=3D* | --runsta=3D* | --runst=3D* | --runs= =3D* \ - | --run=3D* | --ru=3D* | --r=3D*) - runstatedir=3D$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=3Dsbindir ;; -sbindir=3D* | --sbindir=3D* | --sbindi=3D* | --sbind=3D* | --sbin=3D* \ @@ -1295,7 +1285,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=3D\$$ac_var # Remove trailing slashes. @@ -1448,7 +1438,6 @@ Fine tuning of the installation directories: --sysconfdir=3DDIR read-only single-machine data [PREFIX/etc] --sharedstatedir=3DDIR modifiable architecture-independent data [PREF= IX/com] --localstatedir=3DDIR modifiable single-machine data [PREFIX/var] - --runstatedir=3DDIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=3DDIR object code libraries [EPREFIX/lib] --includedir=3DDIR C header files [PREFIX/include] --oldincludedir=3DDIR C header files for non-gcc [/usr/include] @@ -1531,6 +1520,9 @@ Optional Packages: Use system supplied qemu PATH or qemu (taken from $PATH) as qemu-xen device model instead of build= ing and installing our own version + --stubdom-qmp-proxy[=3DPATH] + Use supplied binary PATH as a QMP proxy into + stubdomain --with-system-seabios[=3DPATH] Use system supplied seabios PATH instead of buil= ding and installing our own version @@ -3378,7 +3370,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) <<= 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 =3D=3D 721 && LARGE_OFF_T % 2147483647 =3D=3D 1) ? 1 : -1]; @@ -3424,7 +3416,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) <<= 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 =3D=3D 721 && LARGE_OFF_T % 2147483647 =3D=3D 1) ? 1 : -1]; @@ -3448,7 +3440,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.= $ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) <<= 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 =3D=3D 721 && LARGE_OFF_T % 2147483647 =3D=3D 1) ? 1 : -1]; @@ -3493,7 +3485,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) <<= 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 =3D=3D 721 && LARGE_OFF_T % 2147483647 =3D=3D 1) ? 1 : -1]; @@ -3517,7 +3509,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.= $ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) <<= 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 =3D=3D 721 && LARGE_OFF_T % 2147483647 =3D=3D 1) ? 1 : -1]; @@ -4519,6 +4511,24 @@ _ACEOF =20 =20 =20 +# Check whether --with-stubdom-qmp-proxy was given. +if test "${with_stubdom_qmp_proxy+set}" =3D set; then : + withval=3D$with_stubdom_qmp_proxy; + stubdom_qmp_proxy=3D"$withval" + +else + + stubdom_qmp_proxy=3D"$bindir/vchan-socket-proxy" + +fi + + +cat >>confdefs.h <<_ACEOF +#define STUBDOM_QMP_PROXY_PATH "$stubdom_qmp_proxy" +_ACEOF + + + # Check whether --with-system-seabios was given. if test "${with_system_seabios+set}" =3D set; then : withval=3D$with_system_seabios; --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056084; cv=none; d=zohomail.com; s=zohoarc; b=TylGKYLXyEu4yIr8xfswljKDzQCy3B5HupjxJvmLRz6OL9Z41Ko1sut4ABPaW6DPp78ln1YalulkmvfWqk+rgWTSELd0pilWqaoQoUc0I6NnvlINUjXp/rNUE23n9Hw0X/5Llb6oHNY+b2R34SqvoJXIVEFx1T66SRg3KhbxHvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056084; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/72WC0akKiyTU2yNELh1vkaRFFlVTgHupy106JtTFJI=; b=JkZoC21Af9sT+e3x4z1zAjw4vZa57LgKZSzAllMqYMux7/mj15eaMMo1Eglbn2wnBDRhXBlqqjkN+KKEIOvOISV203EEDsjt5MAyKcqpOL1mrYAyiYVQ7Owj1c/ZSlFDk8oRDFV5sXh30R0T3Fzj54OBvns4wrMoms9f1/dQjbo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056084295637.9325465041443; Tue, 14 Jan 2020 18:41:24 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbz-0005Do-Az; Wed, 15 Jan 2020 02:40:51 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYby-0005CF-7l for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:50 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 62220b1e-3740-11ea-84bb-12813bfff9fa; Wed, 15 Jan 2020 02:40:25 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id D9DDA221FC; Tue, 14 Jan 2020 21:40:25 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:25 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id F3E633060783; Tue, 14 Jan 2020 21:40:24 -0500 (EST) X-Inumbo-ID: 62220b1e-3740-11ea-84bb-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=Y8eQEIlpMW2Zye2mjuuWV+w6h3gg33FDMFcw8zObz A4=; b=OnCn7makqUvxBd4+TpkBZe3/IrYMdjhA/J/nbWVV+/G9/wm2fBFI1Az1K W+wVDVNo8kZCdnZd0kPizmWfL5KYs+SvaQyUCxS8Wm2/MRrAnhMGtWKOx4Fvss4F MYFSK4lXe+eJc90xuDcrMU3b9g/QoHEPgW6LMKidFpBN11d5J+5JolnrRSChB8ab qf734AIAxJJbKguP+pbR9Fg7mPU/TaxhWqWv+votb/Qal9S5ideS59AcPHZlfA9N IiMmkpvQzC+BeB9Iog2TR2zpa5D8HcF7uWKjzwZCgs4ApJU76FL9+mu2y7BT6CLZ ndKnCbhGyjyG29KXRwoEM8lY8wfBQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpeek X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:53 +0100 Message-Id: <6e78421d673d3efc6b0f31b333c40b308632876e.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 14/16] libxl: require qemu in dom0 even if stubdomain is in use X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Until xenconsoled learns how to handle multiple consoles, this is needed for save/restore support (qemu state is transferred over secondary consoles). Additionally, Linux-based stubdomain waits for all the backends to initialize during boot. Lack of some console backends results in stubdomain startup timeout. This is a temporary patch until xenconsoled will be improved. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- tools/libxl/libxl_dm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 23ac7e4..43af31b 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -2464,7 +2464,11 @@ static void spawn_stub_launch_dm(libxl__egc *egc, } } =20 - need_qemu =3D libxl__need_xenpv_qemu(gc, dm_config); + /* + * Until xenconsoled learns how to handle multiple consoles, require q= emu + * in dom0 to serve consoles for a stubdomain - it require at least 3 = of them. + */ + need_qemu =3D 1 || libxl__need_xenpv_qemu(gc, &sdss->dm_config); =20 for (i =3D 0; i < num_console; i++) { libxl__device device; @@ -2596,7 +2600,11 @@ static void qmp_proxy_spawn_outcome(libxl__egc *egc, int rc) { STATE_AO_GC(sdss->qmp_proxy_spawn.ao); - int need_pvqemu =3D libxl__need_xenpv_qemu(gc, &sdss->dm_config); + /* + * Until xenconsoled learns how to handle multiple consoles, require q= emu + * in dom0 to serve consoles for a stubdomain - it require at least 3 = of them. + */ + int need_pvqemu =3D 1 || libxl__need_xenpv_qemu(gc, &sdss->dm_config); =20 if (rc) goto out; =20 --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056091; cv=none; d=zohomail.com; s=zohoarc; b=Evh7T/heZj4vR+ZLXS3meHFWplgP1EacTzF3mEkCbwNOKyi/wC1bgVKswxnAjF7MeB/z0hoxg6VcHhcGi6JSFMUhXH1QN7VczJRDEtlH0+7HiJfnqbSxIZEImMJWzeG/nlbWKzluRq2PGboRYbmtJWyotW7+N7r4oBU1E0zqoBc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056091; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=26AaEbVz1I5kuR6Vw3T89FM4oGYL65PBw+SgdYLNwTY=; b=ZRF9ADM9kGBE6knhMViBLzLQDmBGjMPvsD+blX5TfYgz0E8U7jdyGZBDZfabLgY2IhrIv/wEeEMujbBMn1uacxOXdq4lOR9msYxfcKILWo8Au55eKeXDZdVWu4jRXfL5USAXOX4WntiZ6n7LxvaDjOn8T2eGV9/seW9ovGzUqxY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056091935557.1266080745297; Tue, 14 Jan 2020 18:41:31 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYbz-0005Ee-SS; Wed, 15 Jan 2020 02:40:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYby-0005Cc-Fd for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:40:50 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 63199198-3740-11ea-a2eb-bc764e2007e4; Wed, 15 Jan 2020 02:40:26 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C2D1721FF3; Tue, 14 Jan 2020 21:40:26 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:26 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id DBF8630607B0; Tue, 14 Jan 2020 21:40:25 -0500 (EST) X-Inumbo-ID: 63199198-3740-11ea-a2eb-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=AcVTNedDF3VXzduCNtouIhXEn8qyT1uEIJjXMdFh6 hA=; b=ZOVFxWnNMkH8kqmZOlfj9+8IimIQ5GJo8osuXYZtOLgSUVYzaL+pLq9zc ioLVjOekfc9AwE9zkiv/JzyHXXHfi5Y5zDYs9p0CZIV6W/OZTCSj4PDG6Amabwjv otlb9FhNugSNxhBDaJRQWL3mBBQNIsXThbrADsDcowViZlCSIllRtGfEiPf8bW9+ cqODg70Gly9s6Yl8l5kBYO6QUjo/tkQnKakd0+L69tqOzuESF13pRqxpLj0txY/n 1N2nlbKvUH/Q4HisixKdg4NdkG4MMIRxKekyZhEIfEZv7+xhmb+sgKFH669qixgG G5DLUzyW73H+N+n2ku6M37x66ZNIA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpeek X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:54 +0100 Message-Id: <80cc023087afee3c37d68f18af258eba5dc75584.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 15/16] libxl: ignore emulated IDE disks beyond the first 4 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Qemu supports only 4 emulated IDE disks, when given more (or with higher indexes), it will fail to start. Since the disks can still be accessible using PV interface, just ignore emulated path and log a warning, instead of rejecting the configuration altogether. Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jason Andryuk --- tools/libxl/libxl_dm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 43af31b..89eca1e 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1871,6 +1871,13 @@ static int libxl__build_device_model_args_new(libxl_= _gc *gc, } =20 if (disks[i].is_cdrom) { + if (disk > 4) { + LOGD(WARN, guest_domid, "Emulated CDROM can be only on= e of the first 4 disks.\n" + "Disk %s will be available via PV drivers but not= as an " + "emulated disk.", + disks[i].vdev); + continue; + } drive =3D libxl__sprintf(gc, "if=3Dide,index=3D%d,readonly=3Don,media=3Dcdrom,= id=3Dide-%i", disk, dev_number); @@ -1948,6 +1955,10 @@ static int libxl__build_device_model_args_new(libxl_= _gc *gc, &disks[i], colo_mode); } else { + LOGD(WARN, guest_domid, "Only 4 emulated IDE disks are= supported.\n" + "Disk %s will be available via PV drivers but not= as an " + "emulated disk.", + disks[i].vdev); continue; /* Do not emulate this disk */ } =20 --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun Apr 28 06:32:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579056086; cv=none; d=zohomail.com; s=zohoarc; b=aqVgcgcbke0RKNCeF2QdRFDbVgJGpa6otXUUXh/3PPAlmAjLkkdG6W/Uvflcyx/uX1PMzMI/vqp3SIDiKdFBELMWGPzuS+rHTiL4lL4eVzBw6iPp6feDLvKDeZ1tOFo50nA7RU/rW4ONqAMs5TirNMjwTiLE65Hydkr827Oo2hY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579056086; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5k2BePXeTJ4tmEduHl2hciyaQUO5GW3FH0dR2gmUZGs=; b=CJNblMvyemCVQhPZTnEPuIJM7XiGq2novffcwGOwdK206WlkRWf1S/rsNLxKFgc5q3SZrdtu/wAc6pQnyhqbO7B4p1nj2wWSFwbZOSIhPQcZ0KPCoH2lxioy0y5EP+d5fLxBcFOerWSwqD1BYe+kHaFO8xXlkhqLcVyqALJo+V8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579056086090530.9262452348529; Tue, 14 Jan 2020 18:41:26 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYc9-0005SA-5j; Wed, 15 Jan 2020 02:41:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irYc8-0005RJ-GX for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 02:41:00 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 63a465f2-3740-11ea-a2eb-bc764e2007e4; Wed, 15 Jan 2020 02:40:27 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 9DD92221E9; Tue, 14 Jan 2020 21:40:27 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 14 Jan 2020 21:40:27 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id C596C30607B4; Tue, 14 Jan 2020 21:40:26 -0500 (EST) X-Inumbo-ID: 63a465f2-3740-11ea-a2eb-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=3HlN1na3MvkQFx0jgbE8tJCxMyOmwWnEHlp+SeBur Hw=; b=EIiK5iOf+Mk7mKdjVXy/d4c/hkK3QiY3slziBANqIiaQ9Vf7I+L9yj/9l BC/FmKlzElKHbVzoTy+/VXSANnereE37Tm6hHE/ZczKHxIrsQiwD//flxGRj2PSc +yjPKQ80W83C1ict7g5FVHSVdmYSizJzknrXPLF+FV7MqVO7jA+uF681RwnApgbl q/swEL+j4Rl9S3xCM6LOUxXYtmT0AbVUjIn400Cob1LXL1ggglb2Fy4a/zHvF4vH VM2Lwfx7YbeaJo4kcPAvswnikSktc6eJNEdDEaH6lspQFocFMIzBuE/hPpLF2FpS 0RSOCxXLpUJuXnKUdIT7/SlwkFc7w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpeek X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 15 Jan 2020 03:39:55 +0100 Message-Id: <13e463d7e4e797a215e8f2c5437a9499af6fd92c.1579055705.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 16/16] libxl: consider also qemu in stubdomain in libxl__dm_active check X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Since qemu-xen can now run in stubdomain too, handle this case when checking it's state too. Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jason Andryuk --- tools/libxl/libxl_dm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 89eca1e..7698887 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -3729,12 +3729,18 @@ out: =20 int libxl__dm_active(libxl__gc *gc, uint32_t domid) { - char *pid, *path; + char *pid, *dm_domid, *path; =20 path =3D GCSPRINTF("/local/domain/%d/image/device-model-pid", domid); pid =3D libxl__xs_read(gc, XBT_NULL, path); =20 - return pid !=3D NULL; + if (pid) + return true; + + path =3D GCSPRINTF("/local/domain/%d/image/device-model-domid", domid); + dm_domid =3D libxl__xs_read(gc, XBT_NULL, path); + + return dm_domid !=3D NULL; } =20 int libxl__dm_check_start(libxl__gc *gc, libxl_domain_config *d_config, --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel