{"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}
};
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;
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")) {
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");
floppy device; consider using B<update-device> for this usage instead.
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.
I<type> can be either I<network> to indicate a physical network device or I<bridge> to indicate a bridge to a device.
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
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>