From nobody Thu May 16 12:28:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600681783; cv=none; d=zohomail.com; s=zohoarc; b=I5JCNs1gCFG0TRoGK1MqcckNUhqpCMQgW4BxIAz2aHYek5T/MdOpAnMTlKSy9X8X3yBDINS1/XMskOFLrVSn0NzPf8u5GFUWPETtlJGsm1b47zjbiiJ7njBqEX3P/bSmMjDaGHGaZFOoBvSu8wyU6h49hvkGGPG+FyaHuC8ZCtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600681783; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=KDe1/RRXQ7idwrfnj0NhbOdJokH3L/5Un41ZNNNQ/Qo=; b=AFygPrsdxcWLkkHtIwes13jTiGI/dvXoIPalTkxBT+EelzCdsOJnizumEd3NqdnBVCMfwMJUBmk4q7XvBQXgJuuKWNXlTsZnaCUQEBzwLxEwM0a/Iqb2rzqr8zAdLrmaJQQXrgore5o4Dj3VmIQNYja0n/Jaqbb3Zr7HlJtjERk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600681783677499.3065474530123; Mon, 21 Sep 2020 02:49:43 -0700 (PDT) Received: from localhost ([::1]:59338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKIS6-0005er-8X for importer@patchew.org; Mon, 21 Sep 2020 05:49:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKIR4-0005En-6H for qemu-devel@nongnu.org; Mon, 21 Sep 2020 05:48:38 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKIR1-0003dc-IA for qemu-devel@nongnu.org; Mon, 21 Sep 2020 05:48:37 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08L9V7ld021123 for ; Mon, 21 Sep 2020 05:48:33 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33psavry0u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 21 Sep 2020 05:48:33 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08L9ZXNe033012 for ; Mon, 21 Sep 2020 05:48:32 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 33psavry0n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Sep 2020 05:48:32 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08L9g5AT002948; Mon, 21 Sep 2020 09:48:32 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma04wdc.us.ibm.com with ESMTP id 33n9m8p7gm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Sep 2020 09:48:32 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08L9mRmd61997424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Sep 2020 09:48:27 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 490156E050; Mon, 21 Sep 2020 09:48:31 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E64136E04C; Mon, 21 Sep 2020 09:48:30 +0000 (GMT) Received: from amdrome1.watson.ibm.com (unknown [9.2.130.16]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 21 Sep 2020 09:48:30 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=KDe1/RRXQ7idwrfnj0NhbOdJokH3L/5Un41ZNNNQ/Qo=; b=apI4f/BGTULzHFJvhp6l6cEBUszqQh+UX6CEDiVqthvcgMBNeYx5smy92x3C2JLuLGJK kH4r6cV/DfCo0aWW9DTjlPREfPIII3MB6SYM3OFDoSjlkCUVNoxMnqndsBV+EDG3p67G umkl7Z3mMORy1SrG4vWRKQZhqGRMqLS6sZOBkZb/VNh2FXeIC6mMxa+UV7jKdYmP4+pz 3G81/PzSfPdVOIerRbWENNzmr6xchhmlFuakY9X4R0ifj4nrGpejzTcPtODI0EFISAKD 0Sx5PfJ8XjgVbNWpSS6yg8bQOuGxYzMPevoW+R8aOW8dX6j3O4BuYMKneuYZ1ou9ZZuM Dw== From: Dov Murik To: qemu-devel@nongnu.org Subject: [PATCH] migration: Truncate state file in xen-save-devices-state Date: Mon, 21 Sep 2020 09:48:30 +0000 Message-Id: <20200921094830.114028-1-dovmurik@linux.vnet.ibm.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-21_01:2020-09-21, 2020-09-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxscore=0 phishscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009210067 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=148.163.158.5; envelope-from=dovmurik@linux.vnet.ibm.com; helo=mx0b-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/21 05:10:53 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dov Murik , "Dr. David Alan Gilbert" , Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When running the xen-save-devices-state QMP command, if the filename already exists it will be truncated before dumping the devices' state into it. Signed-off-by: Dov Murik Reviewed-by: Dr. David Alan Gilbert --- Note that I found the above issue while trying to debug xen-load-devices-state which simply fails (prints "Configuration section missing" to stderr) directly after xen-save-devices-state (in the same VM). I wonder if I should file a bug report as-is or investigate some more. Advice welcome. -Dov --- migration/savevm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index 304d98ff78..e1b26672cc 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2803,7 +2803,8 @@ void qmp_xen_save_devices_state(const char *filename,= bool has_live, bool live, vm_stop(RUN_STATE_SAVE_VM); global_state_store_running(); =20 - ioc =3D qio_channel_file_new_path(filename, O_WRONLY | O_CREAT, 0660, = errp); + ioc =3D qio_channel_file_new_path(filename, O_WRONLY | O_CREAT | O_TRU= NC, + 0660, errp); if (!ioc) { goto the_end; } --=20 2.20.1