From nobody Thu May 9 21:13:19 2024 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=1620212169; cv=none; d=zohomail.com; s=zohoarc; b=WHEAksLhgVnfW1Ll2f9P09tp9ur1udpkN/lTV4GdIIq3gmKi2+nER310o8mRv2nQun1iLzxKsNHOtz66mU3zClocscWmXFWfQambn76DXt3Q8C1Kq/BDjVmFnLR41ZlNufPhc+umORBJJ6Bl9rCEzbtj04Z/lA7+XJ97NViDo78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620212169; 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=aJ8eWYcB5nPS6Og/AkVmGQqIoImG2mdC2uCPqowTBl4=; b=EH15l+AafIspH8DROfpNmKK/DUBJ3FZLRwTRreZxNqgm/8uFoGade7jhL6CM8qigy1kvzF2ruvqnNqbzRiOqN1HsD+kSBSxTdCqSpQkFou+se0wuyDrxuSaXBp8Wkfkf0Un1Ibt1iCxh0iJi144ElWUzThUsA/KySHzXmZSfHQI= 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 1620212169515481.0954603625346; Wed, 5 May 2021 03:56:09 -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-291-ZvQLPuWAMeKRgxsiuDvGmw-1; Wed, 05 May 2021 06:56:05 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C93346415F; Wed, 5 May 2021 10:55:59 +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 A556560CD1; Wed, 5 May 2021 10:55:59 +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 7181C180B463; Wed, 5 May 2021 10:55:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 145AtsBl025938 for ; Wed, 5 May 2021 06:55:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id B72C570132; Wed, 5 May 2021 10:55:54 +0000 (UTC) Received: from work.redhat.com (ovpn-113-124.ams2.redhat.com [10.36.113.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2CB650554; Wed, 5 May 2021 10:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620212168; 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=aJ8eWYcB5nPS6Og/AkVmGQqIoImG2mdC2uCPqowTBl4=; b=gZ6gUuP26JDidkjkC0f3qtB4pfr6m6nYWMRwXCCcV7hJh2g+ARH07NbfcVlyG+SHbCxBOj P0f8IQzJ8CJSD+2yxLtZXuwOGUiEajcwd8ms8OmeZiKPseOb7y7GApeIZWxUIocba/faO+ yZCnzO2nItsm3ZmZpKJJ2HVhmQkeGWE= X-MC-Unique: ZvQLPuWAMeKRgxsiuDvGmw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 1/4] virDomainFSDefParseXML: Remove unused variables Date: Wed, 5 May 2021 12:55:45 +0200 Message-Id: <20210505105548.95348-2-twiederh@redhat.com> In-Reply-To: <20210505105548.95348-1-twiederh@redhat.com> References: <20210505105548.95348-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.13 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" Fixes: 8f05664ed379fdb7f830d900f4fa3584ac7cab49 Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/conf/domain_conf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 78dafc487d..64f525fc08 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9682,12 +9682,10 @@ virDomainFSDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr driver_node =3D NULL; xmlNodePtr source_node =3D NULL; g_autofree char *type =3D NULL; - g_autofree char *fsdriver =3D NULL; g_autofree char *source =3D NULL; g_autofree char *target =3D NULL; g_autofree char *format =3D NULL; g_autofree char *accessmode =3D NULL; - g_autofree char *wrpolicy =3D NULL; g_autofree char *usage =3D NULL; g_autofree char *units =3D NULL; g_autofree char *model =3D NULL; --=20 2.26.3 From nobody Thu May 9 21:13:19 2024 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=1620212165; cv=none; d=zohomail.com; s=zohoarc; b=NwkkV4XNHETU3fkgL1APmBPwmYfzmqTHU1RozXnuNmr01ekOobILKOKOsrRPCF0QLLmQdbEsLedakCppiRpKP/YOvG45KB47oy8rWYAC83X6qEYOnu8ROmrPfTgfDcs+cEcBQY22R+vbZVY5cRwNaztVklmXeaC28yhaloIVLyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620212165; 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=4/RbxYQe5+4v/xMTyqQCO2S/cO8PjSGoGDign8B0A0E=; b=lXaBCtmsAg1eu85Qvx9Z6j6UGfZEwwq9bMa+QlqlwIFzORvBuE5+lTUXB/+hbqrD2sADAfDfXO7uC68xVCpny/MUJh8o4vau6jAKHXzYFxGyuvg1GFzEFZV7AL8TBrZG7D7VFh54ydZ2tVZghq+nfYdifEQcbV8LYHoFDgzCy2U= 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) header.from= 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 1620212165761274.29535729691315; Wed, 5 May 2021 03:56:05 -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-44-amPQKPdQO0yZxCc1R4JadQ-1; Wed, 05 May 2021 06:56:02 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A71DE10066E5; Wed, 5 May 2021 10:55:57 +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 815905C5DF; Wed, 5 May 2021 10:55:57 +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 3D53F180B463; Wed, 5 May 2021 10:55:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 145AttSi025948 for ; Wed, 5 May 2021 06:55:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id E53A318825; Wed, 5 May 2021 10:55:55 +0000 (UTC) Received: from work.redhat.com (ovpn-113-124.ams2.redhat.com [10.36.113.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A65250554; Wed, 5 May 2021 10:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620212164; 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=4/RbxYQe5+4v/xMTyqQCO2S/cO8PjSGoGDign8B0A0E=; b=CcxzTaI5/F2ynxvhsh4j+N1Y28fX1v8AsC5139WFmQpzHS2yfc4QaE3XLP7KQQTjGfFtzL x0f8432cOvqKY62QFIiLZaYMhKUy96YWCLZtzXWiKRFjSuiL/j+s2Ov1bv/728FJMf4mgT LBsbiRTe/KOs7N3F4PinfjeQ1CUNm+g= X-MC-Unique: amPQKPdQO0yZxCc1R4JadQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 2/4] virDomainGraphicsDefParseXMLSpice: Fix variable type Date: Wed, 5 May 2021 12:55:46 +0200 Message-Id: <20210505105548.95348-3-twiederh@redhat.com> In-Reply-To: <20210505105548.95348-1-twiederh@redhat.com> References: <20210505105548.95348-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.16 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" Fixes: 2a5e16398eb622f30dabb16770d2e14b7a6d5212 Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 64f525fc08..e7823ec2df 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -12734,8 +12734,8 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphics= Def *def, return -1; =20 for (i =3D 0; i < n; i++) { - unsigned int name; - unsigned int mode; + virDomainGraphicsSpiceChannelName name; + virDomainGraphicsSpiceChannelMode mode; =20 if (virXMLPropEnum(node_list[i], "name", virDomainGraphicsSpiceChannelNameTypeFromString, --=20 2.26.3 From nobody Thu May 9 21:13:19 2024 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=1620212170; cv=none; d=zohomail.com; s=zohoarc; b=Awg6LQ28AvmONsSJ5oLH9+P2ZhtI7Uve0rulRFMecO/kC9SUUlHuljQqLFO0B3aOcE/bAlB0PjCzMJKRRexFagtBQFjfo6jCIs6nhcF5hVhqt092VdS88OdaFrB8J6MwHeM9ibWH8Vw5tsHvqOJcjN4zmBmgOIR33hh+TRHLzbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620212170; 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=9Na9AKxwFY8dAyTF6aXG43qvNcgDfzOd8f1qsiaxx1s=; b=d2X4yWf3OJ+8KGkozRWUTbPNfD+/TKNfYfWIzASFVUtBgLHDBJozD6nK7qo8PiTbq9KUAwVMGYQ/34SD3XFw4N5XPTdLnvM/Nt8id6x1WBu6D9WBDtwfl9ogOjN97ZrZ8I4UFWoxmm/0FhsIQDAk3nOkbvkOk/wvgxaNasF84d0= 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) header.from= 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 162021217024898.7372675171132; Wed, 5 May 2021 03:56:10 -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-310-0TdhOQ5nNMmSpumcHY6KGg-1; Wed, 05 May 2021 06:56:07 -0400 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 6B21B1854E2E; Wed, 5 May 2021 10:56:02 +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 4B7FC5B4A6; Wed, 5 May 2021 10:56:02 +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 18F8B1800BB4; Wed, 5 May 2021 10:56:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 145AtvrD025958 for ; Wed, 5 May 2021 06:55:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 371C018825; Wed, 5 May 2021 10:55:57 +0000 (UTC) Received: from work.redhat.com (ovpn-113-124.ams2.redhat.com [10.36.113.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45E2460C17; Wed, 5 May 2021 10:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620212169; 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=9Na9AKxwFY8dAyTF6aXG43qvNcgDfzOd8f1qsiaxx1s=; b=CefToxS3aiJH19Ag7RUTUkdtlxoNAY8czyhTY3TGJ4XfdPCNT89lDomKU3qHtBqnQODi4W M81IpdA4G7JOHj6uhY6izcf7pz+2pvF1JqQLovsrLpzJ9TmcYv8et5C65wQxu1vVk2afiB q0K2qY4M9HfDfw9QeQ7HfTuMq6MOZoI= X-MC-Unique: 0TdhOQ5nNMmSpumcHY6KGg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 3/4] virDomainGraphicsDefParseXMLSpice: Make name and mode mandatory Date: Wed, 5 May 2021 12:55:47 +0200 Message-Id: <20210505105548.95348-4-twiederh@redhat.com> In-Reply-To: <20210505105548.95348-1-twiederh@redhat.com> References: <20210505105548.95348-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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" Attributes are mandatory and were incorrectly made optional recently. Fixes: 2a5e16398eb622f30dabb16770d2e14b7a6d5212 Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e7823ec2df..3c12a94627 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -12739,12 +12739,12 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphi= csDef *def, =20 if (virXMLPropEnum(node_list[i], "name", virDomainGraphicsSpiceChannelNameTypeFromString, - VIR_XML_PROP_NONE, &name) < 0) + VIR_XML_PROP_REQUIRED, &name) < 0) return -1; =20 if (virXMLPropEnum(node_list[i], "mode", virDomainGraphicsSpiceChannelModeTypeFromString, - VIR_XML_PROP_NONE, &mode) < 0) + VIR_XML_PROP_REQUIRED, &mode) < 0) return -1; =20 def->data.spice.channels[name] =3D mode; --=20 2.26.3 From nobody Thu May 9 21:13:19 2024 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=1620212225; cv=none; d=zohomail.com; s=zohoarc; b=Tu5yHCBJYc9x6uNK0OGZuBy4szamSffG8oBwGrTqpxttApIAQLO+URr+NSS/NtvUcx9okt94yXuPOfM1r165W6jJc61nPn/eCIAMWhmSUM1IoFpPdYDmOc7JWtZ5DGOQBkoKhGzS251Psb+Ya/eGMHI4bC5vFddOAnfYu29RfrE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620212225; 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=V4+B33cWXjodbz3Jg4gH5tv8tJ63lTwUIaeS3EfDZIo=; b=J5gQPtiPJ7Zvt/8aVIF7hJBxk4KyyRQI/az8IT9IePLiQJzUASH5j8+lukm37Ygdl11adklp2A4MxkthdU4HvDAPdeQSww7q/1XdCcTCYHonBxic9jodcEAInioGlZpEXzgxTPPydwM6taUmjE3sMkv25QVYUbW1oT3Np0VqjGA= 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 1620212225816754.3028668414026; Wed, 5 May 2021 03:57:05 -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-495-uqf4gf2nPiW5P2LbWu2BJw-1; Wed, 05 May 2021 06:56:11 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1C4D98049CE; Wed, 5 May 2021 10:56:05 +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 ED12E5D9DD; Wed, 5 May 2021 10:56:04 +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 B983E1800BC1; Wed, 5 May 2021 10:56:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 145Au25K025974 for ; Wed, 5 May 2021 06:56:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 18B3318825; Wed, 5 May 2021 10:56:02 +0000 (UTC) Received: from work.redhat.com (ovpn-113-124.ams2.redhat.com [10.36.113.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F34660C17; Wed, 5 May 2021 10:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620212224; 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=V4+B33cWXjodbz3Jg4gH5tv8tJ63lTwUIaeS3EfDZIo=; b=ToFSopc5gGWAHX1NOk83pjS0mIkkAvuxh5w90v3uAsfDlI4M8E8o9skXxG6CJNeDss2TJs rUYB4cB96L8VAYC2CNl6Z3YhlCX3UzrgLD+P8McV7SXZ4C9rocT/f19Kt0bsAI0elbIAr6 ef6Ba8OMd/PJQE4kia9votxbrix12f4= X-MC-Unique: uqf4gf2nPiW5P2LbWu2BJw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 4/4] virDomainGraphicsDefParseXMLSpice: Use virXMLProp* Date: Wed, 5 May 2021 12:55:48 +0200 Message-Id: <20210505105548.95348-5-twiederh@redhat.com> In-Reply-To: <20210505105548.95348-1-twiederh@redhat.com> References: <20210505105548.95348-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.14 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" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 185 +++++++++++++++++------------------------ 1 file changed, 76 insertions(+), 109 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3c12a94627..88061a1f06 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -12653,25 +12653,11 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphi= csDef *def, xmlXPathContextPtr ctxt, unsigned int flags) { - int defaultModeVal; g_autofree xmlNodePtr *node_list =3D NULL; int n =3D 0; size_t i =3D 0; - int value =3D 0; - g_autofree char *port =3D virXMLPropString(node, "port"); - g_autofree char *tlsPort =3D virXMLPropString(node, "tlsPort"); - g_autofree char *autoport =3D virXMLPropString(node, "autoport"); - g_autofree char *defaultMode =3D virXMLPropString(node, "defaultMode"); - g_autofree char *compression =3D NULL; - g_autofree char *jpeg_compression =3D NULL; - g_autofree char *zlib_compression =3D NULL; - g_autofree char *playback_compression =3D NULL; - g_autofree char *streaming_mode =3D NULL; - g_autofree char *copypaste =3D NULL; - g_autofree char *filetransfer_enable =3D NULL; - g_autofree char *gl_enable =3D NULL; - g_autofree char *mouse_mode =3D NULL; - g_autofree char *rendernode =3D NULL; + virTristateBool autoport =3D VIR_TRISTATE_BOOL_NO; + xmlNodePtr cur; VIR_XPATH_NODE_AUTORESTORE(ctxt) =20 ctxt->node =3D node; @@ -12679,40 +12665,26 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphi= csDef *def, if (virDomainGraphicsListensParseXML(def, node, ctxt, flags) < 0) return -1; =20 - if (port) { - if (virStrToLong_i(port, NULL, 10, &def->data.spice.port) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse spice port %s"), port); - return -1; - } - } else { - def->data.spice.port =3D 0; - } + def->data.spice.port =3D 0; + if (virXMLPropInt(node, "port", 10, VIR_XML_PROP_NONE, + &def->data.spice.port) < 0) + return -1; =20 - if (tlsPort) { - if (virStrToLong_i(tlsPort, NULL, 10, &def->data.spice.tlsPort) < = 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse spice tlsPort %s"), tlsPort); - return -1; - } - } else { - def->data.spice.tlsPort =3D 0; - } + def->data.spice.tlsPort =3D 0; + if (virXMLPropInt(node, "tlsPort", 10, VIR_XML_PROP_NONE, + &def->data.spice.tlsPort) < 0) + return -1; =20 - if (STREQ_NULLABLE(autoport, "yes")) - def->data.spice.autoport =3D true; + if (virXMLPropTristateBool(node, "autoport", VIR_XML_PROP_NONE, + &autoport) < 0) + return -1; + def->data.spice.autoport =3D autoport =3D=3D VIR_TRISTATE_BOOL_YES; =20 def->data.spice.defaultMode =3D VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE= _ANY; - - if (defaultMode) { - if ((defaultModeVal =3D virDomainGraphicsSpiceChannelModeTypeFromS= tring(defaultMode)) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown default spice channel mode %s"), - defaultMode); - return -1; - } - def->data.spice.defaultMode =3D defaultModeVal; - } + if (virXMLPropEnum(node, "defaultMode", + virDomainGraphicsSpiceChannelModeTypeFromString, + VIR_XML_PROP_NONE, &def->data.spice.defaultMode) < = 0) + return -1; =20 if (def->data.spice.port =3D=3D -1 && def->data.spice.tlsPort =3D=3D -= 1) { /* Legacy compat syntax, used -1 for auto-port */ @@ -12750,95 +12722,90 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphi= csDef *def, def->data.spice.channels[name] =3D mode; } =20 - if ((compression =3D virXPathString("string(./image/@compression)", ct= xt))) { - if ((value =3D - virDomainGraphicsSpiceImageCompressionTypeFromString(compressi= on)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown spice image compression %s"), compre= ssion); + if ((cur =3D virXPathNode("./image", ctxt))) { + virDomainGraphicsSpiceImageCompression compression; + + if (virXMLPropEnum(cur, "compression", + virDomainGraphicsSpiceImageCompressionTypeFromS= tring, + VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO, + &compression) < 0) return -1; - } - def->data.spice.image =3D value; + + def->data.spice.image =3D compression; } =20 - if ((jpeg_compression =3D virXPathString("string(./jpeg/@compression)"= , ctxt))) { - if ((value =3D - virDomainGraphicsSpiceJpegCompressionTypeFromString(jpeg_comp= ression)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown spice jpeg compression %s"), - jpeg_compression); + if ((cur =3D virXPathNode("./jpeg", ctxt))) { + virDomainGraphicsSpiceJpegCompression compression; + + if (virXMLPropEnum(cur, "compression", + virDomainGraphicsSpiceJpegCompressionTypeFromSt= ring, + VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO, + &compression) < 0) return -1; - } - def->data.spice.jpeg =3D value; + + def->data.spice.jpeg =3D compression; } =20 - if ((zlib_compression =3D virXPathString("string(./zlib/@compression)"= , ctxt))) { - if ((value =3D - virDomainGraphicsSpiceZlibCompressionTypeFromString(zlib_comp= ression)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown spice zlib compression %s"), - zlib_compression); + if ((cur =3D virXPathNode("./zlib", ctxt))) { + virDomainGraphicsSpiceZlibCompression compression; + + if (virXMLPropEnum(cur, "compression", + virDomainGraphicsSpiceZlibCompressionTypeFromSt= ring, + VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO, + &compression) < 0) return -1; - } - def->data.spice.zlib =3D value; + + def->data.spice.zlib =3D compression; } =20 - if ((playback_compression =3D virXPathString("string(./playback/@compr= ession)", ctxt))) { - if ((value =3D virTristateSwitchTypeFromString(playback_compressio= n)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("unknown spice playback compression")); + if ((cur =3D virXPathNode("./playback", ctxt))) { + if (virXMLPropTristateSwitch(cur, "compression", + VIR_XML_PROP_REQUIRED, + &def->data.spice.playback) < 0) return -1; - } - def->data.spice.playback =3D value; } =20 - if ((streaming_mode =3D virXPathString("string(./streaming/@mode)", ct= xt))) { - if ((value =3D - virDomainGraphicsSpiceStreamingModeTypeFromString(streaming_m= ode)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("unknown spice streaming mode")); + if ((cur =3D virXPathNode("./streaming", ctxt))) { + virDomainGraphicsSpiceStreamingMode mode; + + if (virXMLPropEnum(cur, "mode", + virDomainGraphicsSpiceStreamingModeTypeFromStri= ng, + VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO, + &mode) < 0) return -1; - } - def->data.spice.streaming =3D value; + + def->data.spice.streaming =3D mode; } =20 - if ((copypaste =3D virXPathString("string(./clipboard/@copypaste)", ct= xt))) { - if ((value =3D virTristateBoolTypeFromString(copypaste)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown copypaste value '%s'"), copypaste); + if ((cur =3D virXPathNode("./clipboard", ctxt))) { + if (virXMLPropTristateBool(cur, "copypaste", + VIR_XML_PROP_REQUIRED, + &def->data.spice.copypaste) < 0) return -1; - } - def->data.spice.copypaste =3D value; } =20 - if ((filetransfer_enable =3D virXPathString("string(./filetransfer/@en= able)", ctxt))) { - if ((value =3D virTristateBoolTypeFromString(filetransfer_enable))= <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown enable value '%s'"), - filetransfer_enable); + if ((cur =3D virXPathNode("./filetransfer", ctxt))) { + if (virXMLPropTristateBool(cur, "enable", + VIR_XML_PROP_REQUIRED, + &def->data.spice.filetransfer) < 0) return -1; - } - def->data.spice.filetransfer =3D value; } =20 - if ((gl_enable =3D virXPathString("string(./gl/@enable)", ctxt))) { - rendernode =3D virXPathString("string(./gl/@rendernode)", ctxt); + if ((cur =3D virXPathNode("./gl", ctxt))) { + def->data.spice.rendernode =3D virXMLPropString(cur, "rendernode"); =20 - if ((value =3D virTristateBoolTypeFromString(gl_enable)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown enable value '%s'"), gl_enable); + if (virXMLPropTristateBool(cur, "enable", + VIR_XML_PROP_REQUIRED, + &def->data.spice.gl) < 0) return -1; - } - def->data.spice.gl =3D value; - def->data.spice.rendernode =3D g_steal_pointer(&rendernode); } =20 - if ((mouse_mode =3D virXPathString("string(./mouse/@mode)", ctxt))) { - if ((value =3D virDomainGraphicsSpiceMouseModeTypeFromString(mouse= _mode)) <=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown mouse mode value '%s'"), mouse_mode); + if ((cur =3D virXPathNode("./mouse", ctxt))) { + if (virXMLPropEnum(cur, "mode", + virDomainGraphicsSpiceMouseModeTypeFromString, + VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO, + &def->data.spice.mousemode) < 0) return -1; - } - def->data.spice.mousemode =3D value; } =20 return 0; --=20 2.26.3