From nobody Mon Feb 9 15:11:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599190934; cv=none; d=zohomail.com; s=zohoarc; b=RL2PUeUFqZHLzQt2Z2j13Dr+FL7arBnXonc//hPTInAcEkEqUlIuhC9+RlhnJtO9e7vDS71YOEyupG2hDZB2E0luweUtRKAdMA6ACb2+0gx3nIiWsPWIfpUbDwb67BmjrjYMYHR6w1iHT0v7NhqNxAux3/ld7f1aNEP2HcIHTA0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599190934; 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=XhMuqQzOrl1Nczr+CdDrge1W04Fdizgqvw4T90oXBMg=; b=CzQ+sycGoTri/T72GxeUXb6jOEmrt5cDxfUKQKAuFPK/B8wMnvLG67mGiNBgsnswuWRQ8SuEOJSUR0hO8OOO/yuglu7Or+Un8hvgJjs1zvuCNzvFI44aMlrPGGtWqa9ntKXxYQ2SjnXRmfwNMgP+PUJtCUvnJL6wPfOtzgceIw8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599190934355284.3710601988208; Thu, 3 Sep 2020 20:42:14 -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-357--TCdr8ZeOweVkccFkX3Uuw-1; Thu, 03 Sep 2020 23:42: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 389108712F6; Fri, 4 Sep 2020 03:42:06 +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 181965D9DC; Fri, 4 Sep 2020 03:42:06 +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 D8E32181A86E; Fri, 4 Sep 2020 03:42:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0843fAkv030590 for ; Thu, 3 Sep 2020 23:41:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB1E820235B9; Fri, 4 Sep 2020 03:41:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0BF1202451D for ; Fri, 4 Sep 2020 03:41:08 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.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 7E36180121F 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-433-liuYVyAeO86NuOp95-1rgw-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--.1426S28; Fri, 04 Sep 2020 11:35:55 +0800 (CST) X-MC-Unique: -TCdr8ZeOweVkccFkX3Uuw-1 X-MC-Unique: liuYVyAeO86NuOp95-1rgw-1 From: Shi Lei To: libvir-list@redhat.com Subject: [RFCv2 26/46] conf: Generate format functions for virDomainGraphicsAuthDef Date: Fri, 4 Sep 2020 11:35:18 +0800 Message-Id: <20200904033538.418579-27-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--.1426S28 X-Coremail-Antispam: 1Uf129KBjvJXoWxWr47Xry5Zry3JF1rAr1kKrg_yoW5XF1UpF 13ZFZrCFs5Xr43Gw4qga90g39F9FyDCr47CrsIgw4UW3yUJr4kZa4xXry0vr1j9rZ3ZryF yFWSqa18Xa1kK37anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zMSoJLUUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbiEBuVT1nxrfy0YAAAs8 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.4 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.14 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 | 30 ++---------------------------- src/conf/domain_conf.h | 4 ++-- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1fd2a06..be07b40 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28000,32 +28000,6 @@ virDomainTimerDefFormat(virBufferPtr buf, return 0; } =20 -static void -virDomainGraphicsAuthDefFormatAttr(virBufferPtr buf, - virDomainGraphicsAuthDefPtr def, - unsigned int flags) -{ - if (!def->passwd) - return; - - if (flags & VIR_DOMAIN_DEF_FORMAT_SECURE) - virBufferEscapeString(buf, " passwd=3D'%s'", - def->passwd); - - if (def->expires) { - g_autoptr(GDateTime) then =3D NULL; - g_autofree char *thenstr =3D NULL; - - then =3D g_date_time_new_from_unix_utc(def->validTo); - thenstr =3D g_date_time_format(then, "%Y-%m-%dT%H:%M:%S"); - virBufferAsprintf(buf, " passwdValidTo=3D'%s'", thenstr); - } - - if (def->connected) - virBufferEscapeString(buf, " connected=3D'%s'", - virDomainGraphicsAuthConnectedTypeToString(d= ef->connected)); -} - =20 static void virDomainGraphicsListenDefFormat(virBufferPtr buf, @@ -28190,7 +28164,7 @@ virDomainGraphicsDefFormat(virBufferPtr buf, virDomainGraphicsVNCSharePolicyTypeToString( def->data.vnc.sharePolicy)); =20 - virDomainGraphicsAuthDefFormatAttr(buf, &def->data.vnc.auth, flags= ); + virDomainGraphicsAuthDefFormatAttr(buf, &def->data.vnc.auth, def, = &flags); break; =20 case VIR_DOMAIN_GRAPHICS_TYPE_SDL: @@ -28292,7 +28266,7 @@ virDomainGraphicsDefFormat(virBufferPtr buf, virBufferAsprintf(buf, " defaultMode=3D'%s'", virDomainGraphicsSpiceChannelModeTypeToString(def->data.spic= e.defaultMode)); =20 - virDomainGraphicsAuthDefFormatAttr(buf, &def->data.spice.auth, fla= gs); + virDomainGraphicsAuthDefFormatAttr(buf, &def->data.spice.auth, def= , &flags); break; =20 case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 616cbf4..9724b02 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1573,8 +1573,8 @@ typedef enum { VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_LAST } virDomainGraphicsAuthConnectedType; =20 -struct _virDomainGraphicsAuthDef { /* genparse */ - char *passwd; /* xmlattr */ +struct _virDomainGraphicsAuthDef { /* genparse, genformat:separate */ + char *passwd; /* xmlattr, formatflag:VIR_DOMAIN_DEF_= FORMAT_SECURE */ /* Whether there is an expiry time set */ bool expires; /* seconds since epoch */ --=20 2.25.1