From nobody Mon Feb 9 01:16:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1614178033; cv=none; d=zohomail.com; s=zohoarc; b=BI9PqbDiHi0eaqNSW1/gWSVzYhbRP3D6LMGn45LDOY5+kNMxrY0NYMG5nzKJ5CSx5Y0a6hjtD/517n8SkLKf8+LL5PFevN9UZNBUFdj0SBRH/rFMORcD1OpvnocmfV7YqwayscJvrIrc8XnhuPZHGyrpkSDKVqBErPHxfXjDquw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614178033; h=Content-Type:Content-Transfer-Encoding:Cc: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=AobaPlNgCAnqHONabFOcGNEwPc/8s4zw3ZcU4Gk/lEw=; b=YG6Zjavxcd+H1JWzNFUJyLZ7cxw3REkodg7lhnSzfgOOUZyFr+ccBbpwr6aKzmiH0yBpG9r9SfokMjdQ7KtIdthGmHd37Ov2i1g9lXMn9DmarDOyr7TNwRmHrHLJGFEeE5ZxdRTg+B1QajhMK2qCPlDfTnBb41z4uKu/DSdmsY4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1614178033988300.8459013107838; Wed, 24 Feb 2021 06:47:13 -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-159-qTWKxKJ-NtqRBlnBWPNaEQ-1; Wed, 24 Feb 2021 09:47:09 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5FFAB189BEB8; Wed, 24 Feb 2021 13:55:55 +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 35E74702D8; Wed, 24 Feb 2021 13:55:55 +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 DC5BA58074; Wed, 24 Feb 2021 13:55:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11ODtsXU017022 for ; Wed, 24 Feb 2021 08:55:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 471A11ABE5; Wed, 24 Feb 2021 13:55:54 +0000 (UTC) Received: from merkur.redhat.com (ovpn-114-142.ams2.redhat.com [10.36.114.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0776662467; Wed, 24 Feb 2021 13:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614178033; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=AobaPlNgCAnqHONabFOcGNEwPc/8s4zw3ZcU4Gk/lEw=; b=SzNfE5X1I6IwbNxCSoId+cyuQL2BxQ4HIyMJyyM6Gu9ZvtZQtyBm6XS2Pk1JOnxaSNs7cv m6Hx06GHxMfRua2u7h5U561ijRJ96XgqEN0aAPxor5prx7NNB3BY9HTi2TTUIfn3LX/eYX EGCU/Os8FkNX8AmG4kOz8dvhy7QPWRE= X-MC-Unique: qTWKxKJ-NtqRBlnBWPNaEQ-1 From: Kevin Wolf To: qemu-devel@nongnu.org Subject: [PATCH v2 20/31] qom: Make "object" QemuOptsList optional Date: Wed, 24 Feb 2021 14:52:44 +0100 Message-Id: <20210224135255.253837-21-kwolf@redhat.com> In-Reply-To: <20210224135255.253837-1-kwolf@redhat.com> References: <20210224135255.253837-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, lvivier@redhat.com, thuth@redhat.com, pkrempa@redhat.com, ehabkost@redhat.com, qemu-block@nongnu.org, libvir-list@redhat.com, jasowang@redhat.com, mreitz@redhat.com, kraxel@redhat.com, pbonzini@redhat.com, dgilbert@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.11 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 code is going away anyway, but for a few more commits, we'll be in a state where some binaries still use QemuOpts and others don't. If the "object" QemuOptsList doesn't even exist, we don't have to remove (or fail to remove, and therefore abort) a user creatable object from it. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- qom/object_interfaces.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 1e9ad6f08a..b9a99c8bf4 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -290,6 +290,7 @@ void user_creatable_print_help_from_qdict(QDict *args) =20 bool user_creatable_del(const char *id, Error **errp) { + QemuOptsList *opts_list; Object *container; Object *obj; =20 @@ -309,8 +310,10 @@ bool user_creatable_del(const char *id, Error **errp) * if object was defined on the command-line, remove its corresponding * option group entry */ - qemu_opts_del(qemu_opts_find(qemu_find_opts_err("object", &error_abort= ), - id)); + opts_list =3D qemu_find_opts_err("object", NULL); + if (opts_list) { + qemu_opts_del(qemu_opts_find(opts_list, id)); + } =20 object_unparent(obj); return true; --=20 2.29.2