From nobody Tue Feb 10 23:01:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1634292496192602.6881238597585; Fri, 15 Oct 2021 03:08:16 -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-573-GM2Taa3VM-qC4CBY3vzJ6g-1; Fri, 15 Oct 2021 06:08:13 -0400 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 BD01F10A8E01; Fri, 15 Oct 2021 10:08:08 +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 9DE051002D67; Fri, 15 Oct 2021 10:08:08 +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 339CA4EA2A; Fri, 15 Oct 2021 10:08:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 19FA86u8003617 for ; Fri, 15 Oct 2021 06:08:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1413540D1B98; Fri, 15 Oct 2021 10:08:06 +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 0FC6F40C1256 for ; Fri, 15 Oct 2021 10:08:06 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EB414899EC5 for ; Fri, 15 Oct 2021 10:08:05 +0000 (UTC) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-497-FRP7fBybMwS30_8rp23gEg-1; Fri, 15 Oct 2021 06:08:04 -0400 Received: by mail-pl1-f170.google.com with SMTP id v20so6079262plo.7 for ; Fri, 15 Oct 2021 03:08:04 -0700 (PDT) Received: from zhanglei-dev.zelin.local ([2a09:bac0:23::815:bc4]) by smtp.gmail.com with ESMTPSA id c25sm4613388pfn.159.2021.10.15.03.08.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 03:08:03 -0700 (PDT) X-MC-Unique: GM2Taa3VM-qC4CBY3vzJ6g-1 X-MC-Unique: FRP7fBybMwS30_8rp23gEg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QnjIYzeOn1KhL35oBWz6RbNTn23ez1TkuQlDcq4aKtc=; b=W+S1ETI6XMP8qAb+qQyrnYvX3MybpdYnEB8hN2jKWKDQ3EOeQpA/J0DYEEH39baml9 dBEZmaqyvPjekdZfNoGCsfmkG4QwiV0ZVK7kV/hq3W/fepLsCJ3L10VNcUWiZozm3zlo wfZT79hCH+FHFFM+PZt1kTNIAIIbNWhH/C70odRNaxijt04aNUaf4l4Zi9ZNx+o+NBYQ UbQ4KrpIvj3DuJHB7agaixlw/LIVMhLae9BMkoNRJD5YKg+O5gq1p1KFTg3QI+CYupjG Z+d3gVEcy06OUmFqGqu4JJAmwqL1bC+Wue5yFwCAtJFpryMzficTmendyMiZiPqJgiK0 qDCg== X-Gm-Message-State: AOAM533kJ3gHrg74UswEBvu6/9XPp4iJSdHhrWMR81EoMXYDuIoLGYsp g9LP2EVwLeYSMAE4TED2kcoKWoaMG4yx+33DnETUsw== X-Google-Smtp-Source: ABdhPJz49077FjOikFxVaTEBUCCMQ3a17gomEG23Yvlvs6kCCVRFCWjqhiKAsj0+smh6Bb+ZYQTuHw== X-Received: by 2002:a17:90b:4a51:: with SMTP id lb17mr12507938pjb.41.1634292483203; Fri, 15 Oct 2021 03:08:03 -0700 (PDT) From: zhanglei To: zhanglei@smartx.com, libvir-list@redhat.com Subject: [libvirt PATCH v4 1/5] domain: add interface information to 'virDomainGetGuestInfo' Date: Fri, 15 Oct 2021 18:07:47 +0800 Message-Id: <20211015100751.1492806-2-zhanglei@smartx.com> In-Reply-To: <20211015100751.1492806-1-zhanglei@smartx.com> References: <20211015100751.1492806-1-zhanglei@smartx.com> MIME-Version: 1.0 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.84 on 10.11.54.2 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: 1634292497899100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: zhanglei --- include/libvirt/libvirt-domain.h | 1 + src/libvirt-domain.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index eaafcc6b29..2f017c5b68 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -5098,6 +5098,7 @@ typedef enum { VIR_DOMAIN_GUEST_INFO_HOSTNAME =3D (1 << 3), /* return hostname inform= ation */ VIR_DOMAIN_GUEST_INFO_FILESYSTEM =3D (1 << 4), /* return filesystem in= formation */ VIR_DOMAIN_GUEST_INFO_DISKS =3D (1 << 5), /* return disks information = */ + VIR_DOMAIN_GUEST_INFO_INTERFACES =3D (1 << 6), /* return interfaces in= formation */ } virDomainGuestInfoTypes; =20 int virDomainGetGuestInfo(virDomainPtr domain, diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 57baef6889..fdc0780ae0 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -12579,6 +12579,18 @@ virDomainSetVcpu(virDomainPtr domain, * * "hostname" - the hostname of the domain * + * VIR_DOMAIN_GUEST_INFO_INTERFACES: + * Returns information about the interfaces within the domain. the typed + * parameter keys are in this format: + * + * "if.count" - the number of interfaces defined on this domain + * "if..name" - name in the guest (e.g. ``eth0``) for interface = + * "if..hwaddr" - hardware address in the guest for interface + * "if..addr.count - the number of IP addresses of interface + * "if..addr..type" - the IP address type of addr (= e.g. ipv4) + * "if..addr..addr" - the IP address of addr + * "if..addr..prefix" - the prefix of IP address of addr <= num1> + * * Using 0 for @types returns all information groups supported by the given * hypervisor. * --=20 2.31.1