qdev_prop_exists(dev, "vectors")) {
qdev_prop_set_uint32(dev, "vectors", nd->nvectors);
}
+ nd->instantiated = 1;
}
BusState *qdev_get_child_bus(DeviceState *dev, const char *name)
{
VLANState *vlan;
VLANClientState *vc;
+ int i;
/* Don't warn about the default network setup that you get if
* no command line -net or -netdev options are specified. There
vc->name);
}
}
+
+ /* Check that all NICs requested via -net nic actually got created.
+ * NICs created via -device don't need to be checked here because
+ * they are always instantiated.
+ */
+ for (i = 0; i < MAX_NICS; i++) {
+ NICInfo *nd = &nd_table[i];
+ if (nd->used && !nd->instantiated) {
+ fprintf(stderr, "Warning: requested NIC (%s, model %s) "
+ "was not created (not supported by this machine?)\n",
+ nd->name ? nd->name : "anonymous",
+ nd->model ? nd->model : "unspecified");
+ }
+ }
}
static int net_init_client(QemuOpts *opts, void *dummy)