From nobody Fri Apr 26 04:04:15 2024 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1574937050; cv=none; d=zohomail.com; s=zohoarc; b=WhVURxzgVCojjvfkZWXJWKC118pLUqIQ5/2FaTe5BrkYhT3WwBI4XSRJpPOBYZjOiO5lhgEvMHuqCamulZjVaN6n90wBUIF8BqtQyqXDV9naGWLtOrDqS4DeqiZVtgUNymQyPmjElzkd1qysg4eqcb4X9KjpKU5xVn/bZxOGF0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574937050; 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=ZOaE3tMctYUx4TreV0s20dk5hmEye+mEygJwg1BrLAE=; b=bsjcWoGrgat9e60NJg4/vYTjflXujSc36PmR9qs1FRyqIp2Ql2ec0naUZZGJ4E23fRg0ImKrr/5hc7EtoEHV/vWR+ARuVA0jL8gp7907Kyzx4p2GbzOe05qbJYqnenkvyubc2n6Ut3SUAqdD3jKcLYThASy2AaALGBnDxh9fI2Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1574937050708456.7273600192949; Thu, 28 Nov 2019 02:30:50 -0800 (PST) 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-307-H1klVETxNXeP2UevwAIhIQ-1; Thu, 28 Nov 2019 05:30:47 -0500 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 EC1E7800D5E; Thu, 28 Nov 2019 10:30:41 +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 B642B5D9E1; Thu, 28 Nov 2019 10:30:41 +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 2E7214BB65; Thu, 28 Nov 2019 10:30:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xASAUb2Q031006 for ; Thu, 28 Nov 2019 05:30:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4263D5D9E5; Thu, 28 Nov 2019 10:30:37 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.43.2.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id C162C5D9E2 for ; Thu, 28 Nov 2019 10:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574937049; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=ZOaE3tMctYUx4TreV0s20dk5hmEye+mEygJwg1BrLAE=; b=UbF6mB4zVOeCEDdhRhSdr///Kw6O9wxy+koesvsnO6UiGlcDBdIFraMhK6yWvztpajU8qU a+BAtYwj/3zb34WvCGs6X+AWwKdyEPsQGI8QHPLt9eaeStG/P+gBVvLVp88HkVOyzQu2fb LrhkywG43U3lhGhK2R8UtUVeo0i2fbw= From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 28 Nov 2019 11:30:31 +0100 Message-Id: <21172af2a86d85062bcac43bc15444798eccf437.1574936997.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [go PATCH 1/2] Add VIR_FROM_BPF error constant 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 X-MC-Unique: H1klVETxNXeP2UevwAIhIQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina Reviewed-by: Daniel P. Berrang=C3=A9 --- error.go | 3 +++ error_compat.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/error.go b/error.go index d6b02e0..4b057fb 100644 --- a/error.go +++ b/error.go @@ -596,6 +596,9 @@ const ( =20 // Error from TPM FROM_TPM =3D ErrorDomain(C.VIR_FROM_TPM) + + // Error from BPF + FROM_BPF =3D ErrorDomain(C.VIR_FROM_BPF) ) =20 type Error struct { diff --git a/error_compat.h b/error_compat.h index 6727a0d..0383925 100644 --- a/error_compat.h +++ b/error_compat.h @@ -207,4 +207,10 @@ #define VIR_FROM_TPM 70 #endif =20 +/* 5.10.0 */ + +#ifndef VIR_FROM_BPF +#define VIR_FROM_BPF 71 +#endif + #endif /* LIBVIRT_GO_ERROR_COMPAT_H__ */ --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 04:04:15 2024 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1574937057; cv=none; d=zohomail.com; s=zohoarc; b=e3l7AG4VPiAbidLK+qAidSanYTaHITOuQP0K78SQbrvNqDL0jOiz/Tzu0kRR8sCN7gNR+qEpzztYqMp20FJzRQUn8VnTj3GxjPoE55MsuXHNDd5AfMWyn9lJ5uvP3n9yn7VvDBB4LsceYDjzaVQ4vRPand5KGZ9Zofa6ebPI8mY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574937057; 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=BkwfHlzQbl6fL1KihtXSrdEnFq2OhfL5kjHDVeD/TmU=; b=M07UbaELVYzme3wWS3x1E8jPXLB3CsbnSP6rGhiKYrCkdNPF4QryOIlj4ut8mw51XbUNrGGTdeDUbnylum27VCdryYP0/YL/Qr2Q+mT4UDSybMnBIkln7scZ56vEzywMOcI3ulvwh7B+kzZAjAoO3mJpZwRJhKZ1K+WFZjSKwdg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 157493705754754.856233538924016; Thu, 28 Nov 2019 02:30:57 -0800 (PST) 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-19-x23sOLybN8Ku_8tWRLI7Jg-1; Thu, 28 Nov 2019 05:30:54 -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 5B4BF107ACFB; Thu, 28 Nov 2019 10:30:48 +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 3413210013A7; Thu, 28 Nov 2019 10:30:48 +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 EC1374E566; Thu, 28 Nov 2019 10:30:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xASAUcJ1031017 for ; Thu, 28 Nov 2019 05:30:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 103A05D9E2; Thu, 28 Nov 2019 10:30:38 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.43.2.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D7DC5D9E5 for ; Thu, 28 Nov 2019 10:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574937056; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=BkwfHlzQbl6fL1KihtXSrdEnFq2OhfL5kjHDVeD/TmU=; b=RPW5hhrGh7sPa0Ya2Ycn+L6TxtvA7aZ9qarVH3EdMOYayiI274Va8Hn8iG8i8Yo3RL3Qv7 0BVEv+JsSWJ/NE0hJwqz1yCLZDEnTa9Bj1lJUUqgAdX5lCif/ks89b4v39uT0oGakIfPTX DO9rED/ClpvyotlY3/56tWkgO2FcpGY= From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 28 Nov 2019 11:30:32 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [go PATCH 2/2] Add support for virDomainAgentSetResponseTimeout API 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 X-MC-Unique: x23sOLybN8Ku_8tWRLI7Jg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- domain.go | 23 +++++++++++++++++++++++ domain_compat.h | 14 ++++++++++++++ domain_wrapper.go | 17 +++++++++++++++++ domain_wrapper.h | 6 ++++++ 4 files changed, 60 insertions(+) diff --git a/domain.go b/domain.go index 360659d..7901d8d 100644 --- a/domain.go +++ b/domain.go @@ -886,6 +886,14 @@ const ( DOMAIN_GUEST_INFO_FILESYSTEM =3D DomainGuestInfoTypes(C.VIR_DOMAIN_GUEST_= INFO_FILESYSTEM) ) =20 +type DomainAgentSetResponseTimeoutValues int + +const ( + VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK =3D DomainAgentSetResponseTimeo= utValues(C.VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK) + VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT =3D DomainAgentSetResponseTimeo= utValues(C.VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT) + VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT =3D DomainAgentSetResponseTimeo= utValues(C.VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT) +) + // See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomain= Free func (d *Domain) Free() error { var err C.virError @@ -5179,3 +5187,18 @@ func (d *Domain) GetGuestInfo(types DomainGuestInfoT= ypes, flags uint32) (*Domain =20 return &info, nil } + +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomain= AgentSetResponseTimeout +func (d *Domain) AgentSetResponseTimeout(timeout int, flags uint32) error { + if C.LIBVIR_VERSION_NUMBER < 5010000 { + return makeNotImplementedError("virDomainAgentSetResponseTimeout") + } + + var err C.virError + ret :=3D C.virDomainAgentSetResponseTimeoutWrapper(d.ptr, C.int(timeout),= C.uint(flags), &err) + if ret =3D=3D -1 { + return makeError(&err) + } + + return nil +} diff --git a/domain_compat.h b/domain_compat.h index 98cf5e1..3b91b15 100644 --- a/domain_compat.h +++ b/domain_compat.h @@ -1006,4 +1006,18 @@ struct _virDomainInterface { #define VIR_DOMAIN_GUEST_INFO_FILESYSTEM (1 << 4) #endif =20 +/* 5.10.0 */ + +#ifndef VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK +#define VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK -2 +#endif + +#ifndef VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT +#define VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT -1 +#endif + +#ifndef VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT +#define VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT 0 +#endif + #endif /* LIBVIRT_GO_DOMAIN_COMPAT_H__ */ diff --git a/domain_wrapper.go b/domain_wrapper.go index 0f521cb..63573c3 100644 --- a/domain_wrapper.go +++ b/domain_wrapper.go @@ -2419,5 +2419,22 @@ virDomainGetGuestInfoWrapper(virDomainPtr domain, #endif } =20 +int +virDomainAgentSetResponseTimeoutWrapper(virDomainPtr domain, + int timeout, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 5010000 + assert(0); // Caller should have checked version +#else + int ret =3D virDomainAgentSetResponseTimeout(domain, timeout, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + */ import "C" diff --git a/domain_wrapper.h b/domain_wrapper.h index 61b63bb..568910e 100644 --- a/domain_wrapper.h +++ b/domain_wrapper.h @@ -1017,4 +1017,10 @@ virDomainGetGuestInfoWrapper(virDomainPtr domain, unsigned int flags, virErrorPtr err); =20 +int +virDomainAgentSetResponseTimeoutWrapper(virDomainPtr domain, + int timeout, + unsigned int flags, + virErrorPtr err); + #endif /* LIBVIRT_GO_DOMAIN_WRAPPER_H__ */ --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list