From nobody Tue May 14 04:07:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608551342; cv=none; d=zohomail.com; s=zohoarc; b=HlYtN2cJz9ZVqwTohGrwmAvsnVegMAqDvXvvt+Mlr/2yaRiX0EfmiqDiyM+8+enZCL4MbbwRe/9pepZaUGQSURdplp5VXdMyrXU7dhXUn5UCLV8aCZGTEZUgDnEK8di7eaa/jwCuZo58AbHxfgL50Ig7hPm6XyLXlqVuGcNpmrE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608551342; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=/Um0zB28M1BmDNT7FrTUTYnEOqV3DQLrNcKfih18/zw=; b=RdqlkrcW8SURL0yYMJdxAUCbmn24Yj7OfpUKj0ddyUsi4LNTNPF/QHvYA/ITGLhWf+liQdfWAl2GDAMB9VkJsYVwsfG2nuuxvpF4X88CscOWdYAwCJ/AFxRUuguR5LxjyRFWAoCT984nJiyM/oJOwdzFgynAyRUJZETmOMRKJu0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1608551342831349.57236397737427; Mon, 21 Dec 2020 03:49:02 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-342-77F_cNTuNmelZeoa5kFjSw-1; Mon, 21 Dec 2020 06:48:59 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7504C8049C1; Mon, 21 Dec 2020 11:48:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A53B46A913; Mon, 21 Dec 2020 11:48:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 986554A7C6; Mon, 21 Dec 2020 11:48:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BLBmnA1012229 for ; Mon, 21 Dec 2020 06:48:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 123B1106D5C1; Mon, 21 Dec 2020 11:48:49 +0000 (UTC) Received: from carol.localdomain (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8ACC106D5AF for ; Mon, 21 Dec 2020 11:48:40 +0000 (UTC) Received: from carol.redhat.com (carol.k8r.cz [127.0.0.1]) by carol.localdomain (Postfix) with ESMTP id 89473C227AE for ; Mon, 21 Dec 2020 12:48:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608551341; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/Um0zB28M1BmDNT7FrTUTYnEOqV3DQLrNcKfih18/zw=; b=JZU2xSATzW9Inl9vgEbx4Ro4gd/2tPuSNaBrI/BynT15odDnX4uc3CEHWDizEziLLkXvUQ N1CvaL6x1CAXsZpCwShg13aTtmwQwR+Uv/I/KjFGkBxCD1zfBCRPW4EHkGX1YPH+5944bb 7EKSh4X0pumWrvxeddhYmZ84ZWD/0h4= X-MC-Unique: 77F_cNTuNmelZeoa5kFjSw-1 From: Martin Kletzander To: libvir-list@redhat.com Subject: [libvirt PATCH] vmx: Don't error out on missing filename for cdrom Date: Mon, 21 Dec 2020 12:48:39 +0100 Message-Id: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This is perfectly valid in VMWare and the VM just boots with an empty drive= . We used to just skip the whole drive before, but since we changed how we parse empty cdrom drives this now results in an error and the user not being able= to even dump the XML. Instead of erroring out, just keep the drive empty. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1903953 Signed-off-by: Martin Kletzander Reviewed-by: Tim Wiederhake --- src/vmx/vmx.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index b86dbe9ca267..40e4ef962992 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2447,10 +2447,18 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOpt= ionPtr xmlopt, virConfPtr con goto cleanup; } =20 + tmp =3D ctx->parseFileName(fileName, ctx->opaque); virDomainDiskSetType(*def, VIR_STORAGE_TYPE_FILE); - if (!(tmp =3D ctx->parseFileName(fileName, ctx->opaque))) - goto cleanup; - virDomainDiskSetSource(*def, tmp); + /* It is easily possible to have a cdrom with non-existing fil= ename + * as the image and vmware just provides an empty cdrom. + * + * See: https://bugzilla.redhat.com/1903953 + */ + if (tmp) { + virDomainDiskSetSource(*def, tmp); + } else { + virResetLastError(); + } VIR_FREE(tmp); } else if (deviceType && STRCASEEQ(deviceType, "atapi-cdrom")) { virDomainDiskSetType(*def, VIR_STORAGE_TYPE_BLOCK); --=20 2.29.2