From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQSj2-0002ZM-UM for qemu-devel@nongnu.org; Tue, 24 Feb 2015 22:33:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQSix-0000T2-W8 for qemu-devel@nongnu.org; Tue, 24 Feb 2015 22:33:28 -0500 Received: from [59.151.112.132] (port=27115 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQSix-0000Sb-IG for qemu-devel@nongnu.org; Tue, 24 Feb 2015 22:33:23 -0500 From: Chen Fan Date: Wed, 25 Feb 2015 11:26:38 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [RFC 0/2] qemu-ga: add guest-network-set-interface command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: izumi.taku@jp.fujitsu.com Nowadays, qemu has supported physical NIC hotplug for high network throughput. but it's in conflict with live migration feature, to keep network connectivity, we could to create bond device interface which provides a mechanism for enslaving multiple network interfaces into a single "bond" interface. the active-backup mode can be used for an automatic switch. so this patch is adding a guest-network-set-interface command for creating bond device. so the management can easy to create a bond device dynamically when guest running. we can specify: add interface: {"execute":"guest-network-set-interface", "arguments": {"interface": {"type":"bond", "name":"bond0", "onboot":"onboot", "options":"mode=active-backup primary=eth1 miimon=100 updelay=10 use_carrier=ioctl", "ip-address": {"ip-address":"192.168.122.89", "ip-address-type":"ipv4", "prefix":24, "gateway":"192.168.122.1"}, "subInterfaces":[{"name":"eth0"}, {"name":"eth1"}]}}} delete interface: {"execute":"guest-network-delete-interface", "arguments":{"name":"bond0"}} Note: this patch has introduces netcf lib for create interfaces. because the netcf provides a convenient facility for programs that want to shield themselves from the intricacies of networking setup. on different environment, creating bonding device is distinct. On Fedora/Redhat, that requires modifying the files ifcfg-eth0, ifcfg-eth1 and ifcfg-bond0 in /etc/sysconfig/network-scripts; on Debian, it requires changing several entries in /etc/network/interfaces. Chen Fan (2): qemu-agent: add guest-network-set-interface command qemu-agent: add guest-network-delete-interface command configure | 16 +++ qga/commands-posix.c | 312 +++++++++++++++++++++++++++++++++++++++++++++++++++ qga/commands-win32.c | 13 +++ qga/qapi-schema.json | 65 +++++++++++ 4 files changed, 406 insertions(+) -- 1.9.3