From nobody Sun Feb 8 12:20:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1652428495; cv=none; d=zohomail.com; s=zohoarc; b=OKIxf8NcjyH9faeVdS2dduXew5XwemhXY7OpvjBtcNNGNoXM0azbJxGKRpTzLFOE/rryly6OhvDHmbxBVeTi9EkrFaw73oQDDLkk19C5Xpu7okB7HevuyHQzTwhkQ9SxOgE3fSQEl1MKVyBa8KP2kmNO1UJVR8iSZsguHH899XM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652428495; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aTo1V35hpz+FvKy+MURdzVOZgf6AR0lirvrLs/FMN1U=; b=QP3oKUDMBHcw7gIVe5gyFCjH9DNpGYJrDoeaAvUXD1SGys8Nb/MvABc/OJNmJMJhRuieyjUgVwQXFLtbgnhNarrA7xmiLjqw18Gfl+JctX9eWqU3o/sYKN95h4PSwPvq42i4wVT6o9VdqEUDnEvC6KmFo77OzMGS2lg9hQy3fIM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1652428494963468.52485852285747; Fri, 13 May 2022 00:54:54 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-tDPIkZH-Pi6edKuufQ0k-Q-1; Fri, 13 May 2022 03:54:48 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B368E38332A4; Fri, 13 May 2022 07:54:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9695E4154C1; Fri, 13 May 2022 07:54:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 71655193211F; Fri, 13 May 2022 07:54:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AD4901932226 for ; Fri, 13 May 2022 07:54:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 939B7416361; Fri, 13 May 2022 07:54:32 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C0F240D1CF for ; Fri, 13 May 2022 07:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652428494; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=aTo1V35hpz+FvKy+MURdzVOZgf6AR0lirvrLs/FMN1U=; b=MhURKzVO/jubiEOCkoscSic34AEGKplbio3UbCb/rmHamIgEijfB09UiL2oV0z2x8/Qf+2 8rK/EA7ZSLxRG7xIE3ZoaEPTOcXtK5/wzucR/BTSK7xVm5OLlaj/0zT9fwZbDBv08z7uv3 eXgylBM2jgB6iQUpwn+E6yfDu6Enh/A= X-MC-Unique: tDPIkZH-Pi6edKuufQ0k-Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 3/3] virDomainRestoreFlags: Require VIR_DOMAIN_SAVE_PARAM_FILE for now Date: Fri, 13 May 2022 09:54:28 +0200 Message-Id: <942a361df0577a080bc4ba4f5bb291302f7c4d4f.1652428318.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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) X-ZM-MESSAGEID: 1652428496152100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Calling virDomainRestoreFlags() with no typed params results in an error in open() because it tries to open a NULL path. Obviously, this is wrong and path to restore from must be provided, at least for now until other sources of restore are introduced. Then this limitation can be relaxed. Signed-off-by: Michal Privoznik --- src/libvirt-domain.c | 4 +++- src/qemu/qemu_driver.c | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 208c2438fe..a32630a6e9 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -1190,7 +1190,9 @@ virDomainRestoreFlags(virConnectPtr conn, const char = *from, const char *dxml, * @nparams: number of restore parameters * @flags: bitwise-OR of virDomainSaveRestoreFlags * - * This method extends virDomainRestoreFlags by adding parameters. + * This method extends virDomainRestoreFlags by adding parameters. For + * now, VIR_DOMAIN_SAVE_PARAM_FILE is required but this requirement may + * be lifted in the future. * * Returns 0 in case of success and -1 in case of failure. * diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0b31c73bb9..702fd0239c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5967,6 +5967,12 @@ qemuDomainRestoreParams(virConnectPtr conn, VIR_DOMAIN_SAVE_PARAM_DXML, &dxml) < 0) return -1; =20 + if (!path) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("missing path to restore from")); + return -1; + } + ret =3D qemuDomainRestoreInternal(conn, path, dxml, flags, virDomainRestoreParamsEnsureACL); return ret; --=20 2.35.1