On Fri, 2024-01-26 at 12:10 +0100, Thomas Huth wrote:
+/* "Please create a device, if you have a configuration for it" */
+DeviceState *qemu_create_nic_device(const char *typename, bool match_default,
+ const char *alias)
+{
+ NICInfo *nd = qemu_find_nic_info(typename, match_default, alias);
+ DeviceState *dev;
+
+ if (!nd) {
+ return NULL;
+ }
The qemu_check_nic_model() function that was used in some code that you
turned into qemu_create_nic_device() used to set:
if (!nd->model)
nd->model = g_strdup(default_model);
(in the qemu_find_nic_model() function that has been called by
qemu_check_nic_model())
Should we do that also here to make sure that nd->model is not NULL afterwards?
Good question, but I don't think we care. The qdev_set_nic_properties()
function certainly doesn't propagate nd->model to anywhere.
I renamed nd->model to nd->modelname in a patch shown below, just to be
100% sure I'm not missing any other code paths which might consume it.