mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
virsh: Add option 'model' for attach-interface
* tools/virsh.c: add missing option from the CLI to allows setting up the NIC model type when attaching an interface * tools/virsh.pod: extend documentation * AUTHORS: add Osier Yang to the list
This commit is contained in:
parent
69b7552154
commit
1a29a14a2f
1
AUTHORS
1
AUTHORS
@ -133,6 +133,7 @@ Patches have also been contributed by:
|
|||||||
Lai Jiangshan <laijs@cn.fujitsu.com>
|
Lai Jiangshan <laijs@cn.fujitsu.com>
|
||||||
Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
|
Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
|
||||||
John Morrissey <jwm@horde.net>
|
John Morrissey <jwm@horde.net>
|
||||||
|
Osier Yang <jyang@redhat.com>
|
||||||
|
|
||||||
[....send patches to get your name here....]
|
[....send patches to get your name here....]
|
||||||
|
|
||||||
|
@ -8292,6 +8292,7 @@ static const vshCmdOptDef opts_attach_interface[] = {
|
|||||||
{"target", VSH_OT_DATA, 0, N_("target network name")},
|
{"target", VSH_OT_DATA, 0, N_("target network name")},
|
||||||
{"mac", VSH_OT_DATA, 0, N_("MAC address")},
|
{"mac", VSH_OT_DATA, 0, N_("MAC address")},
|
||||||
{"script", VSH_OT_DATA, 0, N_("script used to bridge network interface")},
|
{"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")},
|
{"persistent", VSH_OT_BOOL, 0, N_("persist interface attachment")},
|
||||||
{NULL, 0, 0, NULL}
|
{NULL, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
@ -8300,7 +8301,7 @@ static int
|
|||||||
cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
|
cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
|
||||||
{
|
{
|
||||||
virDomainPtr dom = NULL;
|
virDomainPtr dom = NULL;
|
||||||
char *mac, *target, *script, *type, *source;
|
char *mac, *target, *script, *type, *source, *model;
|
||||||
int typ, ret = FALSE;
|
int typ, ret = FALSE;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
@ -8319,6 +8320,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
|
|||||||
target = vshCommandOptString(cmd, "target", NULL);
|
target = vshCommandOptString(cmd, "target", NULL);
|
||||||
mac = vshCommandOptString(cmd, "mac", NULL);
|
mac = vshCommandOptString(cmd, "mac", NULL);
|
||||||
script = vshCommandOptString(cmd, "script", NULL);
|
script = vshCommandOptString(cmd, "script", NULL);
|
||||||
|
model = vshCommandOptString(cmd, "model", NULL);
|
||||||
|
|
||||||
/* check interface type */
|
/* check interface type */
|
||||||
if (STREQ(type, "network")) {
|
if (STREQ(type, "network")) {
|
||||||
@ -8345,6 +8347,8 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
|
|||||||
virBufferVSprintf(&buf, " <mac address='%s'/>\n", mac);
|
virBufferVSprintf(&buf, " <mac address='%s'/>\n", mac);
|
||||||
if (script != NULL)
|
if (script != NULL)
|
||||||
virBufferVSprintf(&buf, " <script path='%s'/>\n", script);
|
virBufferVSprintf(&buf, " <script path='%s'/>\n", script);
|
||||||
|
if (model != NULL)
|
||||||
|
virBufferVSprintf(&buf, " <model type='%s'/>\n", model);
|
||||||
|
|
||||||
virBufferAddLit(&buf, "</interface>\n");
|
virBufferAddLit(&buf, "</interface>\n");
|
||||||
|
|
||||||
|
@ -647,7 +647,7 @@ although this use only replaces the media within the existing virtual cdrom or
|
|||||||
floppy device; consider using B<update-device> for this usage instead.
|
floppy device; consider using B<update-device> for this usage instead.
|
||||||
I<mode> can specify the two specific mode I<readonly> or I<shareable>.
|
I<mode> can specify the two specific mode I<readonly> or I<shareable>.
|
||||||
|
|
||||||
=item B<attach-interface> I<domain-id> I<type> I<source> optional I<--target target> I<--mac mac> I<--script script>
|
=item B<attach-interface> I<domain-id> I<type> I<source> optional I<--target target> I<--mac mac> I<--script script> I<--model model> I<--persistent>
|
||||||
|
|
||||||
Attach a new network interface to the domain.
|
Attach a new network interface to the domain.
|
||||||
I<type> can be either I<network> to indicate a physical network device or I<bridge> to indicate a bridge to a device.
|
I<type> can be either I<network> to indicate a physical network device or I<bridge> to indicate a bridge to a device.
|
||||||
@ -656,6 +656,8 @@ I<target> allows to indicate the target device in the guest.
|
|||||||
I<mac> allows to specify the MAC address of the network interface.
|
I<mac> allows to specify the MAC address of the network interface.
|
||||||
I<script> allows to specify a path to a script handling a bridge instead of
|
I<script> allows to specify a path to a script handling a bridge instead of
|
||||||
the default one.
|
the default one.
|
||||||
|
I<model> allows to specify the model type.
|
||||||
|
I<persistent> indicates the changes will affect the next boot of the domain.
|
||||||
|
|
||||||
=item B<detach-device> I<domain-id> I<FILE>
|
=item B<detach-device> I<domain-id> I<FILE>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user