{"id":818404,"url":"http://patchwork.ozlabs.org/api/patches/818404/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/32420d254357de5d661b1af400b27924cbd71282.1506384414.git.alistair.francis@xilinx.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<32420d254357de5d661b1af400b27924cbd71282.1506384414.git.alistair.francis@xilinx.com>","list_archive_url":null,"date":"2017-09-26T00:08:55","name":"[v1,4/8] block: Replace fprintf(stderr, \"*\\n\" with error_report()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"7b9ab2e14d0ac8be3a7b3fc217b6fd30762b2e18","submitter":{"id":47878,"url":"http://patchwork.ozlabs.org/api/people/47878/?format=json","name":"Alistair Francis","email":"alistair.francis@xilinx.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/32420d254357de5d661b1af400b27924cbd71282.1506384414.git.alistair.francis@xilinx.com/mbox/","series":[{"id":5037,"url":"http://patchwork.ozlabs.org/api/series/5037/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=5037","date":"2017-09-26T00:08:34","name":"Remove some of the fprintf(stderr, \"*","version":1,"mbox":"http://patchwork.ozlabs.org/series/5037/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/818404/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/818404/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=xilinx.onmicrosoft.com\n\theader.i=@xilinx.onmicrosoft.com header.b=\"jOVqA+Xa\"; \n\tdkim-atps=neutral","spf=pass (sender IP is 149.199.60.100)\n\tsmtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed)\n\theader.d=none;nongnu.org; dmarc=bestguesspass action=none\n\theader.from=xilinx.com;"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y1LzC5L45z9s7C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 10:13:59 +1000 (AEST)","from localhost ([::1]:44891 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwdVd-00030j-Kx\n\tfor incoming@patchwork.ozlabs.org; Mon, 25 Sep 2017 20:13:57 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:55601)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <alistai@xilinx.com>) id 1dwdUj-0002wE-L6\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 20:13:07 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <alistai@xilinx.com>) id 1dwdUf-0005cp-HR\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 20:13:01 -0400","from mail-by2nam01on0084.outbound.protection.outlook.com\n\t([104.47.34.84]:12258\n\thelo=NAM01-BY2-obe.outbound.protection.outlook.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <alistai@xilinx.com>)\n\tid 1dwdUW-0005Vm-L2; Mon, 25 Sep 2017 20:12:49 -0400","from MWHPR0201CA0026.namprd02.prod.outlook.com (10.167.160.167) by\n\tCY4PR02MB2696.namprd02.prod.outlook.com (10.175.59.18) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.77.7; Tue, 26 Sep 2017 00:12:44 +0000","from SN1NAM02FT047.eop-nam02.prod.protection.outlook.com\n\t(2a01:111:f400:7e44::201) by MWHPR0201CA0026.outlook.office365.com\n\t(2603:10b6:301:74::39) with Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9 via\n\tFrontend Transport; Tue, 26 Sep 2017 00:12:44 +0000","from xsj-pvapsmtpgw02 (149.199.60.100) by\n\tSN1NAM02FT047.mail.protection.outlook.com (10.152.72.201) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.35.14\n\tvia Frontend Transport; Tue, 26 Sep 2017 00:12:43 +0000","from unknown-38-66.xilinx.com ([149.199.38.66]:49822\n\thelo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63)\n\t(envelope-from <alistair.francis@xilinx.com>)\n\tid 1dwdUQ-0001o4-V2; Mon, 25 Sep 2017 17:12:42 -0700","from [127.0.0.1] (helo=localhost)\n\tby xsj-pvapsmtp01 with smtp (Exim 4.63)\n\t(envelope-from <alistair.francis@xilinx.com>)\n\tid 1dwdUQ-0008Uu-S0; Mon, 25 Sep 2017 17:12:42 -0700","from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66])\n\tby xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id\n\tv8Q0Cbx1007369; Mon, 25 Sep 2017 17:12:37 -0700","from [172.19.2.220] (helo=localhost.localdomain)\n\tby xsj-pvapsmtp01 with esmtp (Exim 4.63)\n\t(envelope-from <alistair.francis@xilinx.com>)\n\tid 1dwdUK-0008UQ-Vw; Mon, 25 Sep 2017 17:12:37 -0700"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=xilinx.onmicrosoft.com; s=selector1-xilinx-com;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=WUOGvSpGM57v1mKZwP7G9BsyJeSxN6ZG7D+t6COUCvg=;\n\tb=jOVqA+XaPKlc+qMSymh95+y2hNY3ZEcgfJ5CNF7Ogg0dkI+3aUDCjKcp006hG0jG6K1xfkJ/OYMB067v8ZL1DIilEyjQsv3LBs+DnRTAMkBEQ81okwhu3dkVnuIf0+2ipm1qy6M4alKnPgbvjQCEGZa7Fd45dIpLI5gwb3KupgY=","Received-SPF":"Pass (protection.outlook.com: domain of xilinx.com designates\n\t149.199.60.100 as permitted sender)\n\treceiver=protection.outlook.com; \n\tclient-ip=149.199.60.100; helo=xsj-pvapsmtpgw02;","From":"Alistair Francis <alistair.francis@xilinx.com>","To":"<qemu-devel@nongnu.org>","Date":"Mon, 25 Sep 2017 17:08:55 -0700","Message-ID":"<32420d254357de5d661b1af400b27924cbd71282.1506384414.git.alistair.francis@xilinx.com>","X-Mailer":"git-send-email 2.11.0","In-Reply-To":"<cover.1506384414.git.alistair.francis@xilinx.com>","References":"<cover.1506384414.git.alistair.francis@xilinx.com>","X-RCIS-Action":"ALLOW","X-TM-AS-Product-Ver":"IMSS-7.1.0.1224-8.1.0.1062-23350.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; \n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(376002)(346002)(2980300002)(438002)(199003)(189002)(81156014)(9786002)(8936002)(36756003)(7416002)(50466002)(33646002)(76176999)(54906003)(2906002)(50986999)(16586007)(47776003)(316002)(106466001)(50226002)(48376002)(63266004)(36386004)(2351001)(478600001)(305945005)(2950100002)(81166006)(8676002)(6916009)(39060400002)(356003)(5660300001)(53946003)(77096006)(118296001)(5003940100001)(6666003)(4326008)(189998001)(107986001)(5001870100001)(579004);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB2696; H:xsj-pvapsmtpgw02;\n\tFPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;\n\tA:1; MX:1; LANG:en; ","X-Microsoft-Exchange-Diagnostics":["1; SN1NAM02FT047;\n\t1:V0OPTeT6qgUsz26KESEF+rta2KWbbAvRjgIOgz26O2gZIafm75DHb9vwM15+phtElVZSE48BXI8OcyqKwG4fOeF/mzNiEITriX++TOOs2I4fXggl8RkfhFBhpcdq4DRe","1; CY4PR02MB2696;\n\t3:UNBa3oaYNxDSgzdh9epgoGtoSRtp7lTGZdykAHb0aVE8vK2XyMLeDacYDCWKtYcQne71jWim3oaT9e5oKIR8L5GAtUKyg6KPpMcmUjJTM522dm1ocX53nabiJw0+AohcRLx2PVQnD0uxVX9pQFhAkNEONMLSd/aNAA9bA++s2BxVIL5sySqKSYQ4CdUy/vAnUjz54UALDNSQ06PAKSPSjnbP+lqZk+Q06P0L8juiUEDQk+M4deEAmt1LhoS74mYD8IgTMpj2GMMcZUVP3N7Zebn62dg0eWarFD7CUQeuzhniWp4S5DHkr23g3AsuYdmx7zoQGC2FLP2PknRS7MlJEAOrZKTLmAYnlM/NVGS/j6c=;\n\t25:c+KuG6NuhdSMrGIXZPFRoluDTLSgfw0VTmgx7tcjp5ahSMpubHmsLiuui42Y4gaLVyEelCGZtULTtaMwsyLvKInA1UOXxhqBTJg/NlZlE6t9SR78TjccAh/eHIFwlp2igDe/fKk3u0n+LUkb3PPb4fvlckR1cEBkX7JmIMh+R6oyA4iaftu+DSDKx8ZY5sXigSc7GwG50/u/Fr3xkXmFBvagE2WjTUhY/81HYDwOI3zgPpB/zyxBbjKUruAHt/wkOTo9GaZC/4JoNB4OOOVG8ZNc1vmi1dQaKDNsCh6ems/E/EurqkBGwGqbFsPjkbbXFYq2LHKtDrfp9BeztoIoEw==","1; CY4PR02MB2696;\n\t31:hRagjKPiWD65c7/KQLQ10aUEmwzZC+eKfNCyzB/Jo9OgOcUt6wxmRpVD66wXcgDdizglSxcNk311XznUBXiaT3C1aXxwVzZrOyxDZuOD37hTsjfvRekT2wVLaDZ0XkMLyb2Zs/+w0ZGsz3Z/J/1J+zVv/yylbsyhL4Aghx+mA936WGo08v+RtvIh44wl4dUQWlvz2kSmLObmPu5SJl8zhhv7aFm1vQXchJ3cfXCQfmg=;\n\t20:pVb/o0rqVv7CZgCx19TtQHlXX2ARmYair+XGtBnJSPZplTm76kxUvBGPOTY5O6R0Y5oMVhCUBU/OXzQdLvnR6ZZWkkmMlorMxRrsSCsD65Bn6mIDvn5QCUJeZH4k3khyjunzwbLcx6ZeJ98RpB3DixqPr1iJFAE5PuNtsGIflr3Ef4QySZz3j3sSHXQ4FcKCLcS6RvVSGzzZqVTfMI934B8UAoXAXq69SrI26Maq34jGPzlBHgMPmeKAC9u2OHcC3skAgPEQxRpvclnYlt1ZH7rsBq4nYtZQn48uFv0+D769xrwamdQMqf7GF77whbbP/zrvyZ0vWUMzA5fap3ZqByLbKJw0A5X5WQaV2Q8ki++a9mZfXYTq6GW2TsHr1Oxq5hFnKom6bOeQxH6ts6U2yNhndtaN9Y8aYansX7yoCJwGO2j7tVzNPG6H7UJJTtGa0VmrUq6/E1lYuFVFOuC2NO20q9UsOCUPuefSs1Cb36/5bMY6FRzquAI0PkyX/LlM","1; CY4PR02MB2696;\n\t4:6plnwkuCJ3Kioe6BS6vtp9bmFZ8Fbd0FM6RXzs+QvLePz/1BJ4KIfwH2PcNFTq6JbJDu+MItcWFgNGdwlDo2SuL4aDrQqmZn1eg0fHwg3jHEr6WAxcfqvYftAcUtpo0KTtlz2g6KGnX85umKb0GVNB3J3NXaCtIqmd1ZFn7F57wnDMJUZDKMby5ZYCz7WADZW5XpE+AKW/RPTxed6r1Vy2csYIivpzT2G9NkGSnC4nuIuhS2s7jMHJ2aPuac8aar5UJEkNOyBIKgvyovx/UnqYWHhZDNtslhUk84v2R3FyUWSrZpgvIjLUFTu6aqxVYiKpTi+QXcE0Dpcu8JVh0QDQ==","=?us-ascii?Q?1; CY4PR02MB2696;\n\t23:JEu0FFZ7mNBzxqHNpmZjvzUgCUPr/40VPz5TnDgSy?=\n\tIvkBLjykWa+uiV0UdWG8+akTUmksbPjzMtroaqBtWjA0vAKwLzmT3AS0yNi/vfigOQQdLkyuS98+D9INm3KY4PF1WfMTIZpvdl0fpHXlrj3n2Ni+ndqx+O5BIKvuTO5qH/mcOwKjI6OEYWsT8QW3nLPMGLhGTFbWUo+RPrO7Z5jFYDkvqCVwNxbTVXhYfRhqTgFvWj3rI89eYhGPQJYOpW+5Pj7ndR9eJN9DoAyU8OPtrRoUuwk6yhMZGhXGYDRmQGeLZM9cbtbzsnI5tbs0RTVORF5jUTHG+19ibuOqQtqVq5GxcD6berHhe5wsFgVzJTFA0UpartQOhfvuW2knwyQnvjIRqxU68/XUZrRgRC/mEOvUGSH8YMj0+8YUSMM6XfP944LOCV2JOIGIwjqaIGsJCwknqwMwZ9YpR84Zlq7GXQzZOS8zj8kzXiLlOYwKtX+3gnNLLgYFrkd+/EqmGHNgUDVS53FTrFottvS7cAAfv42o3cUoXGYuq519s1kg94TugNtM/nG3MPMSCDuP6QpowAcQsxJce6wGAilHUUYHN+99c8mGGOSHoI4mbm3IaMe4THvwj2dSK3CVIQKNogowICcG1X/DCR8JBKR4zHICaHij6fvHBdyK5QtjJGSUPycM6aXS5Bb3bnWd+lmES7Nw57o2WstX/fjCuqYqFeRBUk4hGnGrm3wS6s3kF0qT5/QeYsAXIEyJLs/vUBygsIMoq9oR6LWKhjVyTjqLEe9BbejydC8IFLmx0YWGx2gsmgwvSkZreiBtNy1bfArLzjMYOQN3x11nS+MIdtuo6Q9kEBN2kd97gXXPklZike8TVLUZ0Aela4Ibk5Y0hZDS1TzvjEjHjkUqhHpl+E5QNn+F13W9caoGhFI2UM6CTiz2FjLZTurpzQmJhSQR9o185ZyT8bnwf1gV9FBbAZAboWyGqXhMNzczlRxKXD5cxIX2SOtb3wunOY4TrTxkQpECHfXCcalKVtT6wfORG1HA6DPvwbRvp2RhnZq2z0mM6KTrY7M0+ETcQbg4fwFZ4JyfdpHC27MpijGrYf4wYoSlExHjpvdHLWKcZbtb99CwaOsIPo=","1; CY4PR02MB2696;\n\t6:jTYnkjMTZBM1I4oZ5BX3aPZV0bXuDH/VV9HIuGPZU+W1iw+6PBo8qAw+SwBGqRoOoFOCdopL8P+ok3XfmZYltRC4m4ZKIYN1vkzC/1KeSvafoyPBkQokvpxIY0j90VZ1xJoFUdB6/J3gEmezFi+5Qk/oxy80rWERGGR6jY6Eja10M8INMlsNg+gPtoLs9pTRzj0/Hoj70WoEtvbrIo63fmLy0HrteS2ZrvhAN5WN55l8uO68BoKLw3C9DB35SCsjPJNuHhN5MiY6v29SU/raN7iVZyJtphF3SsKnbCGNlzveEhiyKZWTg7AA2davTMMh3oVITRPhklll3Lyfv+u8Rw==;\n\t5:knirlL73j+EKBIe5sfcTnoijCkjfgf8vT4X08adqX8lZ6lpKrno3qElFW+Ixu3FjuucE9d7D7YwUBtmQBVGQCndAzcHr938Qp/tRXIXUSudjJlcuWj/njOC1nqCScft3chKHT9Brt8dzNE3AKWFJlA==;\n\t24:4L58UXbb5BF6cGqB28Ej/kkYA3ObMP3Luhi4q361hMbO56xAbqFSiJEcL36LYWS4ux2st3dC/uStcBlHS+hxZwGbLQUkhKQoqHghPKuk1GI=;\n\t7:W45cE9ReU5oMz4selL/ao3yw10FFishAJ/SewKqA71L2/UIQGWowdO4xpzZzptqYnnAj5ReIL65/EuPqdwBwQ4POYLmd27eWz63EXXJBQU1Q78AYXIa3fXHC8A7hhGH+eMDRMhH0dghlF7QBfyc9U2E8z5UiDVt5T1RiOO5CbPoh3RMVdwe6DZdX8reZmJej/Txma/o33tf4uFcBlZIyTKhQ9poKQNwJDq8wWWZDDsI="],"MIME-Version":"1.0","Content-Type":"text/plain","X-MS-PublicTrafficType":"Email","X-MS-Office365-Filtering-Correlation-Id":"5788c450-3d74-4279-d667-08d504734f61","X-Microsoft-Antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075);\n\tSRVR:CY4PR02MB2696; ","X-MS-TrafficTypeDiagnostic":"CY4PR02MB2696:","X-Exchange-Antispam-Report-Test":"UriScan:(788757137089)(192813158149592);","X-Microsoft-Antispam-PRVS":"<CY4PR02MB269688FF842C1A6975FEC98EDC7B0@CY4PR02MB2696.namprd02.prod.outlook.com>","X-Exchange-Antispam-Report-CFA-Test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93004095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:CY4PR02MB2696; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:CY4PR02MB2696; ","X-Forefront-PRVS":"0442E569BC","SpamDiagnosticOutput":"1:99","SpamDiagnosticMetadata":"NSPM","X-OriginatorOrg":"xilinx.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"26 Sep 2017 00:12:43.7355\n\t(UTC)","X-MS-Exchange-CrossTenant-Id":"657af505-d5df-48d0-8300-c31994686c5c","X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp":"TenantId=657af505-d5df-48d0-8300-c31994686c5c; \n\tIp=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02]","X-MS-Exchange-CrossTenant-FromEntityHeader":"HybridOnPrem","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"CY4PR02MB2696","X-detected-operating-system":"by eggs.gnu.org: Windows 7 or 8 [fuzzy]","X-Received-From":"104.47.34.84","Subject":"[Qemu-devel] [PATCH v1 4/8] block: Replace fprintf(stderr,\n\t\"*\\n\" with error_report()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Alberto Garcia <berto@igalia.com>, qemu-block@nongnu.org,\n\t\"Richard W.M. Jones\" <rjones@redhat.com>,\n\tStefan Weil <sw@weilnetz.de>, Jeff Cody <jcody@redhat.com>,\n\tarmbru@redhat.com, alistair.francis@xilinx.com,\n\tStefan Hajnoczi <stefanha@redhat.com>, alistair23@gmail.com,\n\t\"Denis V. Lunev\" <den@openvz.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"Replace a large number of the fprintf(stderr, \"*\\n\" calls with\nerror_report(). The functions were renamed with these commands and then\ncompiler issues where manually fixed.\n\nfind ./* -type f -exec sed -i \\\n    'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, \"\\(.*\\)\\\\n\"\\(.*\\));|error_report(\"\\1\"\\2);|Ig}' \\\n    {} +\nfind ./* -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}' \\\n    {} +\nfind ./* -type f -exec sed -i \\\n    'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, \"\\(.*\\)\\\\n\"\\(.*\\));|error_report(\"\\1\"\\2);|Ig}' \\\n    {} +\nfind ./* -type f -exec sed -i \\\n    'N;N;N;N;N;N;N;N; {s|fprintf(stderr, \"\\(.*\\)\\\\n\"\\(.*\\));|error_report(\"\\1\"\\2);|Ig}' \\\n    {} +\nfind ./* -type f -exec sed -i \\\n    'N;N;N;N;N;N;N; {s|fprintf(stderr, \"\\(.*\\)\\\\n\"\\(.*\\));|error_report(\"\\1\"\\2);|Ig}' \\\n    {} +\nfind ./* -type f -exec sed -i \\\n    'N;N;N;N;N;N; {s|fprintf(stderr, \"\\(.*\\)\\\\n\"\\(.*\\));|error_report(\"\\1\"\\2);|Ig}' \\\n    {} +\nfind ./* -type f -exec sed -i \\\n    'N;N;N;N;N; {s|fprintf(stderr, \"\\(.*\\)\\\\n\"\\(.*\\));|error_report(\"\\1\"\\2);|Ig}' \\\n    {} +\nfind ./* -type f -exec sed -i \\\n    'N;N;N;N; {s|fprintf(stderr, \"\\(.*\\)\\\\n\"\\(.*\\));|error_report(\"\\1\"\\2);|Ig}' \\\n    {} +\nfind ./* -type f -exec sed -i \\\n    'N;N;N; {s|fprintf(stderr, \"\\(.*\\)\\\\n\"\\(.*\\));|error_report(\"\\1\"\\2);|Ig}' \\\n    {} +\nfind ./* -type f -exec sed -i \\\n    'N;N; {s|fprintf(stderr, \"\\(.*\\)\\\\n\"\\(.*\\));|error_report(\"\\1\"\\2);|Ig}' \\\n    {} +\nfind ./* -type f -exec sed -i \\\n    'N; {s|fprintf(stderr, \"\\(.*\\)\\\\n\"\\(.*\\));|error_report(\"\\1\"\\2);|Ig}' \\\n    {} +\n\nSigned-off-by: Alistair Francis <alistair.francis@xilinx.com>\nCc: Stefan Weil <sw@weilnetz.de>\nCc: Stefan Hajnoczi <stefanha@redhat.com>\nCc: \"Denis V. Lunev\" <den@openvz.org>\nCc: Alberto Garcia <berto@igalia.com>\nCc: \"Richard W.M. Jones\" <rjones@redhat.com>\nCc: Jeff Cody <jcody@redhat.com>\nCc: qemu-block@nongnu.org\n---\n\n block/file-posix.c     |  6 +--\n block/file-win32.c     |  3 +-\n block/linux-aio.c      |  5 ++-\n block/parallels.c      |  7 ++--\n block/qcow2-cluster.c  |  2 +-\n block/qcow2-refcount.c | 95 ++++++++++++++++++++++++------------------------\n block/qcow2.c          |  8 ++--\n block/quorum.c         |  5 ++-\n block/ssh.c            |  4 +-\n block/vdi.c            | 14 ++++---\n block/vpc.c            |  5 ++-\n block/vvfat.c          | 99 ++++++++++++++++++++++++++++----------------------\n 12 files changed, 136 insertions(+), 117 deletions(-)","diff":"diff --git a/block/file-posix.c b/block/file-posix.c\nindex ab12a2b591..2ea7a689cd 100644\n--- a/block/file-posix.c\n+++ b/block/file-posix.c\n@@ -198,7 +198,7 @@ static int raw_normalize_devicepath(const char **filename)\n     fname = *filename;\n     dp = strrchr(fname, '/');\n     if (lstat(fname, &sb) < 0) {\n-        fprintf(stderr, \"%s: stat failed: %s\\n\",\n+        error_report(\"%s: stat failed: %s\",\n             fname, strerror(errno));\n         return -errno;\n     }\n@@ -215,7 +215,7 @@ static int raw_normalize_devicepath(const char **filename)\n     }\n     fprintf(stderr, \"%s is a block device\", fname);\n     *filename = namebuf;\n-    fprintf(stderr, \", using %s\\n\", *filename);\n+    error_report(\", using %s\", *filename);\n \n     return 0;\n }\n@@ -1499,7 +1499,7 @@ static int aio_worker(void *arg)\n         ret = handle_aiocb_write_zeroes(aiocb);\n         break;\n     default:\n-        fprintf(stderr, \"invalid aio request (0x%x)\\n\", aiocb->aio_type);\n+        error_report(\"invalid aio request (0x%x)\", aiocb->aio_type);\n         ret = -EINVAL;\n         break;\n     }\ndiff --git a/block/file-win32.c b/block/file-win32.c\nindex 9e02214a69..a2ed9d2e55 100644\n--- a/block/file-win32.c\n+++ b/block/file-win32.c\n@@ -22,6 +22,7 @@\n  * THE SOFTWARE.\n  */\n #include \"qemu/osdep.h\"\n+#include \"qemu/error-report.h\"\n #include \"qapi/error.h\"\n #include \"qemu/cutils.h\"\n #include \"block/block_int.h\"\n@@ -131,7 +132,7 @@ static int aio_worker(void *arg)\n         }\n         break;\n     default:\n-        fprintf(stderr, \"invalid aio request (0x%x)\\n\", aiocb->aio_type);\n+        error_report(\"invalid aio request (0x%x)\", aiocb->aio_type);\n         ret = -EINVAL;\n         break;\n     }\ndiff --git a/block/linux-aio.c b/block/linux-aio.c\nindex 88b8d55ec7..435c2ae47e 100644\n--- a/block/linux-aio.c\n+++ b/block/linux-aio.c\n@@ -8,6 +8,7 @@\n  * See the COPYING file in the top-level directory.\n  */\n #include \"qemu/osdep.h\"\n+#include \"qemu/error-report.h\"\n #include \"qemu-common.h\"\n #include \"block/aio.h\"\n #include \"qemu/queue.h\"\n@@ -389,7 +390,7 @@ static int laio_do_submit(int fd, struct qemu_laiocb *laiocb, off_t offset,\n \tbreak;\n     /* Currently Linux kernel does not support other operations */\n     default:\n-        fprintf(stderr, \"%s: invalid AIO request type 0x%x.\\n\",\n+        error_report(\"%s: invalid AIO request type 0x%x.\",\n                         __func__, type);\n         return -EIO;\n     }\n@@ -499,7 +500,7 @@ void laio_cleanup(LinuxAioState *s)\n     event_notifier_cleanup(&s->e);\n \n     if (io_destroy(s->ctx) != 0) {\n-        fprintf(stderr, \"%s: destroy AIO context %p failed\\n\",\n+        error_report(\"%s: destroy AIO context %p failed\",\n                         __func__, &s->ctx);\n     }\n     g_free(s);\ndiff --git a/block/parallels.c b/block/parallels.c\nindex 2b6c6e5709..30056f943a 100644\n--- a/block/parallels.c\n+++ b/block/parallels.c\n@@ -28,6 +28,7 @@\n  * THE SOFTWARE.\n  */\n #include \"qemu/osdep.h\"\n+#include \"qemu/error-report.h\"\n #include \"qapi/error.h\"\n #include \"qemu-common.h\"\n #include \"block/block_int.h\"\n@@ -397,7 +398,7 @@ static int parallels_check(BlockDriverState *bs, BdrvCheckResult *res,\n     }\n \n     if (s->header_unclean) {\n-        fprintf(stderr, \"%s image was not closed correctly\\n\",\n+        error_report(\"%s image was not closed correctly\",\n                 fix & BDRV_FIX_ERRORS ? \"Repairing\" : \"ERROR\");\n         res->corruptions++;\n         if (fix & BDRV_FIX_ERRORS) {\n@@ -421,7 +422,7 @@ static int parallels_check(BlockDriverState *bs, BdrvCheckResult *res,\n \n         /* cluster outside the image */\n         if (off > size) {\n-            fprintf(stderr, \"%s cluster %u is outside image\\n\",\n+            error_report(\"%s cluster %u is outside image\",\n                     fix & BDRV_FIX_ERRORS ? \"Repairing\" : \"ERROR\", i);\n             res->corruptions++;\n             if (fix & BDRV_FIX_ERRORS) {\n@@ -456,7 +457,7 @@ static int parallels_check(BlockDriverState *bs, BdrvCheckResult *res,\n     if (size > res->image_end_offset) {\n         int64_t count;\n         count = DIV_ROUND_UP(size - res->image_end_offset, cluster_size);\n-        fprintf(stderr, \"%s space leaked at the end of the image %\" PRId64 \"\\n\",\n+        error_report(\"%s space leaked at the end of the image %\" PRId64 \"\",\n                 fix & BDRV_FIX_LEAKS ? \"Repairing\" : \"ERROR\",\n                 size - res->image_end_offset);\n         res->leaks += count;\ndiff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c\nindex 0d4824993c..894f57b4f9 100644\n--- a/block/qcow2-cluster.c\n+++ b/block/qcow2-cluster.c\n@@ -71,7 +71,7 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,\n     }\n \n #ifdef DEBUG_ALLOC2\n-    fprintf(stderr, \"grow l1_table from %d to %\" PRId64 \"\\n\",\n+    error_report(\"grow l1_table from %d to %\" PRId64 \"\",\n             s->l1_size, new_l1_size);\n #endif\n \ndiff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c\nindex 168fc32e7b..2a8d1210c8 100644\n--- a/block/qcow2-refcount.c\n+++ b/block/qcow2-refcount.c\n@@ -23,6 +23,7 @@\n  */\n \n #include \"qemu/osdep.h\"\n+#include \"qemu/error-report.h\"\n #include \"qapi/error.h\"\n #include \"qemu-common.h\"\n #include \"block/block_int.h\"\n@@ -367,8 +368,8 @@ static int alloc_refcount_block(BlockDriverState *bs,\n     }\n \n #ifdef DEBUG_ALLOC2\n-    fprintf(stderr, \"qcow2: Allocate refcount block %d for %\" PRIx64\n-        \" at %\" PRIx64 \"\\n\",\n+    error_report(\"qcow2: Allocate refcount block %d for %\" PRIx64\n+        \" at %\" PRIx64 \"\",\n         refcount_table_index, cluster_index << s->cluster_bits, new_block);\n #endif\n \n@@ -800,8 +801,8 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,\n     int ret;\n \n #ifdef DEBUG_ALLOC2\n-    fprintf(stderr, \"update_refcount: offset=%\" PRId64 \" size=%\" PRId64\n-            \" addend=%s%\" PRIu64 \"\\n\", offset, length, decrease ? \"-\" : \"\",\n+    error_report(\"update_refcount: offset=%\" PRId64 \" size=%\" PRId64\n+            \" addend=%s%\" PRIu64 \"\", offset, length, decrease ? \"-\" : \"\",\n             addend);\n #endif\n     if (length < 0) {\n@@ -957,7 +958,7 @@ retry:\n     }\n \n #ifdef DEBUG_ALLOC2\n-    fprintf(stderr, \"alloc_clusters: size=%\" PRId64 \" -> %\" PRId64 \"\\n\",\n+    error_report(\"alloc_clusters: size=%\" PRId64 \" -> %\" PRId64 \"\",\n             size,\n             (s->free_cluster_index - nb_clusters) << s->cluster_bits);\n #endif\n@@ -1097,7 +1098,7 @@ void qcow2_free_clusters(BlockDriverState *bs,\n     BLKDBG_EVENT(bs->file, BLKDBG_CLUSTER_FREE);\n     ret = update_refcount(bs, offset, size, 1, true, type);\n     if (ret < 0) {\n-        fprintf(stderr, \"qcow2_free_clusters failed: %s\\n\", strerror(-ret));\n+        error_report(\"qcow2_free_clusters failed: %s\", strerror(-ret));\n         /* TODO Remember the clusters to free them later and avoid leaking */\n     }\n }\n@@ -1447,11 +1448,11 @@ int qcow2_inc_refcounts_imrt(BlockDriverState *bs, BdrvCheckResult *res,\n \n         refcount = s->get_refcount(*refcount_table, k);\n         if (refcount == s->refcount_max) {\n-            fprintf(stderr, \"ERROR: overflow cluster offset=0x%\" PRIx64\n-                    \"\\n\", cluster_offset);\n-            fprintf(stderr, \"Use qemu-img amend to increase the refcount entry \"\n+            error_report(\"ERROR: overflow cluster offset=0x%\" PRIx64\n+                    \"\", cluster_offset);\n+            error_report(\"Use qemu-img amend to increase the refcount entry \"\n                     \"width or qemu-img convert to create a clean copy if the \"\n-                    \"image cannot be opened for writing\\n\");\n+                    \"image cannot be opened for writing\");\n             res->corruptions++;\n             continue;\n         }\n@@ -1490,7 +1491,7 @@ static int check_refcounts_l2(BlockDriverState *bs, BdrvCheckResult *res,\n \n     ret = bdrv_pread(bs->file, l2_offset, l2_table, l2_size);\n     if (ret < 0) {\n-        fprintf(stderr, \"ERROR: I/O error in check_refcounts_l2\\n\");\n+        error_report(\"ERROR: I/O error in check_refcounts_l2\");\n         res->check_errors++;\n         goto fail;\n     }\n@@ -1503,9 +1504,9 @@ static int check_refcounts_l2(BlockDriverState *bs, BdrvCheckResult *res,\n         case QCOW2_CLUSTER_COMPRESSED:\n             /* Compressed clusters don't have QCOW_OFLAG_COPIED */\n             if (l2_entry & QCOW_OFLAG_COPIED) {\n-                fprintf(stderr, \"ERROR: cluster %\" PRId64 \": \"\n+                error_report(\"ERROR: cluster %\" PRId64 \": \"\n                     \"copied flag must never be set for compressed \"\n-                    \"clusters\\n\", l2_entry >> s->cluster_bits);\n+                    \"clusters\", l2_entry >> s->cluster_bits);\n                 l2_entry &= ~QCOW_OFLAG_COPIED;\n                 res->corruptions++;\n             }\n@@ -1558,8 +1559,8 @@ static int check_refcounts_l2(BlockDriverState *bs, BdrvCheckResult *res,\n \n             /* Correct offsets are cluster aligned */\n             if (offset_into_cluster(s, offset)) {\n-                fprintf(stderr, \"ERROR offset=%\" PRIx64 \": Cluster is not \"\n-                    \"properly aligned; L2 entry corrupted.\\n\", offset);\n+                error_report(\"ERROR offset=%\" PRIx64 \": Cluster is not \"\n+                    \"properly aligned; L2 entry corrupted.\", offset);\n                 res->corruptions++;\n             }\n             break;\n@@ -1620,7 +1621,7 @@ static int check_refcounts_l1(BlockDriverState *bs,\n         }\n         ret = bdrv_pread(bs->file, l1_table_offset, l1_table, l1_size2);\n         if (ret < 0) {\n-            fprintf(stderr, \"ERROR: I/O error in check_refcounts_l1\\n\");\n+            error_report(\"ERROR: I/O error in check_refcounts_l1\");\n             res->check_errors++;\n             goto fail;\n         }\n@@ -1643,8 +1644,8 @@ static int check_refcounts_l1(BlockDriverState *bs,\n \n             /* L2 tables are cluster aligned */\n             if (offset_into_cluster(s, l2_offset)) {\n-                fprintf(stderr, \"ERROR l2_offset=%\" PRIx64 \": Table is not \"\n-                    \"cluster aligned; L1 entry corrupted\\n\", l2_offset);\n+                error_report(\"ERROR l2_offset=%\" PRIx64 \": Table is not \"\n+                    \"cluster aligned; L1 entry corrupted\", l2_offset);\n                 res->corruptions++;\n             }\n \n@@ -1697,8 +1698,8 @@ static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res,\n             continue;\n         }\n         if ((refcount == 1) != ((l1_entry & QCOW_OFLAG_COPIED) != 0)) {\n-            fprintf(stderr, \"%s OFLAG_COPIED L2 cluster: l1_index=%d \"\n-                    \"l1_entry=%\" PRIx64 \" refcount=%\" PRIu64 \"\\n\",\n+            error_report(\"%s OFLAG_COPIED L2 cluster: l1_index=%d \"\n+                    \"l1_entry=%\" PRIx64 \" refcount=%\" PRIu64 \"\",\n                     fix & BDRV_FIX_ERRORS ? \"Repairing\" :\n                                             \"ERROR\",\n                     i, l1_entry, refcount);\n@@ -1720,7 +1721,7 @@ static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res,\n         ret = bdrv_pread(bs->file, l2_offset, l2_table,\n                          s->l2_size * sizeof(uint64_t));\n         if (ret < 0) {\n-            fprintf(stderr, \"ERROR: Could not read L2 table: %s\\n\",\n+            error_report(\"ERROR: Could not read L2 table: %s\",\n                     strerror(-ret));\n             res->check_errors++;\n             goto fail;\n@@ -1741,8 +1742,8 @@ static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res,\n                     continue;\n                 }\n                 if ((refcount == 1) != ((l2_entry & QCOW_OFLAG_COPIED) != 0)) {\n-                    fprintf(stderr, \"%s OFLAG_COPIED data cluster: \"\n-                            \"l2_entry=%\" PRIx64 \" refcount=%\" PRIu64 \"\\n\",\n+                    error_report(\"%s OFLAG_COPIED data cluster: \"\n+                            \"l2_entry=%\" PRIx64 \" refcount=%\" PRIu64 \"\",\n                             fix & BDRV_FIX_ERRORS ? \"Repairing\" :\n                                                     \"ERROR\",\n                             l2_entry, refcount);\n@@ -1763,8 +1764,8 @@ static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res,\n             ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_ACTIVE_L2,\n                                                 l2_offset, s->cluster_size);\n             if (ret < 0) {\n-                fprintf(stderr, \"ERROR: Could not write L2 table; metadata \"\n-                        \"overlap check failed: %s\\n\", strerror(-ret));\n+                error_report(\"ERROR: Could not write L2 table; metadata \"\n+                        \"overlap check failed: %s\", strerror(-ret));\n                 res->check_errors++;\n                 goto fail;\n             }\n@@ -1772,7 +1773,7 @@ static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res,\n             ret = bdrv_pwrite(bs->file, l2_offset, l2_table,\n                               s->cluster_size);\n             if (ret < 0) {\n-                fprintf(stderr, \"ERROR: Could not write L2 table: %s\\n\",\n+                error_report(\"ERROR: Could not write L2 table: %s\",\n                         strerror(-ret));\n                 res->check_errors++;\n                 goto fail;\n@@ -1806,15 +1807,15 @@ static int check_refblocks(BlockDriverState *bs, BdrvCheckResult *res,\n \n         /* Refcount blocks are cluster aligned */\n         if (offset_into_cluster(s, offset)) {\n-            fprintf(stderr, \"ERROR refcount block %\" PRId64 \" is not \"\n-                \"cluster aligned; refcount table entry corrupted\\n\", i);\n+            error_report(\"ERROR refcount block %\" PRId64 \" is not \"\n+                \"cluster aligned; refcount table entry corrupted\", i);\n             res->corruptions++;\n             *rebuild = true;\n             continue;\n         }\n \n         if (cluster >= *nb_clusters) {\n-            fprintf(stderr, \"%s refcount block %\" PRId64 \" is outside image\\n\",\n+            error_report(\"%s refcount block %\" PRId64 \" is outside image\",\n                     fix & BDRV_FIX_ERRORS ? \"Repairing\" : \"ERROR\", i);\n \n             if (fix & BDRV_FIX_ERRORS) {\n@@ -1868,7 +1869,7 @@ static int check_refblocks(BlockDriverState *bs, BdrvCheckResult *res,\n resize_fail:\n                 res->corruptions++;\n                 *rebuild = true;\n-                fprintf(stderr, \"ERROR could not resize image: %s\\n\",\n+                error_report(\"ERROR could not resize image: %s\",\n                         strerror(-ret));\n             } else {\n                 res->corruptions++;\n@@ -1883,8 +1884,8 @@ resize_fail:\n                 return ret;\n             }\n             if (s->get_refcount(*refcount_table, cluster) != 1) {\n-                fprintf(stderr, \"ERROR refcount block %\" PRId64\n-                        \" refcount=%\" PRIu64 \"\\n\", i,\n+                error_report(\"ERROR refcount block %\" PRId64\n+                        \" refcount=%\" PRIu64 \"\", i,\n                         s->get_refcount(*refcount_table, cluster));\n                 res->corruptions++;\n                 *rebuild = true;\n@@ -1990,7 +1991,7 @@ static void compare_refcounts(BlockDriverState *bs, BdrvCheckResult *res,\n     for (i = 0, *highest_cluster = 0; i < nb_clusters; i++) {\n         ret = qcow2_get_refcount(bs, i, &refcount1);\n         if (ret < 0) {\n-            fprintf(stderr, \"Can't get refcount for cluster %\" PRId64 \": %s\\n\",\n+            error_report(\"Can't get refcount for cluster %\" PRId64 \": %s\",\n                     i, strerror(-ret));\n             res->check_errors++;\n             continue;\n@@ -2013,8 +2014,8 @@ static void compare_refcounts(BlockDriverState *bs, BdrvCheckResult *res,\n                 num_fixed = &res->corruptions_fixed;\n             }\n \n-            fprintf(stderr, \"%s cluster %\" PRId64 \" refcount=%\" PRIu64\n-                    \" reference=%\" PRIu64 \"\\n\",\n+            error_report(\"%s cluster %\" PRId64 \" refcount=%\" PRIu64\n+                    \" reference=%\" PRIu64 \"\",\n                    num_fixed != NULL     ? \"Repairing\" :\n                    refcount1 < refcount2 ? \"ERROR\" :\n                                            \"Leaked\",\n@@ -2159,7 +2160,7 @@ write_refblocks:\n         refblock_offset = alloc_clusters_imrt(bs, 1, refcount_table,\n                                               nb_clusters, &first_free_cluster);\n         if (refblock_offset < 0) {\n-            fprintf(stderr, \"ERROR allocating refblock: %s\\n\",\n+            error_report(\"ERROR allocating refblock: %s\",\n                     strerror(-refblock_offset));\n             res->check_errors++;\n             ret = refblock_offset;\n@@ -2205,7 +2206,7 @@ write_refblocks:\n                                                   refcount_table, nb_clusters,\n                                                   &first_free_cluster);\n             if (reftable_offset < 0) {\n-                fprintf(stderr, \"ERROR allocating reftable: %s\\n\",\n+                error_report(\"ERROR allocating reftable: %s\",\n                         strerror(-reftable_offset));\n                 res->check_errors++;\n                 ret = reftable_offset;\n@@ -2216,7 +2217,7 @@ write_refblocks:\n         ret = qcow2_pre_write_overlap_check(bs, 0, refblock_offset,\n                                             s->cluster_size);\n         if (ret < 0) {\n-            fprintf(stderr, \"ERROR writing refblock: %s\\n\", strerror(-ret));\n+            error_report(\"ERROR writing refblock: %s\", strerror(-ret));\n             goto fail;\n         }\n \n@@ -2228,7 +2229,7 @@ write_refblocks:\n         ret = bdrv_write(bs->file, refblock_offset / BDRV_SECTOR_SIZE,\n                          on_disk_refblock, s->cluster_sectors);\n         if (ret < 0) {\n-            fprintf(stderr, \"ERROR writing refblock: %s\\n\", strerror(-ret));\n+            error_report(\"ERROR writing refblock: %s\", strerror(-ret));\n             goto fail;\n         }\n \n@@ -2250,7 +2251,7 @@ write_refblocks:\n                                               refcount_table, nb_clusters,\n                                               &first_free_cluster);\n         if (reftable_offset < 0) {\n-            fprintf(stderr, \"ERROR allocating reftable: %s\\n\",\n+            error_report(\"ERROR allocating reftable: %s\",\n                     strerror(-reftable_offset));\n             res->check_errors++;\n             ret = reftable_offset;\n@@ -2267,7 +2268,7 @@ write_refblocks:\n     ret = qcow2_pre_write_overlap_check(bs, 0, reftable_offset,\n                                         reftable_size * sizeof(uint64_t));\n     if (ret < 0) {\n-        fprintf(stderr, \"ERROR writing reftable: %s\\n\", strerror(-ret));\n+        error_report(\"ERROR writing reftable: %s\", strerror(-ret));\n         goto fail;\n     }\n \n@@ -2275,7 +2276,7 @@ write_refblocks:\n     ret = bdrv_pwrite(bs->file, reftable_offset, on_disk_reftable,\n                       reftable_size * sizeof(uint64_t));\n     if (ret < 0) {\n-        fprintf(stderr, \"ERROR writing reftable: %s\\n\", strerror(-ret));\n+        error_report(\"ERROR writing reftable: %s\", strerror(-ret));\n         goto fail;\n     }\n \n@@ -2288,7 +2289,7 @@ write_refblocks:\n                            &reftable_offset_and_clusters,\n                            sizeof(reftable_offset_and_clusters));\n     if (ret < 0) {\n-        fprintf(stderr, \"ERROR setting reftable: %s\\n\", strerror(-ret));\n+        error_report(\"ERROR setting reftable: %s\", strerror(-ret));\n         goto fail;\n     }\n \n@@ -2355,7 +2356,7 @@ int qcow2_check_refcounts(BlockDriverState *bs, BdrvCheckResult *res,\n         BdrvCheckResult old_res = *res;\n         int fresh_leaks = 0;\n \n-        fprintf(stderr, \"Rebuilding refcount structure\\n\");\n+        error_report(\"Rebuilding refcount structure\");\n         ret = rebuild_refcount_structure(bs, res, &refcount_table,\n                                          &nb_clusters);\n         if (ret < 0) {\n@@ -2385,8 +2386,8 @@ int qcow2_check_refcounts(BlockDriverState *bs, BdrvCheckResult *res,\n             compare_refcounts(bs, res, BDRV_FIX_LEAKS, &rebuild,\n                               &highest_cluster, refcount_table, nb_clusters);\n             if (rebuild) {\n-                fprintf(stderr, \"ERROR rebuilt refcount structure is still \"\n-                        \"broken\\n\");\n+                error_report(\"ERROR rebuilt refcount structure is still \"\n+                        \"broken\");\n             }\n \n             /* Any leaks accounted for here were introduced by\n@@ -2405,7 +2406,7 @@ int qcow2_check_refcounts(BlockDriverState *bs, BdrvCheckResult *res,\n         res->leaks += fresh_leaks;\n     } else if (fix) {\n         if (rebuild) {\n-            fprintf(stderr, \"ERROR need to rebuild refcount structures\\n\");\n+            error_report(\"ERROR need to rebuild refcount structures\");\n             res->check_errors++;\n             ret = -EIO;\n             goto fail;\ndiff --git a/block/qcow2.c b/block/qcow2.c\nindex d33fb3ecdd..06a131d287 100644\n--- a/block/qcow2.c\n+++ b/block/qcow2.c\n@@ -4162,11 +4162,11 @@ void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t offset,\n     va_end(ap);\n \n     if (fatal) {\n-        fprintf(stderr, \"qcow2: Marking image as corrupt: %s; further \"\n-                \"corruption events will be suppressed\\n\", message);\n+        error_report(\"qcow2: Marking image as corrupt: %s; further \"\n+                \"corruption events will be suppressed\", message);\n     } else {\n-        fprintf(stderr, \"qcow2: Image is corrupt: %s; further non-fatal \"\n-                \"corruption events will be suppressed\\n\", message);\n+        error_report(\"qcow2: Image is corrupt: %s; further non-fatal \"\n+                \"corruption events will be suppressed\", message);\n     }\n \n     node_name = bdrv_get_node_name(bs);\ndiff --git a/block/quorum.c b/block/quorum.c\nindex 272f9a5b77..a55f1fe6a0 100644\n--- a/block/quorum.c\n+++ b/block/quorum.c\n@@ -14,6 +14,7 @@\n  */\n \n #include \"qemu/osdep.h\"\n+#include \"qemu/error-report.h\"\n #include \"qemu/cutils.h\"\n #include \"block/block_int.h\"\n #include \"qapi/qmp/qbool.h\"\n@@ -927,8 +928,8 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,\n             s->num_children == 2 && s->threshold == 2) {\n             s->is_blkverify = true;\n         } else if (qemu_opt_get_bool(opts, QUORUM_OPT_BLKVERIFY, false)) {\n-            fprintf(stderr, \"blkverify mode is set by setting blkverify=on \"\n-                    \"and using two files with vote_threshold=2\\n\");\n+            error_report(\"blkverify mode is set by setting blkverify=on \"\n+                    \"and using two files with vote_threshold=2\");\n         }\n \n         s->rewrite_corrupted = qemu_opt_get_bool(opts, QUORUM_OPT_REWRITE,\ndiff --git a/block/ssh.c b/block/ssh.c\nindex b049a16eb9..903b797a55 100644\n--- a/block/ssh.c\n+++ b/block/ssh.c\n@@ -53,7 +53,7 @@\n #define DPRINTF(fmt, ...)                           \\\n     do {                                            \\\n         if (DEBUG_SSH) {                            \\\n-            fprintf(stderr, \"ssh: %-15s \" fmt \"\\n\", \\\n+            error_report(\"ssh: %-15s \" fmt \"\", \\\n                     __func__, ##__VA_ARGS__);       \\\n         }                                           \\\n     } while (0)\n@@ -1217,7 +1217,7 @@ static void bdrv_ssh_init(void)\n \n     r = libssh2_init(0);\n     if (r != 0) {\n-        fprintf(stderr, \"libssh2 initialization failed, %d\\n\", r);\n+        error_report(\"libssh2 initialization failed, %d\", r);\n         exit(EXIT_FAILURE);\n     }\n \ndiff --git a/block/vdi.c b/block/vdi.c\nindex 8da5dfc897..0d9440d36e 100644\n--- a/block/vdi.c\n+++ b/block/vdi.c\n@@ -50,6 +50,7 @@\n  */\n \n #include \"qemu/osdep.h\"\n+#include \"qemu/error-report.h\"\n #include \"qapi/error.h\"\n #include \"block/block_int.h\"\n #include \"sysemu/block-backend.h\"\n@@ -289,20 +290,21 @@ static int vdi_check(BlockDriverState *bs, BdrvCheckResult *res,\n                 if (!VDI_IS_ALLOCATED(bmap[bmap_entry])) {\n                     bmap[bmap_entry] = bmap_entry;\n                 } else {\n-                    fprintf(stderr, \"ERROR: block index %\" PRIu32\n-                            \" also used by %\" PRIu32 \"\\n\", bmap[bmap_entry], bmap_entry);\n+                    error_report(\"block index %\" PRIu32\n+                                 \" also used by %\" PRIu32 \"\",\n+                                 bmap[bmap_entry], bmap_entry);\n                     res->corruptions++;\n                 }\n             } else {\n-                fprintf(stderr, \"ERROR: block index %\" PRIu32\n-                        \" too large, is %\" PRIu32 \"\\n\", block, bmap_entry);\n+                error_report(\"block index %\" PRIu32\n+                             \" too large, is %\" PRIu32 \"\", block, bmap_entry);\n                 res->corruptions++;\n             }\n         }\n     }\n     if (blocks_allocated != s->header.blocks_allocated) {\n-        fprintf(stderr, \"ERROR: allocated blocks mismatch, is %\" PRIu32\n-               \", should be %\" PRIu32 \"\\n\",\n+        error_report(\"allocated blocks mismatch, is %\" PRIu32\n+                     \", should be %\" PRIu32 \"\",\n                blocks_allocated, s->header.blocks_allocated);\n         res->corruptions++;\n     }\ndiff --git a/block/vpc.c b/block/vpc.c\nindex 1576d7b595..f033bde29e 100644\n--- a/block/vpc.c\n+++ b/block/vpc.c\n@@ -23,6 +23,7 @@\n  * THE SOFTWARE.\n  */\n #include \"qemu/osdep.h\"\n+#include \"qemu/error-report.h\"\n #include \"qapi/error.h\"\n #include \"qemu-common.h\"\n #include \"block/block_int.h\"\n@@ -278,8 +279,8 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,\n     checksum = be32_to_cpu(footer->checksum);\n     footer->checksum = 0;\n     if (vpc_checksum(s->footer_buf, HEADER_SIZE) != checksum)\n-        fprintf(stderr, \"block-vpc: The header checksum of '%s' is \"\n-            \"incorrect.\\n\", bs->filename);\n+        error_report(\"block-vpc: The header checksum of '%s' is \"\n+            \"incorrect.\", bs->filename);\n \n     /* Write 'checksum' back to footer, or else will leave it with zero. */\n     footer->checksum = cpu_to_be32(checksum);\ndiff --git a/block/vvfat.c b/block/vvfat.c\nindex cbabb36f62..e339e1f97e 100644\n--- a/block/vvfat.c\n+++ b/block/vvfat.c\n@@ -59,7 +59,7 @@ static void checkpoint(void);\n \n #ifdef __MINGW32__\n void nonono(const char* file, int line, const char* msg) {\n-    fprintf(stderr, \"Nonono! %s:%d %s\\n\", file, line, msg);\n+    error_report(\"Nonono! %s:%d %s\", file, line, msg);\n     exit(-5);\n }\n #undef assert\n@@ -446,7 +446,7 @@ static direntry_t *create_long_filename(BDRVVVFATState *s, const char *filename)\n \n     gunichar2 *longname = g_utf8_to_utf16(filename, -1, NULL, &length, NULL);\n     if (!longname) {\n-        fprintf(stderr, \"vvfat: invalid UTF-8 name: %s\\n\", filename);\n+        error_report(\"vvfat: invalid UTF-8 name: %s\", filename);\n         return NULL;\n     }\n \n@@ -803,7 +803,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)\n         int is_dotdot=!strcmp(entry->d_name,\"..\");\n \n         if (first_cluster == 0 && s->directory.next >= s->root_entries - 1) {\n-            fprintf(stderr, \"Too many entries in root directory\\n\");\n+            error_report(\"Too many entries in root directory\");\n             closedir(dir);\n             return -2;\n         }\n@@ -840,7 +840,7 @@ static int read_directory(BDRVVVFATState* s, int mapping_index)\n         else\n             direntry->begin=0; /* do that later */\n         if (st.st_size > 0x7fffffff) {\n-            fprintf(stderr, \"File %s is larger than 2GB\\n\", buffer);\n+            error_report(\"File %s is larger than 2GB\", buffer);\n             g_free(buffer);\n             closedir(dir);\n             return -2;\n@@ -1251,8 +1251,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,\n     s->fat2 = NULL;\n     s->downcase_short_names = 1;\n \n-    fprintf(stderr, \"vvfat %s chs %d,%d,%d\\n\",\n-            dirname, cyls, heads, secs);\n+    error_report(\"vvfat %s chs %d,%d,%d\", dirname, cyls, heads, secs);\n \n     s->sector_count = cyls * heads * secs - s->offset_to_bootsector;\n \n@@ -1458,7 +1457,7 @@ static void print_direntry(const direntry_t* direntry)\n         for(i=28;i<32 && c[i] && c[i]!=0xff;i+=2)\n             ADD_CHAR(c[i]);\n         buffer[j] = 0;\n-        fprintf(stderr, \"%s\\n\", buffer);\n+        error_report(\"%s\", buffer);\n     } else {\n         int i;\n         for(i=0;i<11;i++)\n@@ -1479,9 +1478,11 @@ static void print_mapping(const mapping_t* mapping)\n         mapping->first_mapping_index, mapping->path, mapping->mode);\n \n     if (mapping->mode & MODE_DIRECTORY)\n-        fprintf(stderr, \"parent_mapping_index = %d, first_dir_index = %d\\n\", mapping->info.dir.parent_mapping_index, mapping->info.dir.first_dir_index);\n+        error_report(\"parent_mapping_index = %d, first_dir_index = %d\",\n+                     mapping->info.dir.parent_mapping_index,\n+                     mapping->info.dir.first_dir_index);\n     else\n-        fprintf(stderr, \"offset = %d\\n\", mapping->info.file.offset);\n+        error_report(\"offset = %d\", mapping->info.file.offset);\n }\n #endif\n \n@@ -1503,9 +1504,9 @@ static int vvfat_read(BlockDriverState *bs, int64_t sector_num,\n                 return ret;\n             }\n             if (ret) {\n-                DLOG(fprintf(stderr, \"sectors %\" PRId64 \"+%\" PRId64\n-                             \" allocated\\n\", sector_num,\n-                             n >> BDRV_SECTOR_BITS));\n+                DLOG(error_report(\"sectors %\" PRId64 \"+%\" PRId64\n+                                  \" allocated\", sector_num,\n+                                  n >> BDRV_SECTOR_BITS));\n                 if (bdrv_read(s->qcow, sector_num, buf + i * 0x200,\n                               n >> BDRV_SECTOR_BITS)) {\n                     return -1;\n@@ -1514,8 +1515,8 @@ static int vvfat_read(BlockDriverState *bs, int64_t sector_num,\n                 sector_num += (n >> BDRV_SECTOR_BITS) - 1;\n                 continue;\n             }\n-            DLOG(fprintf(stderr, \"sector %\" PRId64 \" not allocated\\n\",\n-                         sector_num));\n+            DLOG(error_report(\"sector %\" PRId64 \" not allocated\",\n+                              sector_num));\n         }\n         if (sector_num < s->offset_to_root_dir) {\n             if (sector_num < s->offset_to_fat) {\n@@ -1615,7 +1616,7 @@ typedef struct commit_t {\n static void clear_commits(BDRVVVFATState* s)\n {\n     int i;\n-DLOG(fprintf(stderr, \"clear_commits (%d commits)\\n\", s->commits.next));\n+DLOG(error_report(\"clear_commits (%d commits)\", s->commits.next));\n     for (i = 0; i < s->commits.next; i++) {\n         commit_t* commit = array_get(&(s->commits), i);\n         assert(commit->path || commit->action == ACTION_WRITEOUT);\n@@ -2065,16 +2066,17 @@ static int check_directory_consistency(BDRVVVFATState *s,\n         ret++;\n \n         if (s->used_clusters[cluster_num] & USED_ANY) {\n-            fprintf(stderr, \"cluster %d used more than once\\n\", (int)cluster_num);\n+            error_report(\"cluster %d used more than once\", (int)cluster_num);\n             goto fail;\n         }\n         s->used_clusters[cluster_num] = USED_DIRECTORY;\n \n-DLOG(fprintf(stderr, \"read cluster %d (sector %d)\\n\", (int)cluster_num, (int)cluster2sector(s, cluster_num)));\n+DLOG(error_report(\"read cluster %d (sector %d)\",\n+                  (int)cluster_num, (int)cluster2sector(s, cluster_num)));\n         subret = vvfat_read(s->bs, cluster2sector(s, cluster_num), cluster,\n                 s->sectors_per_cluster);\n         if (subret) {\n-            fprintf(stderr, \"Error fetching direntries\\n\");\n+            error_report(\"Error fetching direntries\");\n         fail:\n             g_free(cluster);\n             return 0;\n@@ -2083,14 +2085,14 @@ DLOG(fprintf(stderr, \"read cluster %d (sector %d)\\n\", (int)cluster_num, (int)clu\n         for (i = 0; i < 0x10 * s->sectors_per_cluster; i++) {\n             int cluster_count = 0;\n \n-DLOG(fprintf(stderr, \"check direntry %d:\\n\", i); print_direntry(direntries + i));\n+DLOG(error_report(\"check direntry %d:\", i); print_direntry(direntries + i));\n             if (is_volume_label(direntries + i) || is_dot(direntries + i) ||\n                     is_free(direntries + i))\n                 continue;\n \n             subret = parse_long_name(&lfn, direntries + i);\n             if (subret < 0) {\n-                fprintf(stderr, \"Error in long name\\n\");\n+                error_report(\"Error in long name\");\n                 goto fail;\n             }\n             if (subret == 0 || is_free(direntries + i))\n@@ -2099,7 +2101,7 @@ DLOG(fprintf(stderr, \"check direntry %d:\\n\", i); print_direntry(direntries + i))\n             if (fat_chksum(direntries+i) != lfn.checksum) {\n                 subret = parse_short_name(s, &lfn, direntries + i);\n                 if (subret < 0) {\n-                    fprintf(stderr, \"Error in short name (%d)\\n\", subret);\n+                    error_report(\"Error in short name (%d)\", subret);\n                     goto fail;\n                 }\n                 if (subret > 0 || !strcmp((char*)lfn.name, \".\")\n@@ -2109,7 +2111,7 @@ DLOG(fprintf(stderr, \"check direntry %d:\\n\", i); print_direntry(direntries + i))\n             lfn.checksum = 0x100; /* cannot use long name twice */\n \n             if (path_len + 1 + lfn.len >= PATH_MAX) {\n-                fprintf(stderr, \"Name too long: %s/%s\\n\", path, lfn.name);\n+                error_report(\"Name too long: %s/%s\", path, lfn.name);\n                 goto fail;\n             }\n             pstrcpy(path2 + path_len + 1, sizeof(path2) - path_len - 1,\n@@ -2117,13 +2119,15 @@ DLOG(fprintf(stderr, \"check direntry %d:\\n\", i); print_direntry(direntries + i))\n \n             if (is_directory(direntries + i)) {\n                 if (begin_of_direntry(direntries + i) == 0) {\n-                    DLOG(fprintf(stderr, \"invalid begin for directory: %s\\n\", path2); print_direntry(direntries + i));\n+                    DLOG(error_report(\"invalid begin for directory: %s\", path2);\n+                         print_direntry(direntries + i));\n                     goto fail;\n                 }\n                 cluster_count = check_directory_consistency(s,\n                         begin_of_direntry(direntries + i), path2);\n                 if (cluster_count == 0) {\n-                    DLOG(fprintf(stderr, \"problem in directory %s:\\n\", path2); print_direntry(direntries + i));\n+                    DLOG(error_report(\"problem in directory %s:\", path2);\n+                         print_direntry(direntries + i));\n                     goto fail;\n                 }\n             } else if (is_file(direntries + i)) {\n@@ -2131,7 +2135,7 @@ DLOG(fprintf(stderr, \"check direntry %d:\\n\", i); print_direntry(direntries + i))\n                 cluster_count = get_cluster_count_for_direntry(s, direntries + i, path2);\n                 if (cluster_count !=\n             DIV_ROUND_UP(le32_to_cpu(direntries[i].size), s->cluster_size)) {\n-                    DLOG(fprintf(stderr, \"Cluster count mismatch\\n\"));\n+                    DLOG(error_report(\"Cluster count mismatch\"));\n                     goto fail;\n                 }\n             } else\n@@ -2175,7 +2179,7 @@ DLOG(checkpoint());\n     check = vvfat_read(s->bs,\n             s->offset_to_fat, s->fat2, s->sectors_per_fat);\n     if (check) {\n-        fprintf(stderr, \"Could not copy fat\\n\");\n+        error_report(\"Could not copy fat\");\n         return 0;\n     }\n     assert (s->used_clusters);\n@@ -2195,7 +2199,7 @@ DLOG(checkpoint());\n \n     used_clusters_count = check_directory_consistency(s, 0, s->path);\n     if (used_clusters_count <= 0) {\n-        DLOG(fprintf(stderr, \"problem in directory\\n\"));\n+        DLOG(error_report(\"problem in directory\"));\n         return 0;\n     }\n \n@@ -2203,7 +2207,8 @@ DLOG(checkpoint());\n     for (i = check; i < sector2cluster(s, s->sector_count); i++) {\n         if (modified_fat_get(s, i)) {\n             if(!s->used_clusters[i]) {\n-                DLOG(fprintf(stderr, \"FAT was modified (%d), but cluster is not used?\\n\", i));\n+                DLOG(error_report(\"FAT was modified (%d), but cluster\"\n+                                  \" is not used?\", i));\n                 return 0;\n             }\n             check++;\n@@ -2211,7 +2216,7 @@ DLOG(checkpoint());\n \n         if (s->used_clusters[i] == USED_ALLOCATED) {\n             /* allocated, but not used... */\n-            DLOG(fprintf(stderr, \"unused, modified cluster: %d\\n\", i));\n+            DLOG(error_report(\"unused, modified cluster: %d\", i));\n             return 0;\n         }\n     }\n@@ -2438,7 +2443,8 @@ static int commit_direntries(BDRVVVFATState* s,\n     int ret, i;\n     uint32_t c;\n \n-DLOG(fprintf(stderr, \"commit_direntries for %s, parent_mapping_index %d\\n\", mapping->path, parent_mapping_index));\n+DLOG(error_report(\"commit_direntries for %s, parent_mapping_index %d\",\n+                  mapping->path, parent_mapping_index));\n \n     assert(direntry);\n     assert(mapping);\n@@ -2529,8 +2535,8 @@ static int commit_one_file(BDRVVVFATState* s,\n \n     fd = qemu_open(mapping->path, O_RDWR | O_CREAT | O_BINARY, 0666);\n     if (fd < 0) {\n-        fprintf(stderr, \"Could not open %s... (%s, %d)\\n\", mapping->path,\n-                strerror(errno), errno);\n+        error_report(\"Could not open %s... (%s, %d)\", mapping->path,\n+                     strerror(errno), errno);\n         g_free(cluster);\n         return fd;\n     }\n@@ -2592,7 +2598,7 @@ static void check1(BDRVVVFATState* s)\n     for (i = 0; i < s->mapping.next; i++) {\n         mapping_t* mapping = array_get(&(s->mapping), i);\n         if (mapping->mode & MODE_DELETED) {\n-            fprintf(stderr, \"deleted\\n\");\n+            error_report(\"deleted\");\n             continue;\n         }\n         assert(mapping->dir_index < s->directory.next);\n@@ -2658,10 +2664,12 @@ static int handle_renames_and_mkdirs(BDRVVVFATState* s)\n     int i;\n \n #ifdef DEBUG\n-    fprintf(stderr, \"handle_renames\\n\");\n+    error_report(\"handle_renames\");\n     for (i = 0; i < s->commits.next; i++) {\n         commit_t* commit = array_get(&(s->commits), i);\n-        fprintf(stderr, \"%d, %s (%d, %d)\\n\", i, commit->path ? commit->path : \"(null)\", commit->param.rename.cluster, commit->action);\n+        error_report(\"%d, %s (%d, %d)\", i,\n+                     commit->path ? commit->path : \"(null)\",\n+                     commit->param.rename.cluster, commit->action);\n     }\n #endif\n \n@@ -2893,7 +2901,9 @@ static int handle_deletes(BDRVVVFATState* s)\n                         return -4;\n                     deleted++;\n                 }\n-                DLOG(fprintf(stderr, \"DELETE (%d)\\n\", i); print_mapping(mapping); print_direntry(entry));\n+                DLOG(error_report(\"DELETE (%d)\", i);\n+                     print_mapping(mapping);\n+                     print_direntry(entry));\n                 remove_mapping(s, i);\n             }\n         }\n@@ -2922,7 +2932,7 @@ static int do_commit(BDRVVVFATState* s)\n \n     ret = handle_renames_and_mkdirs(s);\n     if (ret) {\n-        fprintf(stderr, \"Error handling renames (%d)\\n\", ret);\n+        error_report(\"Error handling renames (%d)\", ret);\n         abort();\n         return ret;\n     }\n@@ -2933,21 +2943,21 @@ static int do_commit(BDRVVVFATState* s)\n     /* recurse direntries from root (using bs->bdrv_read) */\n     ret = commit_direntries(s, 0, -1);\n     if (ret) {\n-        fprintf(stderr, \"Fatal: error while committing (%d)\\n\", ret);\n+        error_report(\"Fatal: error while committing (%d)\", ret);\n         abort();\n         return ret;\n     }\n \n     ret = handle_commits(s);\n     if (ret) {\n-        fprintf(stderr, \"Error handling commits (%d)\\n\", ret);\n+        error_report(\"Error handling commits (%d)\", ret);\n         abort();\n         return ret;\n     }\n \n     ret = handle_deletes(s);\n     if (ret) {\n-        fprintf(stderr, \"Error deleting\\n\");\n+        error_report(\"Error deleting\");\n         abort();\n         return ret;\n     }\n@@ -2999,7 +3009,7 @@ DLOG(checkpoint());\n         mapping_t* mapping = find_mapping_for_cluster(s, i);\n         if (mapping) {\n             if (mapping->read_only) {\n-                fprintf(stderr, \"Tried to write to write-protected file %s\\n\",\n+                error_report(\"Tried to write to write-protected file %s\",\n                         mapping->path);\n                 return -1;\n             }\n@@ -3043,10 +3053,11 @@ DLOG(checkpoint());\n     /*\n      * Use qcow backend. Commit later.\n      */\n-DLOG(fprintf(stderr, \"Write to qcow backend: %d + %d\\n\", (int)sector_num, nb_sectors));\n+DLOG(error_report(\"Write to qcow backend: %d + %d\",\n+                  (int)sector_num, nb_sectors));\n     ret = bdrv_write(s->qcow, sector_num, buf, nb_sectors);\n     if (ret < 0) {\n-        fprintf(stderr, \"Error writing to qcow backend\\n\");\n+        error_report(\"Error writing to qcow backend\");\n         return ret;\n     }\n \n@@ -3277,7 +3288,7 @@ static void checkpoint(void) {\n     assert(!vvv->current_mapping || vvv->current_fd || (vvv->current_mapping->mode & MODE_DIRECTORY));\n #if 0\n     if (((direntry_t*)vvv->directory.pointer)[1].attributes != 0xf)\n-        fprintf(stderr, \"Nonono!\\n\");\n+        error_report(\"Nonono!\");\n     mapping_t* mapping;\n     direntry_t* direntry;\n     assert(vvv->mapping.size >= vvv->mapping.item_size * vvv->mapping.next);\n","prefixes":["v1","4/8"]}