From nobody Mon Feb 9 19:04:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599190924; cv=none; d=zohomail.com; s=zohoarc; b=dnvuGmBcSggZ1jrFKv2wuG38i80FI4rSccsF37RiK9oAyKdBIfWGRDAKqS5/SkQE0PyRZXJNPsqL6cPSwBd2z7zJwEa6y9XYs92in5pEBiqIlMM9QibPtqGMOBz2ESYsoUyw0dR5gzSp0OcyGshSGgzRizRZEe/TAB2Pw45klUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599190924; 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=/CqmqjAyY0fC/Vl4uN9J7whxr/m9ssBlMlg3WnMXlgs=; b=cPcRGUn0txIhXLa09OD8aJyTe/eleebpA7Q3xcYhWlXBzA0PjnLSkR3pgcqjoEIquo8ggY0U4l+mtgcJkooKqS/qp+/vWgpKaO7IFeqS611MpIuj7jQrz70cFvC6zhlWbI1nqqaOSl0ByM+yAuKiofwwuKErywVJW+H1g7hHM2o= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599190924122180.80756161755073; Thu, 3 Sep 2020 20:42:04 -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-295-LTjRaHefNIqd5y0WAJAsug-1; Thu, 03 Sep 2020 23:41:54 -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 84EFE10060EC; Fri, 4 Sep 2020 03:41:47 +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 66BBE7C0B3; Fri, 4 Sep 2020 03:41:47 +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 3325C972EC; Fri, 4 Sep 2020 03:41:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0843fBpJ030609 for ; Thu, 3 Sep 2020 23:41:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id B250C117DB09; Fri, 4 Sep 2020 03:41:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A605F117A97E for ; Fri, 4 Sep 2020 03:41:08 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3C260882978 for ; Fri, 4 Sep 2020 03:41:08 +0000 (UTC) Received: from mail-m24147.qiye.163.com (mail-m24147.qiye.163.com [220.194.24.147]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-403-5dtA7TVnMlKnYJtk0aN5kg-1; Thu, 03 Sep 2020 23:41:05 -0400 Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp4 (Coremail) with SMTP id JedpCgAHcNgStlFfYHYgCg--.1426S33; Fri, 04 Sep 2020 11:35:56 +0800 (CST) X-MC-Unique: LTjRaHefNIqd5y0WAJAsug-1 X-MC-Unique: 5dtA7TVnMlKnYJtk0aN5kg-1 From: Shi Lei To: libvir-list@redhat.com Subject: [RFCv2 31/46] conf: Replace virDomainGraphicsDefParseXMLRDP(hardcoded) with virDomainGraphicsRDPDefParseXML(generated) Date: Fri, 4 Sep 2020 11:35:23 +0800 Message-Id: <20200904033538.418579-32-shi_lei@massclouds.com> In-Reply-To: <20200904033538.418579-1-shi_lei@massclouds.com> References: <20200904033538.418579-1-shi_lei@massclouds.com> MIME-Version: 1.0 X-CM-TRANSID: JedpCgAHcNgStlFfYHYgCg--.1426S33 X-Coremail-Antispam: 1Uf129KBjvJXoWxWr45GF1xArWrXryDGrykXwb_yoW5Cry3pF s3Wa1xGr4rXrs5Gw4vka1j9wsF9as8Jr47Gr1ruw48tFW7Gr4kAr1fZr1I934jgry8Z34S kFWSq34UWF48AFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRoGQkUUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbiRhyVT1bdHZp3kQAAsq X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Shi Lei --- src/conf/domain_conf.c | 41 ++--------------------------------------- src/conf/domain_conf.h | 10 +++++----- 2 files changed, 7 insertions(+), 44 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8842f2a..14bb4d3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14401,7 +14401,7 @@ virDomainGraphicsVNCDefParseXMLHook(xmlNodePtr node= G_GNUC_UNUSED, } =20 =20 -static int +int virDomainGraphicsRDPDefParseXMLHook(xmlNodePtr node G_GNUC_UNUSED, virDomainGraphicsRDPDefPtr def, const char *instname G_GNUC_UNUSED, @@ -14431,43 +14431,6 @@ virDomainGraphicsRDPDefParseXMLHook(xmlNodePtr nod= e G_GNUC_UNUSED, } =20 =20 -static int -virDomainGraphicsDefParseXMLRDP(virDomainGraphicsDefPtr def, - xmlNodePtr node, - xmlXPathContextPtr ctxt G_GNUC_UNUSED, - unsigned int flags) -{ - g_autofree char *port =3D virXMLPropString(node, "port"); - g_autofree char *autoport =3D virXMLPropString(node, "autoport"); - g_autofree char *replaceUser =3D virXMLPropString(node, "replaceUser"); - g_autofree char *multiUser =3D virXMLPropString(node, "multiUser"); - - if (port) { - if (virStrToLong_i(port, NULL, 10, &def->data.rdp.port) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse rdp port %s"), port); - return -1; - } - } - - if (STREQ_NULLABLE(autoport, "yes")) - def->data.rdp.autoport =3D true; - - if (STREQ_NULLABLE(replaceUser, "yes")) - def->data.rdp.replaceUser =3D true; - - if (STREQ_NULLABLE(multiUser, "yes")) - def->data.rdp.multiUser =3D true; - - if (virDomainGraphicsRDPDefParseXMLHook(node, &def->data.rdp, - NULL, def, &flags, port, autop= ort, - replaceUser, multiUser) < 0) - return -1; - - return 0; -} - - static int virDomainGraphicsDefParseXMLDesktop(virDomainGraphicsDefPtr def, xmlNodePtr node) @@ -14859,7 +14822,7 @@ virDomainGraphicsDefParseXML(virDomainXMLOptionPtr = xmlopt, case VIR_DOMAIN_GRAPHICS_TYPE_RDP: if (virDomainGraphicsListensParseXML(def, node, ctxt, flags) < 0) goto error; - if (virDomainGraphicsDefParseXMLRDP(def, node, ctxt, flags) < 0) + if (virDomainGraphicsRDPDefParseXML(node, &def->data.rdp, NULL, de= f, &flags) < 0) goto error; break; case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index f4cc504..3cdb5f8 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1695,11 +1695,11 @@ struct _virDomainGraphicsVNCDef { /* genparse:wit= hhook, genformat:separate */ virDomainGraphicsAuthDef auth; /* xmlgroup */ }; =20 -struct _virDomainGraphicsRDPDef { - int port; - bool autoport; - bool replaceUser; - bool multiUser; +struct _virDomainGraphicsRDPDef { /* genparse:withhook */ + int port; /* xmlattr */ + bool autoport; /* xmlattr */ + bool replaceUser; /* xmlattr */ + bool multiUser; /* xmlattr */ }; =20 struct _virDomainGraphicsDesktopDef { --=20 2.25.1