From nobody Sun Feb 8 14:53:32 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=1615222620; cv=none; d=zohomail.com; s=zohoarc; b=iRaZ3EJuVLblj93WNwbuc3g6LK5UJ4NwglUaryGL4o+j8zSV8tjBLyYQNSjS53S0x5OsoUKMTD1lyhsWBX1NYW1nL1NVytWtCvtmcLGA4KQGTTbFxxxUQsQ33oalF+RaDBm9JCOv4OIbV5iQRIms4CVe93I1fu1zHsjg8MyJIQs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615222620; 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=kKC+TrTt90R6cKk0TkKVIXqMP1xZ6HoVtnrCMm19AdA=; b=OaDKyp2A2U/M5rIhk9l6tiPR9uj0PQPQEkHejgEtVUbpiMfTai/xrKSJNyb+uDCffMS1NwqINPxzcNC2dZ/+ja7dtk4IaA2VEShsm8nhA0MyC10XK7RxkLjBHJOHLX0bFGdcJNPjZOJ+lM6HhEXK1jYYYp9cuQ/SDoouls2FVBc= 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 1615222620769518.266854105892; Mon, 8 Mar 2021 08:57:00 -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-125-DUM22PTlMjGqhrL1vR6S5g-1; Mon, 08 Mar 2021 11:56:57 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1D3DA1842145; Mon, 8 Mar 2021 16:56:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9DEE10074EF; Mon, 8 Mar 2021 16:56:50 +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 AEECC180065A; Mon, 8 Mar 2021 16:56:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 128Guoge023177 for ; Mon, 8 Mar 2021 11:56:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1D81922E53; Mon, 8 Mar 2021 16:56:50 +0000 (UTC) Received: from merkur.fritz.box (ovpn-112-100.ams2.redhat.com [10.36.112.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5DDE5D9DB; Mon, 8 Mar 2021 16:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615222619; 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=kKC+TrTt90R6cKk0TkKVIXqMP1xZ6HoVtnrCMm19AdA=; b=cf9zY6I/JgMggCl1NVIBaI14xxI89P+jCF3MZ5ZS+65AmaIHZRi1ekuc1edvIjQvPCPnFc p0FF27u5bkwD+0yzi8d0aM/kmwZiiQfQ8UI7UX32EsgTgjo7ShLaQJSIK812JWZK5H7dUZ Sv9O7q89LcYJsrs8TQv/Dj21HjDrHA4= X-MC-Unique: DUM22PTlMjGqhrL1vR6S5g-1 From: Kevin Wolf To: qemu-devel@nongnu.org Subject: [PATCH v3 19/30] qom: Make "object" QemuOptsList optional Date: Mon, 8 Mar 2021 17:54:29 +0100 Message-Id: <20210308165440.386489-20-kwolf@redhat.com> In-Reply-To: <20210308165440.386489-1-kwolf@redhat.com> References: <20210308165440.386489-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.84 on 10.5.11.22 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 Acked-by: Peter Krempa 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 7661270b98..d4df2334b7 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -299,6 +299,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 @@ -318,8 +319,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