[libvirt] [PATCH 1/2] virsh: Add option 'model' for attach-interface

Allows to specify the NIC model type when attaching an interface, it's an optional option. --- tools/virsh.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 3e37b06..2da9489 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -8292,6 +8292,7 @@ static const vshCmdOptDef opts_attach_interface[] = { {"target", VSH_OT_DATA, 0, N_("target network name")}, {"mac", VSH_OT_DATA, 0, N_("MAC address")}, {"script", VSH_OT_DATA, 0, N_("script used to bridge network interface")}, + {"model", VSH_OT_DATA, 0, N_("model type")}, {"persistent", VSH_OT_BOOL, 0, N_("persist interface attachment")}, {NULL, 0, 0, NULL} }; @@ -8300,7 +8301,7 @@ static int cmdAttachInterface(vshControl *ctl, const vshCmd *cmd) { virDomainPtr dom = NULL; - char *mac, *target, *script, *type, *source; + char *mac, *target, *script, *type, *source, *model; int typ, ret = FALSE; unsigned int flags; virBuffer buf = VIR_BUFFER_INITIALIZER; @@ -8319,6 +8320,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd) target = vshCommandOptString(cmd, "target", NULL); mac = vshCommandOptString(cmd, "mac", NULL); script = vshCommandOptString(cmd, "script", NULL); + model = vshCommandOptString(cmd, "model", NULL); /* check interface type */ if (STREQ(type, "network")) { @@ -8345,6 +8347,8 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd) virBufferVSprintf(&buf, " <mac address='%s'/>\n", mac); if (script != NULL) virBufferVSprintf(&buf, " <script path='%s'/>\n", script); + if (model != NULL) + virBufferVSprintf(&buf, " <model type='%s'/>\n", model); virBufferAddLit(&buf, "</interface>\n"); -- 1.7.1

On Mon, Oct 25, 2010 at 08:00:23PM +0800, Osier Yang wrote:
Allows to specify the NIC model type when attaching an interface, it's an optional option. --- tools/virsh.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
Okay, though we are in feature freeze I consider this a bug, we forgot to add this option to this command, since this doesn't touch any interface and can't really introduce regressions, I think it's fine to push such a fix now. Patches looks fine too, so I pushed both to git, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

----- "Daniel Veillard" <veillard@redhat.com> wrote:
On Mon, Oct 25, 2010 at 08:00:23PM +0800, Osier Yang wrote:
Allows to specify the NIC model type when attaching an interface, it's an optional option. --- tools/virsh.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
Okay, though we are in feature freeze I consider this a bug, we forgot to add this option to this command, since this doesn't touch any interface and can't really introduce regressions, I think it's fine to push such a fix now. Patches looks fine too, so I pushed both to git,
thanks, DV. - Osier
thanks !
Daniel
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel Veillard
-
Osier
-
Osier Yang