原作者:QEMU 文档贡献者。本文完整译写自系统模拟手册的 Network emulation,于 2026-10-05 核对。读取时 master 页面标示 QEMU 11.1.50,属于持续变化的开发文档;较旧安装版本未必支持其中的直接 passt 后端接口。
本文覆盖 TAP、传统用户态网络、passt 的自动启动与手动连接、vhost-user 迁移、虚拟 hub,以及多个 QEMU 实例间的网络连接。示例均只做静态阅读;没有启动虚拟机、修改网络参数、授予 capability 或执行迁移。原例中的 [...OPTIONS...] 代表没有展开的来宾磁盘、机器等参数,并不是可原样执行的 shell 参数。

一、来宾网卡和宿主后端是两件事
QEMU 可以模拟多种网卡,例如 PC 平台上的 PCI、ISA 网卡。网卡可以连到宿主网络后端,也可以连到 QEMU 模拟的集线器。TAP 或无特权用户态协议栈可以把来宾连到真实网络;socket 后端则可把它连到其他 QEMU 进程中的来宾。
因此配置网络时,应同时考虑“来宾看到什么网卡”和“这块网卡连接什么后端”。-device 常用来描述网卡,-netdev 描述后端,再用同一个 ID 关联;-nic 则提供合并写法。具体选项以安装版本的帮助和调用参数文档为准。
二、TAP:把虚拟网卡接入真实网络
TAP 是连接真实网络的常用方式。QEMU 会在宿主侧使用名为 tapN 一类的虚拟网络设备,之后可以像配置以太网卡一样配置它。
Linux 宿主
发行版打包 QEMU 时通常会提供辅助脚本,默认位置是 /etc/qemu-ifup、/etc/qemu-ifdown。QEMU 需要改变网络状态时会调用它们。若以普通用户运行 QEMU,可能需要管理员按实际命令为脚本配置适当的提权规则。
宿主内核必须支持 TAP;应存在 /dev/net/tun 设备。完整命令示例见官方Invocation 的 TAP 小节。
编者补充:这不是为整个 QEMU 或任意脚本开放 root 权限的理由。脚本内容、可写权限、网桥与路由变更范围都应事先核对;本文没有写入网络配置或修改 sudo 规则。
Windows 宿主的历史段落
原文提到 Windows 2000/XP 的 TAP-Win32 虚拟以太网驱动:它并不随标准 QEMU for Windows 提供,当时可从 OpenVPN 获取。这是明显的历史说明,不能作为当前 Windows 版本安装驱动的指引;实际应核对当前发行版支持与签名驱动来源。
三、传统用户态网络栈
原文用 -net user 说明传统用户态网络。在其描述的默认配置下,如果未指定 -net 选项,就采用用户态网络;该虚拟网络不要求 root 权限。默认拓扑是:
guest (10.0.2.15) <------> Firewall/DHCP server <-----> Internet
| (10.0.2.2)
|
----> DNS server (10.0.2.3)
|
----> SMB server (10.0.2.4)
来宾表现为位于阻止外部主动入站连接的防火墙之后。可在来宾中使用 DHCP 客户端获取配置,默认地址从 10.0.2.15 开始分配。原文建议检查是否获得 10.0.2.x 范围的地址,并尝试 ping 虚拟路由器 10.0.2.2。
编者补充:这里是默认拓扑说明,并不表示所有功能默认启用,例如 SMB 服务还涉及对应配置。也不能从“无需 root”推断来宾完全隔离于宿主:可达服务、转发规则和宿主防火墙仍决定实际边界。
ICMP 的限制
传统用户态网络一般不完整支持 ICMP;ping 本地虚拟路由器 10.0.2.2 应当可用。Linux 3.0 及之后的宿主可利用无特权 ICMP ping socket 允许 ping 互联网,但管理员须通过 ping_group_range 授权相应组。
原文给出的管理员操作是为 GID 100 设置范围:
echo 100 100 > /proc/sys/net/ipv4/ping_group_range
权限说明:这会修改宿主内核设置,不是普通诊断命令;GID 100 只是源文示例,不能假定它在你的系统上对应相同组。本文仅解释其意义,未执行或改动任何 sysctl。无法 ping 外部主机,也不能单凭这一现象认定所有用户态 TCP/UDP 网络都失效。
若启用内置 TFTP 服务,虚拟路由器同时作为 TFTP 服务器。
把宿主连接转发到来宾
-netdev user,hostfwd=... 可以把宿主侧的 TCP、UDP 或 UNIX 连接重定向到来宾,原文以 X11、telnet、SSH 为例。端口转发会主动打开访问入口,应限制监听地址与目标服务。
下面是编者补充的参数片段,依据官方 hostfwd 语法,将宿主回环地址的 TCP 2222 转发到默认来宾地址的 SSH 22 端口;它不是原文的实测命令,也不包含启动来宾所需的其他参数:
-nic user,hostfwd=tcp:127.0.0.1:2222-:22
显式使用 127.0.0.1 可以避免这个入口按宽泛监听地址暴露给其他机器。来宾仍需自行提供并安全配置 SSH;原文提及的 telnet 不应被理解为适合通过不可信网络传送凭证。
四、使用 passt 作为用户态网络栈
passt 可以替代传统的 SLIRP 用户态后端。原文说明,passt 主进程不需要 capability 或特权;它在独立于 QEMU 的守护进程中运行,并提供完整 IPv6 支持。原文还描述了相对传统 -net user 的性能与安全优势;本文没有进行基准测试,独立进程也不等于所有部署都自动安全。
连接方式有三类:让 QEMU 通过 -net passt、-netdev passt 或 -nic passt 管理后端;手工启动 passt 后通过 -netdev stream 连接 UNIX socket;或通过 -netdev vhost-user 连接。手工使用 stream / vhost-user 可接触直接 passt 后端尚未提供的功能,例如相关迁移能力。详细参数见 passt(1)。
让 QEMU 自动启动 passt
直接使用 passt 后端时,不必先启动守护进程,QEMU 会代为启动。默认是基于 socket 的连接方式:
qemu-system-x86_64 [...OPTIONS...] -nic passt
原文随后展示的 monitor 输出如下。PID、自动生成 ID 与 MAC 都是源文中的示例值,不是本文采集的运行结果:
(qemu) info network
e1000e.0: index=0,type=nic,model=e1000e,macaddr=52:54:00:12:34:56
#net071: index=0,type=passt,stream,connected to pid 24846
使用传统 -net 写法,并给出 TCP、UDP 端口选项:
qemu-system-x86_64 [...OPTIONS...] -net nic -net passt,tcp-ports=10001,udp-ports=10001
(qemu) info network
hub 0
hub0port1: #net136: index=0,type=passt,stream,connected to pid 25204
hub0port0: e1000e.0: index=0,type=nic,model=e1000e,macaddr=52:54:00:12:34:56
这里的端口参数会影响实际网络入口,应按照 passt 对应版本的监听规则与宿主访问策略核实,不能因例子简单就忽略暴露范围。
也可以显式拆分网卡与后端,并用 netdev0 关联:
qemu-system-x86_64 [...OPTIONS...] \
-netdev passt,id=netdev0 \
-device virtio-net,mac=9a:2b:2c:2d:2e:2f,id=virtio0,netdev=netdev0
(qemu) info network
virtio0: index=0,type=nic,model=virtio-net-pci,macaddr=9a:2b:2c:2d:2e:2f
#netdev0: index=0,type=passt,stream,connected to pid 25428
要让直接后端采用 vhost-user 接口,选择 virtio 网卡并增加 vhost-user=on:
qemu-system-x86_64 [...OPTIONS...] -nic passt,model=virtio,vhost-user=on
(qemu) info network
virtio-net-pci.0: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
#net006: index=0,type=passt,vhost-user,connected to pid 25731
版本边界:这些直接 passt 后端例子来自本次读取的 master 文档。采用之前应确认安装的 QEMU 帮助中存在相应后端、系统能找到 passt 二进制,且网卡与选项在该版本受支持。
手工启动,使用 socket 接口
原文先用 passt --socket ~/passt.socket 启动守护进程。若省略 --socket,passt 会打印可供 QEMU 连接的 UNIX socket 路径,例如 /tmp/passt_1.socket、/tmp/passt_2.socket。
然后以 virtio 网卡连接 stream 后端。编者修正:源命令把 ~/passt.socket 嵌在逗号分隔的 addr.path=... 参数中,shell 不保证按普通独立路径那样展开波浪号。以下用自定义变量保存绝对路径,两端引用同一路径:
PASST_SOCKET="$PWD/passt.socket"
passt --socket "$PASST_SOCKET"
qemu-system-x86_64 [...OPTIONS...] \
-device virtio-net-pci,netdev=netdev0 \
-netdev stream,id=netdev0,server=off,addr.type=unix,addr.path="$PASST_SOCKET"
$PWD 是当前工作目录,因此应选择你控制的私有目录,并核实 socket 的所有者与访问权限。这里的路径修正只针对 shell 展开,不代表对来宾启动配置做过验证。QEMU 的逗号分隔选项对包含逗号等特殊字符的路径还有解析要求,本例目录应避免这些字符。
手工启动,使用 vhost-user 接口
为 passt 增加 --vhost-user,再配置 QEMU 的字符设备、vhost-user 网络后端、virtio 网卡和共享内存。下例在保留原结构的基础上,同样更正了 socket 路径,并显式给出一个示例内存变量:
PASST_SOCKET="$PWD/passt.socket"
VM_RAM=2G
passt --vhost-user --socket "$PASST_SOCKET"
qemu-system-x86_64 [...OPTIONS...] \
-m "$VM_RAM" \
-chardev socket,id=chr0,path="$PASST_SOCKET" \
-netdev vhost-user,id=netdev0,chardev=chr0 \
-device virtio-net,netdev=netdev0 \
-object memory-backend-memfd,id=memfd0,share=on,size="$VM_RAM" \
-numa node,memdev=memfd0
原文使用 $RAMSIZE 表示内存大小;这里改名为 VM_RAM 并用 2G 说明参数对应关系,并非推荐所有来宾都使用 2 GiB。-m 与 memory-backend-memfd,size= 必须匹配。共享内存是 vhost-user 的工作边界之一,应仅连接可信的本地后端进程。
五、passt 的迁移与 TCP 连接状态
原文说明,通过 vhost-user 与 QEMU 相连的 passt 可以随 QEMU 迁移,并在相应条件满足时保留网络连接。这不是单纯复制来宾内存就能自动实现的功能。
passt 本身无特权,因此依赖 passt-repair 通过 TCP_REPAIR socket 选项保存和加载 TCP 连接状态。辅助进程需要 CAP_NET_ADMIN capability,或者以 root 运行。没有可用的 passt-repair,就不能保留这些 TCP 连接。所以“passt 无特权”并不意味着整条迁移链都不需要额外权限。
原文的同一宿主迁移示例
以下过程描述同一宿主机上的迁移。原文首先要求管理员给指定 passt-repair 文件设置 capability:
setcap cap_net_admin+eip ./passt-repair
这会改变文件权限属性,使辅助程序具有网络管理能力。只能对来源、完整性、所有权与可写权限都已确认的二进制按环境规范处理;本文没有执行这条命令,也没有把它视为普通无特权配置。
源端启动 passt,指定其与 QEMU 通信的 socket,以及与修复辅助程序通信的 socket:
passt --vhost-user --socket ~/passt_src.socket \
--repair-path ~/passt-repair_src.socket
passt-repair ~/passt-repair_src.socket
--repair-path 指定 passt 与 passt-repair 之间的 UNIX socket;默认值是在主 --socket 路径后追加 .repair。上面波浪号作为独立 shell 参数使用,与此前嵌在 path=... 子参数中的情况不同。实际部署仍可统一使用绝对路径。
源端 QEMU 使用前述 vhost-user 参数,并打开 monitor,以便输入迁移命令:
qemu-system-x86_64 [...OPTIONS...] [...VHOST USER OPTIONS...] -monitor stdio
随后准备目标端的 passt 与 passt-repair:
passt --vhost-user --socket ~/passt_dst.socket \
--repair-path ~/passt-repair_dst.socket
passt-repair ~/passt-repair_dst.socket
目标端 QEMU 使用目标端 socket 对应的 vhost-user 参数,并监听传入迁移:
qemu-system-x86_64 [...OPTIONS...] [...VHOST USER OPTIONS...] -incoming tcp:localhost:4444
最后在源端 QEMU monitor 中发出:
(qemu) migrate tcp:localhost:4444
源文没有展开全部 [...VHOST USER OPTIONS...];它们应与上一节的字符设备、网络后端、网卡及共享内存结构对应,且源端与目标端分别连接自己的 socket,内存设置一致。不能把省略记号当成实际启动参数。
每一次迁移都需要新的 passt-repair 实例;失败后重试,也应重新启动它。这里的 localhost:4444 仅用于同机说明,没有提供跨宿主网络地址、路由延续、迁移通道认证或加密的完整部署方案。不能把监听地址直接换成公网地址,就认为已有可安全上线的远程迁移流程。
六、虚拟 hub 与多个 QEMU 实例
QEMU 可以模拟多个 hub。可以把 hub 理解为多个网络设备之间的虚拟连接点,其中既可包含来宾虚拟网卡,也可包含 TAP 等宿主网络后端。
使用 -netdev hubport 或 -nic hubport 可以将网卡或后端接入相应 hub。旧的 -net 写法默认把给定设备接入 ID 为 0 的 hub,除非用 -net nic,netdev=xxx 明确指定了后端。因此在阅读旧命令时,要注意它可能隐式引入 hub。
要让模拟网络跨越多个 QEMU 实例,可以使用 -netdev socket,或其 -nic socket、-net socket 形式。具体连接示例见官方 Invocation 中的 socket 后端说明。这种连接负责网络传输,不应默认视为已提供跨宿主的认证与加密。
来源、许可与变更说明
来源与作者归属:QEMU 系统模拟手册:Network emulation及 QEMU 文档贡献者。QEMU 与该手册按 GNU General Public License,version 2 发布;许可证全文保留在下方。QEMU 是 Fabrice Bellard 的商标。
本中文译写及相应修改于 2026-10-05 完成,保留 GPL v2 许可与无担保性质。修改包括:标示 master/11.1.50 版本边界和历史 Windows 段落;把嵌入参数中的波浪号路径改为明确展开的变量;补充回环监听的 hostfwd 参数片段、共享内存与迁移权限说明。
本次只做静态审核。没有执行 ping_group_range 写入、setcap、QEMU/passt 启动、网络连通性测试或迁移,也未测量性能。未发现示例含实际硬编码秘密或输入注入;这不代表宿主配置、二进制和服务不存在漏洞。
原始版权与许可全文
© Copyright 2026, The QEMU Project Developers.
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.












暂无评论内容