From nobody Thu May 2 00:42:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566839020; cv=none; d=zoho.com; s=zohoarc; b=KeNGht4e6453U7BlwUX753T83dyoZlIg75dOP7LNoj3OHAchK9qqgjXGocR83VQ66sCKtIG4c2Q8C+pZx4P/FlAaUoORT0YG+h1wBf7RCT/Gpdgys3Of6dMAIF/K9UzA5Bz+p/9AZvko52ma8ZNmGTqZj1xv2qZfV8lLF6hxjTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566839020; 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:ARC-Authentication-Results; bh=Aza03sF/l57cua5oMduZV7xC4gKATfenBhApcdVuJyU=; b=frizuRF54B5xxI90IpLP2xhEaaTy2bigUOeuYU6Lunyui2Ysxa+pEx6oxbY+Xr4Z62gm8ebRt6XTZrzNGfJoP0dkzryRzBXBpUQQ2hQSZkP+yliRlPGB4UztRyeJNisEA94nkvTaSf8QlX9gy+z2Qh1o8QSd1DzTH33faEg7Hrs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156683902075074.31416233232176; Mon, 26 Aug 2019 10:03:40 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 66F8F309B68B; Mon, 26 Aug 2019 17:03:37 +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 9F414600C8; Mon, 26 Aug 2019 17:03:36 +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 E8BF824F30; Mon, 26 Aug 2019 17:03:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7QH3WbB013207 for ; Mon, 26 Aug 2019 13:03:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C929196AE; Mon, 26 Aug 2019 17:03:32 +0000 (UTC) Received: from dahmer.redhat.com (ovpn-200-27.brq.redhat.com [10.40.200.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1CAA519D7A; Mon, 26 Aug 2019 17:03:30 +0000 (UTC) From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Mon, 26 Aug 2019 20:03:22 +0300 Message-Id: <20190826170323.23050-2-fidencio@redhat.com> In-Reply-To: <20190826170323.23050-1-fidencio@redhat.com> References: <20190826170323.23050-1-fidencio@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Subject: [libvirt] [glib PATCH 1/2] gconfig: Add _domain_os_get_firmware() 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 26 Aug 2019 17:03:37 +0000 (UTC) Add a way to get the value of which has been set to the domain XML. Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: Michal Privoznik --- libvirt-gconfig/libvirt-gconfig-domain-os.c | 12 ++++++++++++ libvirt-gconfig/libvirt-gconfig-domain-os.h | 1 + libvirt-gconfig/libvirt-gconfig.sym | 1 + tests/test-gconfig.c | 2 ++ 4 files changed, 16 insertions(+) diff --git a/libvirt-gconfig/libvirt-gconfig-domain-os.c b/libvirt-gconfig/= libvirt-gconfig-domain-os.c index 5aa247a..4bdbab2 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain-os.c +++ b/libvirt-gconfig/libvirt-gconfig-domain-os.c @@ -345,3 +345,15 @@ void gvir_config_domain_os_set_firmware(GVirConfigDoma= inOs *os, GVirConfigDomain =20 xmlNewProp(node, (xmlChar*)"firmware", (xmlChar*)firmware_str); } + +GVirConfigDomainOsFirmware gvir_config_domain_os_get_firmware(GVirConfigDo= mainOs *os) +{ + g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_OS(os), + GVIR_CONFIG_DOMAIN_OS_FIRMWARE_BIOS); + + return gvir_config_object_get_attribute_genum + (GVIR_CONFIG_OBJECT(os), + NULL, "firmware", + GVIR_CONFIG_TYPE_DOMAIN_OS_FIRMWARE, + GVIR_CONFIG_DOMAIN_OS_FIRMWARE_BIOS); +} diff --git a/libvirt-gconfig/libvirt-gconfig-domain-os.h b/libvirt-gconfig/= libvirt-gconfig-domain-os.h index 2a8fc13..f54fe87 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain-os.h +++ b/libvirt-gconfig/libvirt-gconfig-domain-os.h @@ -104,6 +104,7 @@ void gvir_config_domain_os_set_smbios_mode(GVirConfigDo= mainOs *os, GVirConfigDomainOsSmBiosMode mo= de); void gvir_config_domain_os_enable_boot_menu(GVirConfigDomainOs *os, gboole= an enable); void gvir_config_domain_os_bios_enable_serial(GVirConfigDomainOs *os, gboo= lean enable); +GVirConfigDomainOsFirmware gvir_config_domain_os_get_firmware(GVirConfigDo= mainOs *os); void gvir_config_domain_os_set_firmware(GVirConfigDomainOs *os, GVirConfigDomainOsFirmware firmwar= e); =20 diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-= gconfig.sym index d40bb7b..6686566 100644 --- a/libvirt-gconfig/libvirt-gconfig.sym +++ b/libvirt-gconfig/libvirt-gconfig.sym @@ -781,6 +781,7 @@ global: gvir_config_domain_capabilities_os_get_firmwares; gvir_config_domain_capabilities_os_get_type; gvir_config_domain_os_firmware_get_type; + gvir_config_domain_os_get_firmware; gvir_config_domain_os_set_firmware; gvir_config_storage_vol_target_features_get_type; gvir_config_storage_vol_target_set_features; diff --git a/tests/test-gconfig.c b/tests/test-gconfig.c index 6979578..6cd36d1 100644 --- a/tests/test-gconfig.c +++ b/tests/test-gconfig.c @@ -219,6 +219,7 @@ static void test_domain_os(void) g_assert_cmpint(gvir_config_domain_os_get_os_type(os), =3D=3D, GVIR_CO= NFIG_DOMAIN_OS_TYPE_HVM); g_assert_cmpstr(gvir_config_domain_os_get_arch(os), =3D=3D, "x86_64"); g_assert_cmpstr(gvir_config_domain_os_get_machine(os), =3D=3D, "q35"); + g_assert_cmpint(gvir_config_domain_os_get_firmware(os), =3D=3D, GVIR_C= ONFIG_DOMAIN_OS_FIRMWARE_EFI); devices =3D g_list_append(devices, GINT_TO_POINTER(GVIR_CONFIG_DOMAIN_OS_BOOT_DE= VICE_CDROM)); devices =3D g_list_append(devices, @@ -234,6 +235,7 @@ static void test_domain_os(void) g_assert(os !=3D NULL); g_assert_cmpstr(gvir_config_domain_os_get_arch(os), =3D=3D, "x86_64"); g_assert_cmpint(gvir_config_domain_os_get_os_type(os), =3D=3D, GVIR_CO= NFIG_DOMAIN_OS_TYPE_HVM); + g_assert_cmpint(gvir_config_domain_os_get_firmware(os), =3D=3D, GVIR_C= ONFIG_DOMAIN_OS_FIRMWARE_EFI); domain_os_check_boot_devices(os); g_object_unref(G_OBJECT(os)); =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 00:42:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1566839040; cv=none; d=zoho.com; s=zohoarc; b=Y116kQCqIFOqTFhO54l/BCJ274u85vd4AxFu++U62SHsfe3GjjQ+dSyEcINmKmaoQ1njsIiEBVBkABA7lRa+3lJ6qSrEZa5SLPzEo5IIY4bm2Ie0bbsa/20fVmVPcWOv1nAHyyveAmYoh+/+BctxTkjunWeolNoKj2JNwn0b6FQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566839040; 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:ARC-Authentication-Results; bh=WylW3T+x1lKhXq6HbKDrLjz60+nfRoiIJoQK2sUC0Y8=; b=bm3CbeDShkhFK0YjuQsUr8ZBrDVOXPIyjB4QHDYHWmJXT6pLtCACD4zFDaC11jb6KKDudhcxy8SYI+xD+MenuZULl/A4bTcC36wpImAB/hto8UaYHScgUy2EPblIrZA36lEg/vKoCXGBYHPgtu+5UULu+jRGdXrjYub1MoDpdys= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156683904078447.80269698334894; Mon, 26 Aug 2019 10:04:00 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6BDCF10576E7; Mon, 26 Aug 2019 17:03:59 +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 45C50608C1; Mon, 26 Aug 2019 17:03: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 0407624F32; Mon, 26 Aug 2019 17:03:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7QH3Xlp013217 for ; Mon, 26 Aug 2019 13:03:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id E054619D7A; Mon, 26 Aug 2019 17:03:33 +0000 (UTC) Received: from dahmer.redhat.com (ovpn-200-27.brq.redhat.com [10.40.200.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAF9D196AE; Mon, 26 Aug 2019 17:03:32 +0000 (UTC) From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Mon, 26 Aug 2019 20:03:23 +0300 Message-Id: <20190826170323.23050-3-fidencio@redhat.com> In-Reply-To: <20190826170323.23050-1-fidencio@redhat.com> References: <20190826170323.23050-1-fidencio@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Subject: [libvirt] [glib PATCH 2/2] tests, test-gconfig: Check _domain_os_get_machine() 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Mon, 26 Aug 2019 17:03:59 +0000 (UTC) Let's add one more simple check for gvir_config_domain_os_get_machine(). Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: Michal Privoznik --- tests/test-gconfig.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-gconfig.c b/tests/test-gconfig.c index 6cd36d1..b707325 100644 --- a/tests/test-gconfig.c +++ b/tests/test-gconfig.c @@ -235,6 +235,7 @@ static void test_domain_os(void) g_assert(os !=3D NULL); g_assert_cmpstr(gvir_config_domain_os_get_arch(os), =3D=3D, "x86_64"); g_assert_cmpint(gvir_config_domain_os_get_os_type(os), =3D=3D, GVIR_CO= NFIG_DOMAIN_OS_TYPE_HVM); + g_assert_cmpstr(gvir_config_domain_os_get_machine(os), =3D=3D, "q35"); g_assert_cmpint(gvir_config_domain_os_get_firmware(os), =3D=3D, GVIR_C= ONFIG_DOMAIN_OS_FIRMWARE_EFI); domain_os_check_boot_devices(os); g_object_unref(G_OBJECT(os)); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list