From nobody Sun Feb 8 17:22:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 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=1584987157; cv=none; d=zohomail.com; s=zohoarc; b=hzBAZb9ND5rGM/7M9HtKx3m1cpmrDCiZH1uj+8fMG2z9qg/RPorsXcFh8F7oRRoliR3tQfEf7kH7xyYTH1SGKRlBRxtJEtA7GpoT/C7V6aEBWMNsIBHZYzoP7+uuk1PyMH9OhL9diQis/T0jpgdsA1tSZ3VxKB+k/S8ZSd6jr6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584987157; 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=2ihiIs4wZKKflAjOShsW084cAesnsKR+u/8QlbE/hsI=; b=EIcETDEdsZ26umqfOec6za58edrIHV7Bxktp7dTcGsUXnf5bRlBnduIVr9piJxCfp68YrDm5Myd5bOUGDeKcQDAPKRVsmn7obsMqIkQbOmLZyJNgfmUueezZMAGvnygGGholPIIuOtwfxNx/kKYrkCEKZ8r1qP/rebqH1vJAfVc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 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-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 1584987157054244.01786289239897; Mon, 23 Mar 2020 11:12:37 -0700 (PDT) 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-465-_jUA0t6UNG-x9T-MHU8uOw-1; Mon, 23 Mar 2020 14:12:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC9FC8010E8; Mon, 23 Mar 2020 18:12:27 +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 7FBC260BE0; Mon, 23 Mar 2020 18:12:27 +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 1EF1318089D7; Mon, 23 Mar 2020 18:12:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02NICBif009449 for ; Mon, 23 Mar 2020 14:12:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7B43A9B934; Mon, 23 Mar 2020 18:12:11 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 017919B93C for ; Mon, 23 Mar 2020 18:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584987156; 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=2ihiIs4wZKKflAjOShsW084cAesnsKR+u/8QlbE/hsI=; b=PXc6ee7LR2RH3/015HE5MTM5hF/fZSiXkO6LIEj5WGNuYpGOjxiyQhRa7EeI/p6Plao7EU CqmwQisOKEtYRXaBduL0ud+x5gCBihcXgF4ztplzy6g2pR8f5OSEvnKCB3d69/9iLigP1F in5UvxjTEtBubM1XS/tSVHoCuoToVts= X-MC-Unique: _jUA0t6UNG-x9T-MHU8uOw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/14] virDomainDiskSourceNVMeFormat: Format only valid 'managed' values Date: Mon, 23 Mar 2020 19:11:53 +0100 Message-Id: <229554d8a10a0602ba7079eeed09d3b218e2b8c2.1584986997.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.12 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" VIR_TRISTATE_BOOL_ABSENT which maps to the 'default' string would not be parsed back, so we shouldn't format it either. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f1e4d33a8d..f6a225e4e6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -24662,8 +24662,9 @@ virDomainDiskSourceNVMeFormat(virBufferPtr attrBuf, const virStorageSourceNVMeDef *nvme) { virBufferAddLit(attrBuf, " type=3D'pci'"); - virBufferAsprintf(attrBuf, " managed=3D'%s'", - virTristateBoolTypeToString(nvme->managed)); + if (nvme->managed !=3D VIR_TRISTATE_BOOL_ABSENT) + virBufferAsprintf(attrBuf, " managed=3D'%s'", + virTristateBoolTypeToString(nvme->managed)); virBufferAsprintf(attrBuf, " namespace=3D'%llu'", nvme->namespc); virPCIDeviceAddressFormat(childBuf, nvme->pciAddr, false); } --=20 2.24.1