From nobody Mon Feb 9 01:42:40 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=1678094448; cv=none; d=zohomail.com; s=zohoarc; b=UMDUvZmhUX/RAX6egX6G4SAjj4ISeUZQRz7zH2W8KWMUEGRLLLnhXUKBLFgMSfyza3et3YRBnc9LwVVfC4iQPbeP6T28j4RDtQNlbl9H4DWVhPtwdIMU0ST0x0jOA8m6B9r8t4rqdwOyijItY79//VDEKJS3BAq19y644398zTI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678094448; 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=0UVLueAXCB0PqaDYO2JDCNz+9ISEYpOk+kp0LM7V0ws=; b=eO8TBu/D7rYZEnaWgRds2vkZkSmh8lD8wNv51O5p8M95O1GnV1TrJHcsPvZuRh13oEYTDKtW6tT+QmbeInF9351CbhaNh7DCq0bsKMMvtCXcjkp7oTEz6/QOThYsRvQGIK+RrAl/2Cezn8R372xSZ/G6uNhK29rQ2KzbE1akEoM= 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 1678094448827415.2253487548285; Mon, 6 Mar 2023 01:20:48 -0800 (PST) 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-136-iVfNvx4FPC2OO6wVYwBxvw-1; Mon, 06 Mar 2023 04:20:44 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5BD313C20EE5; Mon, 6 Mar 2023 09:20:42 +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 495C040CF8F0; Mon, 6 Mar 2023 09:20:42 +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 2BA8B194658C; Mon, 6 Mar 2023 09:20:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 984891946586 for ; Mon, 6 Mar 2023 09:20:40 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8684A1121314; Mon, 6 Mar 2023 09:20:40 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E5F3112132D for ; Mon, 6 Mar 2023 09:20:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678094447; 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=0UVLueAXCB0PqaDYO2JDCNz+9ISEYpOk+kp0LM7V0ws=; b=BiJnqRGspmt+aRMj3z+EvkDfRAan00C6l0NzID7sy5vNvOvdaesauqArsNj0VqdzKHUFEK Oh9WbKcsgHmuQK38oYqM+e6pLzYNuP8zwbG9XoriOZKpINDq+1hgYfs/Z2UXfjl17tTrvd gHsHcGCIZFh/44hVUsPKJMyBz56p5uM= X-MC-Unique: iVfNvx4FPC2OO6wVYwBxvw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/6] qemuBuildHostNetProps: Append ipv6 address using virJSONValueObjectAdd Date: Mon, 6 Mar 2023 10:20:33 +0100 Message-Id: <04fab0e5851e16e85883b0fd09d269aa0f838523.1678094352.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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 3.1 on 10.11.54.1 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: 1678094450568100002 Content-Type: text/plain; charset="utf-8" The 'ipv6-prefix' and 'ipv6-prefixlen' fields can be directly added using virJSONValueObjectAdd rather tha by two separate calls. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 420fe4ed0c..1fc235153e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3974,11 +3974,10 @@ qemuBuildHostNetProps(virDomainObj *vm, if (virJSONValueObjectAppendString(netprops, "net", ip= v4netaddr) < 0) return NULL; } else if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET= 6)) { - if (virJSONValueObjectAppendString(netprops, "ipv6-pre= fix", addr) < 0) - return NULL; - if (ip->prefix && - virJSONValueObjectAppendNumberUlong(netprops, "ipv= 6-prefixlen", - ip->prefix) < = 0) + if (virJSONValueObjectAdd(&netprops, + "s:ipv6-prefix", addr, + "p:ipv6-prefixlen", ip->pref= ix, + NULL) < 0) return NULL; } } --=20 2.39.2