From nobody Tue Feb 10 02:01:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506731992256802.7213023643255; Fri, 29 Sep 2017 17:39:52 -0700 (PDT) Received: from localhost ([::1]:37578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy5ol-00048d-FC for importer@patchew.org; Fri, 29 Sep 2017 20:39:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy5Wv-0005UD-MO for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:21:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dy5Ws-0006mZ-CN for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:21:17 -0400 Received: from mail-co1nam03on0081.outbound.protection.outlook.com ([104.47.40.81]:20288 helo=NAM03-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dy5Wr-0006lV-Vi for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:21:14 -0400 Received: from MWHPR02CA0040.namprd02.prod.outlook.com (10.164.133.29) by CY1PR02MB1135.namprd02.prod.outlook.com (10.163.15.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sat, 30 Sep 2017 00:21:10 +0000 Received: from SN1NAM02FT048.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::203) by MWHPR02CA0040.outlook.office365.com (2603:10b6:301:60::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.11 via Frontend Transport; Sat, 30 Sep 2017 00:21:10 +0000 Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT048.mail.protection.outlook.com (10.152.72.202) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.56.11 via Frontend Transport; Sat, 30 Sep 2017 00:21:09 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:43480 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1dy5Wn-0000GD-8b; Fri, 29 Sep 2017 17:21:09 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1dy5Wn-0007bK-4U; Fri, 29 Sep 2017 17:21:09 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v8U0KxXm001139; Fri, 29 Sep 2017 17:21:00 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1dy5Wd-0007ZD-QP; Fri, 29 Sep 2017 17:20:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TuziNhRoS9SRJdbzaoRYgSsFpEMKtc/F52wndA4FXxY=; b=RkCw5mKY4ym4LQIvIM5SFAr+wdaZP7/AtGOESYuOy0yAkZWPPuYT/U/yWtuQbxKCWJGH4xVjbO32DPTG1qwHYXzfWRiao9x+od6s6EH94Jg4G39lxt2jh2vT78hQ8B9uuYmLwx70FjkojPAohzYrMBE9ZuXhMONNyvbKsOhNj0I= Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@gnu.org; helo=lists.gnu.org; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; From: Alistair Francis To: Date: Fri, 29 Sep 2017 17:17:12 -0700 Message-ID: <73617234cd9894007428b8aaaa46b0744b997e0c.1506730372.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23358.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(118296001)(81156014)(2351001)(50466002)(48376002)(106466001)(76176999)(33646002)(50986999)(2906002)(106002)(6666003)(81166006)(63266004)(305945005)(8936002)(54906003)(4326008)(5660300001)(50226002)(39060400002)(189998001)(478600001)(2950100002)(6916009)(36386004)(9786002)(36756003)(8676002)(16586007)(5003940100001)(8666007)(77096006)(47776003)(316002)(356003)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1135; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT048; 1:P/XyEaC0ydZoiZPX7dABJVW0YMLBGgNV+AhUw9otFeshqz7C9+RUdHT4H6tLcKGMSV7KtCK/cbexu2VRi6AzXVwlNY20j2pejB8503CwtZH5CA8r9NAdhoh5opL1svcV MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eda7fdcf-d739-4e4c-1158-08d50799267f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY1PR02MB1135; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1135; 3:fOsWGTSmM2uKXclv7HKVdg0fG7lwrj+bji6RTABhboTIkU8MvifSJi9jLrEqwA9g5K30LaRJvJTR1dbhYeEjl0mSAgtML5KKQtUQql+7r3tDbmFXKrGQILSBFtJ5M7S5mhGkrfh2dCbUwt3ymeRq2EvHWo8dakj7eIkuTwYeeiX5BHYEuuO8LmuGTbb0dBSjlDScZNQD7+1PtIEYqfKTADqZrEsyyirDu5RzPOIn+BfhgKm1yylY69mWjBitdtwmF4kXaflZM4ZCUDThE3GjikjKW3z7/mYHT1W7OnIyvoztfATAdtQQpl9dSlWXTHyn90BGOHAdECcM6HmdUAGh8Vy795zCgo3q9DZa5idPJig=; 25:rBuwMGR7Gr42vrK+2DuCU2qVKLcVts+o3PKe26HbYM2ip9lhm4BWff5vSqB4grVFvqCfU8paS1ngkFV5urBxDY8vDFzXGx2KKNvnPwA8vcUGRB6ih4BxSak3ZL+H4MZ4gHOdLN3YVxGeY5252YVgoOCjromw5t0Aqg941TV8mlZEmgDvoVV5zxOtC0CQ9qWV4GnxeW16qka4meeXuMdjffCCxny0sMfo2zN++5+pS4zg5lcHE8EcMmfnD+pEApjP5tABPbTsR3vsppfgBOZHsQExC+T3sa9UWAK/2nXa516w93RyXHgsx4KrHaJL0etNg3hygwc4XYFsF79nnmmG6w== X-MS-TrafficTypeDiagnostic: CY1PR02MB1135: X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1135; 31:BsQEdt7R7hfMjMEFK9CpSrZX4OMYD91bM1O0tb9+WeoiZkvc7NYi1gLxYy6M43wcZbTdJlnm0ES0ctO/8cAVuuH6gUYaMWbGi3rgSMPSo7DGJeKoYPEG1bKO3X30ugSiFtNP86tU/LU81kBZ/YrwpPCP1fUsz8kwqrdKYVQwfJeoP15lD/7ZpEH+JtGYw26whENuBDZ9YC56+S7/vsGyu6SpCEPAMvrMepWOMNpMHK0=; 20:WxxGWe42ki1mW3ovruJm8aJsyWZjbk5jrXr0dlCx2WbHuBqIyWJJmWB1+3201F3TIMmznjOCc8Dv6Sxj5+TJy88ZZTt2IDXMytSVERtoTF9RycRXOZPsSVVX3Pi5zAFKUd9HMvOK0LzLHogiY0QA+qAA+Hk3zoypcjwxErnUj5iFGGP6ZuRU5UUqJB8BQ0G6ivpP/Tk/Qy2fkwV4Na6xkeIymd5cQVjtmuq8hKPIzgTF+xcoGTG7J1LBRFJ7uuXfalzUjll8H6BXGTzAEYnxt65sbrxYZCFwYYaseFAS81xgJ2S+msm+HlTlP97iO1Ki/oTNwRVSX139VTQqfQ0G3/BxKLAyXzuq946nfPj69r3kgYRKlULATPJGkJJGxQyH45i/yVAgmAN1Yjw4zdeGJl+yetHPJGAEWcsx1ZKoo8XpNRZTJwYt2WpUHXy4KT1brCIRJIQxjkaGYwspHVSb6L6ogunJQZMv+hHG5h2W8S5v3KcXpecf027d0UUuglQ3 X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592)(70601490899591); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(93006095)(93004095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123562025)(20161123558100)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR02MB1135; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR02MB1135; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1135; 4:n2n6nfVw2c7La7djIGzPSh0uBeUZ+a5ID7YKIQ4Nnu5y8nkHzgLeYH4bKaKtD80sMVvpYHUTi/n7rFjXT9Bear7OOkN6bJHNYeI+vHBjDumilFfDwn7lz43+YLn3x+kR7LpQJVXgai8Qs0wcZK7YB/dLqYnFcTKB2Ty6X7fx8wuX/jZ/jryEL1aoa6icmCuE+hFQdfEmjSX1qG5G7KJtRE8E2lARdlPQOX9I9O+dwbw0j8dWMJwnNXtArfcUPLhg/WsP6Mh2SuKPkmR4MLPRjcl3rgupF8aeY9qcJdoQCmYwh79UXqlwPFyPvMe5XWK/xBJQlOlac31zq2X63eymMmQUhM9juF1tUHZ8GiX8WMc= X-Forefront-PRVS: 0446F0FCE1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR02MB1135; 23:1WhuqPuvMkX7vM8fkDbHbROj17dvFf25vGiQDySWe?= =?us-ascii?Q?rbiL2RP7PL+KTzgYASMfTOuXDyfNm/aMKaLCqfa8/5y12j+5eu4JQuAuFIXy?= =?us-ascii?Q?CUmIZe2VBgy5mGsrV9qCEPxSME8azocvJvzqwHJiNQaV6XnZI9HQNZG3XN3K?= =?us-ascii?Q?2KO1jdZJu2PCkGhyVbSGlbrdvpZtviHt7KLpCaRRVbuuVCtHJNRUZisPOCLT?= =?us-ascii?Q?MsHIvF8qNJhqRWHz0wPhPeOaF5P2jQRY25/KPfs5XWgdNfs2jA8tNkqml8Cb?= =?us-ascii?Q?xl4/n3Vs+nen/MuQ3GBxXwbLjsX7NTDhITVMyB0w+nj+CXTJGzJRQIq+fsqF?= =?us-ascii?Q?vK+/HZx21aYKPykUVYtv3PPKbvccJsLzqHEdLn6kk/EXD0iwHVi1qJVQCNyB?= =?us-ascii?Q?hHJE6wwQohKtTIbLSFJI9N2GYBU/eGo+lHYUQHkjNbOmwUP2fCIzut4E9Huv?= =?us-ascii?Q?OY+piyP4gOSjZxJN7E2NUCtK5ePemwrwoWDaY/xWK1Dc6olndZ14avbN3xd6?= =?us-ascii?Q?DP+pZBeGcUb8o7yGNniY9Ursh3kJt3LryUpKqesVYX2dgpDu5lbL/Mpowzp9?= =?us-ascii?Q?F+MYyi7+J1hN3U/AlqXbBbcswVe4avJ/dPZmY1mHY+mxcceCroIHMFtnKW7S?= =?us-ascii?Q?gHVcdlOmEPhk2tIKEv3PgdAp3FRauJo96ikyab9RGWuaxLsPMISt05tP6/OM?= =?us-ascii?Q?drDcOmjY1L5tCEsgxlvP1JuiaYx5VS6SGJ53MBKfOs7rQq6HTC7Ty9g7bGIj?= =?us-ascii?Q?RHNoiHqJP3AF/AqwyGVMFQ7yvvDAQBBaSduaNRvN0Q+dMldJuaRJrhM9yjeT?= =?us-ascii?Q?LEpYY4OYp/7/bZB63WG+LziO+SMDReBqBTA2Z1AbBgk2p/H+dzXqZD+c2cbV?= =?us-ascii?Q?RxKLmh2qT2urbVOmPlfzfZCYpJNLhP5VguZYEHgw6hU9T69/ei+KozEvt711?= =?us-ascii?Q?npHOXnL3sMKMT0WnvQL6WRPcEVV/kvCR88hy/o85h9dlceTI30+cqgpJdh9F?= =?us-ascii?Q?p4RrVydJzYldSfd/xiYGKGBxqXY060g8tVpxe9PYt84xhZ20EfDRxqGITTJB?= =?us-ascii?Q?UyIHga3OTqLCN2gZNIj81PkcuPW5evj0+Q7jkCLPz0PRUYD2w=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1135; 6:qy9kJUn2bDGXkHmwK9aKwryy8aw1zQintSAKKGZWWnvmI0K/72dTIUGj+SqqpCndUQ9GQvh6W1op1cTIKg3wyi4f7g5YsPEv++GL4ZKbG+cAj45FGgORJPzzeC7eKAeeED9Tvrw6ikaP2hptEPBU9WdaAhgNti9eqImcsBMZW9dv5M32H9DAbs4wz45eKSSuhBDm2KSgXogNIr8/IDGC0PHEFtx/7c8hCdGHV5CRS7ph4fa/IEqyQgfErhXJrfVFknCJKS7/ancF6bKx0u/s0DvNFJ6hfgSDgsjVV8R5s+rNFqTk5yWHz7SBkapN2QrSF8iPgkrJ7lX7DFrVUdqy5g==; 5:Pq9t9JiIaQcfaoBoj328lGeXnUOD0aQxdtOgIuQwKxojhBIQ+eS7NYRGPnAfwfJGTMVQMxSrJ9gzRN4xclYOjiRUSq2naKgPAJ2N8/vz4a02Kgifow9Sv/tIq8e1xUKklkpc0ZTIn47bbuYkK8N/+3+CjJGpeywCM003JK/hGko=; 24:I3lq0utPCEjLsgDEfcJCXFSpjw/RwTukNr4XZd2tDkoHHNw4GpD8mEOpBULZ6vO9dMuGajxtG4DjJWpNIsI3SNyZX+GmkC+dJxT3rQCpR28=; 7:d3IuJwlig3LZKGhsLkZWRKqXS0yNUHDUPF1ZiB0jk1vKFiQEW8KJGa0G6Us8hQZl6VoyqpuuU3Vf7r1gan8PXO9GxgRGwu0bqDrCOgBEnmZ9lxmU2q3SivclW9uqAtIxhvDC3wFB+WWWgPkZ/kDdDP2zK2E4jvPsjQRaWwZXqktqFNIeFNs4YV3UFW0bndSzXV9VqvHcwxvJk2jhkWnSAJbOvBQukqidSYX9mV9rwOw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2017 00:21:09.7076 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1135 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.81 Subject: [Qemu-devel] [PATCH v2 42/47] hw/xen*: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anthony Perard , alistair23@gmail.com, Stefano Stabellini , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_= report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_re= port("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report= ("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("= \1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1= "\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\= 2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2)= ;|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|= Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig= }' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}'= \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Stefano Stabellini Cc: Anthony Perard --- V2: - Split hw patch into individual directories hw/xen/xen-common.c | 11 ++++++----- hw/xen/xen_pt.c | 4 ++-- hw/xenpv/xen_domainbuild.c | 24 ++++++++++++------------ hw/xenpv/xen_machine_pv.c | 9 +++++---- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c index 632a938dcc..42ada2ac05 100644 --- a/hw/xen/xen-common.c +++ b/hw/xen/xen-common.c @@ -9,6 +9,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "chardev/char.h" @@ -47,19 +48,19 @@ static int store_dev_info(int domid, Chardev *cs, const= char *string) /* We now have everything we need to set the xenstore entry. */ xs =3D xs_open(0); if (xs =3D=3D NULL) { - fprintf(stderr, "Could not contact XenStore\n"); + error_report("Could not contact XenStore"); goto out; } =20 path =3D xs_get_domain_path(xs, domid); if (path =3D=3D NULL) { - fprintf(stderr, "xs_get_domain_path() error\n"); + error_report("xs_get_domain_path() error"); goto out; } newpath =3D realloc(path, (strlen(path) + strlen(string) + strlen("/tty") + 1)); if (newpath =3D=3D NULL) { - fprintf(stderr, "realloc error\n"); + error_report("realloc error"); goto out; } path =3D newpath; @@ -96,13 +97,13 @@ static void xenstore_record_dm_state(struct xs_handle *= xs, const char *state) char path[50]; =20 if (xs =3D=3D NULL) { - fprintf(stderr, "xenstore connection not initialized\n"); + error_report("xenstore connection not initialized"); exit(1); } =20 snprintf(path, sizeof (path), "device-model/%u/state", xen_domid); if (!xs_write(xs, XBT_NULL, path, state, strlen(state))) { - fprintf(stderr, "error recording dm state\n"); + error_report("error recording dm state"); exit(1); } } diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index 375efa68f6..e86d380d02 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -73,7 +73,7 @@ void xen_pt_log(const PCIDevice *d, const char *f, ...) =20 va_start(ap, f); if (d) { - fprintf(stderr, "[%02x:%02x.%d] ", pci_bus_num(d->bus), + error_report("[%02x:%02x.%d] ", pci_bus_num(d->bus), PCI_SLOT(d->devfn), PCI_FUNC(d->devfn)); } vfprintf(stderr, f, ap); @@ -87,7 +87,7 @@ static int xen_pt_pci_config_access_check(PCIDevice *d, u= int32_t addr, int len) /* check offset range */ if (addr > 0xFF) { XEN_PT_ERR(d, "Failed to access register with offset exceeding 0xF= F. " - "(addr: 0x%02x, len: %d)\n", addr, len); + "(addr: 0x%02x, len: %d)", addr, len); return -1; } =20 diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c index 027f76fad1..f5514ffec2 100644 --- a/hw/xenpv/xen_domainbuild.c +++ b/hw/xenpv/xen_domainbuild.c @@ -25,22 +25,22 @@ static int xenstore_domain_mkdir(char *path) int i; =20 if (!xs_mkdir(xenstore, 0, path)) { - fprintf(stderr, "%s: xs_mkdir %s: failed\n", __func__, path); - return -1; + error_report("%s: xs_mkdir %s: failed", __func__, path); + return -1; } if (!xs_set_permissions(xenstore, 0, path, perms_ro, 2)) { - fprintf(stderr, "%s: xs_set_permissions failed\n", __func__); - return -1; + error_report("%s: xs_set_permissions failed", __func__); + return -1; } =20 for (i =3D 0; writable[i]; i++) { snprintf(subpath, sizeof(subpath), "%s/%s", path, writable[i]); if (!xs_mkdir(xenstore, 0, subpath)) { - fprintf(stderr, "%s: xs_mkdir %s: failed\n", __func__, subpath= ); + error_report("%s: xs_mkdir %s: failed", __func__, subpath); return -1; } if (!xs_set_permissions(xenstore, 0, subpath, perms_rw, 2)) { - fprintf(stderr, "%s: xs_set_permissions failed\n", __func__); + error_report("%s: xs_set_permissions failed", __func__); return -1; } } @@ -235,7 +235,7 @@ int xen_domain_build_pv(const char *kernel, const char = *ramdisk, memcpy(uuid, &qemu_uuid, sizeof(uuid)); rc =3D xen_domain_create(xen_xc, ssidref, uuid, flags, &xen_domid); if (rc < 0) { - fprintf(stderr, "xen: xc_domain_create() failed\n"); + error_report("xen: xc_domain_create() failed"); goto err; } qemu_log("xen: created domain %d\n", xen_domid); @@ -248,21 +248,21 @@ int xen_domain_build_pv(const char *kernel, const cha= r *ramdisk, =20 rc =3D xc_domain_max_vcpus(xen_xc, xen_domid, smp_cpus); if (rc < 0) { - fprintf(stderr, "xen: xc_domain_max_vcpus() failed\n"); + error_report("xen: xc_domain_max_vcpus() failed"); goto err; } =20 #if 0 rc =3D xc_domain_setcpuweight(xen_xc, xen_domid, 256); if (rc < 0) { - fprintf(stderr, "xen: xc_domain_setcpuweight() failed\n"); + error_report("xen: xc_domain_setcpuweight() failed"); goto err; } #endif =20 rc =3D xc_domain_setmaxmem(xen_xc, xen_domid, ram_size >> 10); if (rc < 0) { - fprintf(stderr, "xen: xc_domain_setmaxmem() failed\n"); + error_report("xen: xc_domain_setmaxmem() failed"); goto err; } =20 @@ -275,7 +275,7 @@ int xen_domain_build_pv(const char *kernel, const char = *ramdisk, xenstore_port, &xenstore_mfn, console_port, &console_mfn); if (rc < 0) { - fprintf(stderr, "xen: xc_linux_build() failed\n"); + error_report("xen: xc_linux_build() failed"); goto err; } =20 @@ -285,7 +285,7 @@ int xen_domain_build_pv(const char *kernel, const char = *ramdisk, qemu_log("xen: unpausing domain %d\n", xen_domid); rc =3D xc_domain_unpause(xen_xc, xen_domid); if (rc < 0) { - fprintf(stderr, "xen: xc_domain_unpause() failed\n"); + error_report("xen: xc_domain_unpause() failed"); goto err; } =20 diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index 69a52a9f93..44d67b87c4 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/boards.h" #include "hw/xen/xen_backend.h" @@ -36,7 +37,7 @@ static void xen_init_pv(MachineState *machine) =20 /* Initialize backend core & drivers */ if (xen_be_init() !=3D 0) { - fprintf(stderr, "%s: xen backend core setup failed\n", __func__); + error_report("%s: xen backend core setup failed", __func__); exit(1); } =20 @@ -51,18 +52,18 @@ static void xen_init_pv(MachineState *machine) const char *initrd_filename =3D machine->initrd_filename; if (xen_domain_build_pv(kernel_filename, initrd_filename, kernel_cmdline) < 0) { - fprintf(stderr, "xen pv domain creation failed\n"); + error_report("xen pv domain creation failed"); exit(1); } break; } #endif case XEN_EMULATE: - fprintf(stderr, "xen emulation not implemented (yet)\n"); + error_report("xen emulation not implemented (yet)"); exit(1); break; default: - fprintf(stderr, "unhandled xen_mode %d\n", xen_mode); + error_report("unhandled xen_mode %d", xen_mode); exit(1); break; } --=20 2.11.0