> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man4/hv_kvp.4.md).

# hv\_kvp.4

`hv_kvp` — Hyper-V 键值对驱动

## 名称

`hv_kvp`

## 概要

`要将此驱动编译进内核，请在系统内核配置文件中加入以下行：`

> device hyperv

## 描述

`hv_kvp` 驱动为运行于 Hyper-V 上的 FreeBSD 客户机分区提供存储、检索、修改和删除键值对的能力。Hyper-V 允许管理员以键值对的形式在 FreeBSD 客户机分区内存储自定义元数据。管理员可以使用 Windows Powershell 脚本添加、读取、修改和删除此类键值对。

该驱动是基础框架，仅将请求转发给对应的用户态守护进程 hv\_kvp\_daemon(8)。守护进程维护键值对池，并执行实际的元数据管理。

相同的驱动和守护进程组合也用于从 FreeBSD 客户机设置和获取 IP 地址。

设置功能在 FreeBSD 客户机被分配静态 IP 地址并从一台 Hyper-V 主机故障转移到另一台时特别有用。故障转移后，Hyper-V 使用设置 IP 功能自动将 FreeBSD 客户机的 IP 地址更新为其原始静态值。

另一方面，获取 IP 功能用于在 Hyper-V 管理控制台窗口中更新客户机 IP 地址。

## 参见

hv\_ata\_pci\_disengage(4), [hv\_netvsc(4)](/man/man4/hv_netvsc.4.md), [hv\_storvsc(4)](/man/man4/hv_storvsc.4.md), [hv\_utils(4)](/man/man4/hv_utils.4.md), [hv\_vmbus(4)](/man/man4/hv_vmbus.4.md), hv\_kvp\_daemon(8)

## 历史

`hv_kvp` 的支持最早出现在 FreeBSD 10.0 中。该驱动由 Citrix Incorporated、Microsoft Corporation 和 Network Appliance Incorporated 联合开发。

## 作者

`hv_kvp` 的 FreeBSD 支持最早由 Microsoft BSD Integration Services Team <bsdic@microsoft.com> 添加。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man4/hv_kvp.4.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
