From nobody Mon Apr 29 09:09:52 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=suse.com 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 1639442167372791.4248765608257; Mon, 13 Dec 2021 16:36:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-358-gGxWdhieOWy-Ygf_KDBTqw-1; Mon, 13 Dec 2021 19:36:04 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F8FD18C9F41; Tue, 14 Dec 2021 00:35:58 +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 C4C281007607; Tue, 14 Dec 2021 00:35:55 +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 22D021809CB8; Tue, 14 Dec 2021 00:35:51 +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 1BE0Znqo005822 for ; Mon, 13 Dec 2021 19:35:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 14BE31121314; Tue, 14 Dec 2021 00:35:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0F6301121315 for ; Tue, 14 Dec 2021 00:35:46 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E3C15805BDE for ; Tue, 14 Dec 2021 00:35:45 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-495-i8_F8HMIN4ujnp3xC4_rSw-1; Mon, 13 Dec 2021 19:35:44 -0500 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04lp2057.outbound.protection.outlook.com [104.47.12.57]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-14-6rW3dRReOJiMzIyg0xt05g-1; Tue, 14 Dec 2021 01:35:41 +0100 Received: from AM0PR04MB4899.eurprd04.prod.outlook.com (2603:10a6:208:c5::16) by AM0PR04MB5764.eurprd04.prod.outlook.com (2603:10a6:208:12f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.13; Tue, 14 Dec 2021 00:35:39 +0000 Received: from AM0PR04MB4899.eurprd04.prod.outlook.com ([fe80::2491:2b2f:154a:acf3]) by AM0PR04MB4899.eurprd04.prod.outlook.com ([fe80::2491:2b2f:154a:acf3%5]) with mapi id 15.20.4778.018; Tue, 14 Dec 2021 00:35:39 +0000 X-MC-Unique: gGxWdhieOWy-Ygf_KDBTqw-1 X-MC-Unique: i8_F8HMIN4ujnp3xC4_rSw-1 X-MC-Unique: 6rW3dRReOJiMzIyg0xt05g-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH] libxl: Implement domainGetMessages API Date: Mon, 13 Dec 2021 17:35:36 -0700 Message-ID: <20211214003536.32731-1-jfehlig@suse.com> X-ClientProxiedBy: AM6PR05CA0001.eurprd05.prod.outlook.com (2603:10a6:20b:2e::14) To AM0PR04MB4899.eurprd04.prod.outlook.com (2603:10a6:208:c5::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ed6925fe-135f-47a1-095c-08d9be99a762 X-MS-TrafficTypeDiagnostic: AM0PR04MB5764:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:302 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: PZJ5MM8GwOIVq7Nh2bZzHw3wYEvhKGGNtYYrtUtCyFYtHWJrR5RvfG6TcRin52HGlq/xS7RrQADegUNsA3wBDaRmR/mC9bgK4dFE/liUCZ4EyBeaur2J5N7dr9TTtODh6FLeCnaQC5dWGAUMrRzx/kLAZBTNHrOXg6qlfSgWy53XzHtpC8RFoyD22km6tDZf3n0I4ksjQjQTw8S+XUcwXDnysuyE7NMYQTWTnwxzCJ0IdWBjDqzneVQWBY7Nx+g0XhFxgEnQaeeUVTK/pQjPQidyMl7qXsEBAL+7nCCBtBDICJpz9CisD6FGyZVtefmlCenEEJ4alYYkV73quVJEE/aqbpCbmXoUWw7tw5q7C9F17sVb6W/F3aJPhD0+ZvRuR/EgPKmlE+m/f8Mv3c3jpgc65U//wHIanP9yq1Vowxm8JeFUwasZ2nvjA2ltv9iK6hzhSiBeTmkPSWAOYVYufkz0R2p+O90LgjyH3EZj8Ebv9zWnmRka64xVdMi9YU6Ux+Y5cT71GstLGrhqg+P+5n4tKgcqVugH/rayPI5Hxw6GKybdoifDgv0+fkWAiTI0T2tNVadXirxKS5mebevxMtI6gmlMGfBhC1oSD3Os2MHvBVyYyUSHp/h+fuy8vMLj3ij2fE+dVymJNdr2lnvvPg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB4899.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(316002)(6512007)(6486002)(2616005)(6666004)(2906002)(36756003)(1076003)(86362001)(186003)(38100700002)(66556008)(508600001)(5660300002)(66946007)(6506007)(26005)(6916009)(8676002)(8936002)(66476007)(83380400001); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?qnNnQU73P3MNRgjMUlrW+/YTuHP7ZRxZ2MmHzW9iT5XA1JIF9RTxZk5NiRFy?= =?us-ascii?Q?/LIiBqajLbYZFY5/Ko4L50bIAQqYII9VCDjyKtuQyjsMfcxMS1Vl3jOafIiy?= =?us-ascii?Q?kvT5LxMi/dBCPxLGrvnQEMKKokffJZ42iRbmW0dSnualeF6/7x3LjshQ/qk1?= =?us-ascii?Q?ieeffOiqfobO/xcAmYAbnRLunpjE72F8J11NY0UohdW57pnRb6S5egLZJG+7?= =?us-ascii?Q?fMaIrCc+Qm+s8uFwq3u9Kf4jjlm7eHeiNAtSmGwVcumQsBdF26QVjDiShRL8?= =?us-ascii?Q?OHoahVGsu+dVf88JcehXPTDzO99t39BqgVuX5k1EZlDF+cinGzsla1K0k4Tn?= =?us-ascii?Q?t+ZKmI9Mz/+bwnCWUTCmtPG0uciI/skRAnZ51hS1YTVXF65Rp+0nhE4IAAnD?= =?us-ascii?Q?yAoI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bg1huqXFE5w?= =?us-ascii?Q?ehVQoA3g4LXK6z/e2dgBkbF8qJYCgZbtpX54ID0oVPJDBUBtTbfJpcoV4GZE?= =?us-ascii?Q?7Wk14VF03khd2sLiWgCXK0VIZ8b+1HSvHUCsKLUPEyEg2713OQ7GZ+vNB8qq?= =?us-ascii?Q?k+EFm3zi3kCL5hR0+vJGZfxVlweIIYEYY1h0EPj2Y/mNs4qOoNDrUk2FZxaW?= =?us-ascii?Q?wY/8ztlA0S1DhgaPrh3B8a7cBOKAMThhQTNddT58BhsM24XBCozvNDU3PoTs?= =?us-ascii?Q?0ew2vDLi/SvEX+SxV2C1GcQwLoFqJXrxylhv9FvzOX7ZizZD8X9kUoDjcegy?= =?us-ascii?Q?aogCrvYyWXSqYu9uhr/T2+A=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed6925fe-135f-47a1-095c-08d9be99a762 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4899.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2021 00:35:39.8066 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BuT+h1JoysGucL6AWmVeGIWG5o27iuo0eRR9PYGSlJS9nbi0aDdo/dmLksSFWOPELaXELU3/0JeIet5rsfFs5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5764 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-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 1BE0Znqo005822 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.84 on 10.5.11.22 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-ZM-MESSAGEID: 1639442169199100001 Content-Type: text/plain; charset="utf-8" Since commit 46783e6307a, the 'virsh dominfo' command calls virDomainGetMessages to report any messages from the domain. Hypervisors not implementing the API now get the following log message when clients invoke 'virsh dominfo' this function is not supported by the connection driver: virDomainGetMessag= es Although libxl currently does not support any tainting or deprecation messages, provide an implementation to squelch the previously unseen error message when collecting dominfo. Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- src/libxl/libxl_driver.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index bc8598ea96..2d9385654c 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -6385,6 +6385,29 @@ libxlDomainGetMetadata(virDomainPtr dom, return ret; } =20 +static int +libxlDomainGetMessages(virDomainPtr dom, + char ***msgs, + unsigned int flags) +{ + virDomainObj *vm =3D NULL; + int ret =3D -1; + + virCheckFlags(0, -1); + + if (!(vm =3D libxlDomObjFromDomain(dom))) + return -1; + + if (virDomainGetMessagesEnsureACL(dom->conn, vm->def) < 0) + goto cleanup; + + ret =3D virDomainObjGetMessages(vm, msgs, flags); + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + static virHypervisorDriver libxlHypervisorDriver =3D { .name =3D LIBXL_DRIVER_EXTERNAL_NAME, .connectURIProbe =3D libxlConnectURIProbe, @@ -6498,6 +6521,7 @@ static virHypervisorDriver libxlHypervisorDriver =3D { .connectBaselineCPU =3D libxlConnectBaselineCPU, /* 2.3.0 */ .domainSetMetadata =3D libxlDomainSetMetadata, /* 5.7.0 */ .domainGetMetadata =3D libxlDomainGetMetadata, /* 5.7.0 */ + .domainGetMessages =3D libxlDomainGetMessages, /* 8.0.0 */ =20 }; =20 --=20 2.34.1