net: remove id field from NICInfo

Just use the name field instead since we now use the id paramater as
the name, if supplied. Only implication with this change is that if
id is not supplied, the value of the name paramater is used as an
id.

Patchworks-ID: 35512
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Mark McLoughlin 2009-10-08 19:58:22 +01:00 committed by Anthony Liguori
parent 6d952ebedd
commit dea7b3b95a
3 changed files with 2 additions and 7 deletions

View File

@ -857,8 +857,8 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model,
pci_dev = pci_create(bus, devfn, pci_nic_names[i]); pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
dev = &pci_dev->qdev; dev = &pci_dev->qdev;
if (nd->id) if (nd->name)
dev->id = qemu_strdup(nd->id); dev->id = qemu_strdup(nd->name);
dev->nd = nd; dev->nd = nd;
if (qdev_init(dev) < 0) if (qdev_init(dev) < 0)
return NULL; return NULL;

4
net.c
View File

@ -2414,9 +2414,6 @@ static int net_init_nic(QemuOpts *opts, Monitor *mon, const char *name)
if (name) { if (name) {
nd->name = qemu_strdup(name); nd->name = qemu_strdup(name);
} }
if (qemu_opts_id(opts)) {
nd->id = qemu_strdup(qemu_opts_id(opts));
}
if (qemu_opt_get(opts, "model")) { if (qemu_opt_get(opts, "model")) {
nd->model = qemu_strdup(qemu_opt_get(opts, "model")); nd->model = qemu_strdup(qemu_opt_get(opts, "model"));
} }
@ -3032,7 +3029,6 @@ void net_client_uninit(NICInfo *nd)
qemu_free(nd->model); qemu_free(nd->model);
qemu_free(nd->name); qemu_free(nd->name);
qemu_free(nd->devaddr); qemu_free(nd->devaddr);
qemu_free(nd->id);
nd->used = 0; nd->used = 0;
} }

1
net.h
View File

@ -98,7 +98,6 @@ struct NICInfo {
char *model; char *model;
char *name; char *name;
char *devaddr; char *devaddr;
char *id;
VLANState *vlan; VLANState *vlan;
VLANClientState *vc; VLANClientState *vc;
void *private; void *private;