Hi,

> Subject: Re: [PATCH v9 05/30] bootindex: rework add_boot_device_path
> function
> 
> > +static void del_original_boot_device(DeviceState *dev, const char *suffix)
> 
> Hmm, now we have two simliar delete functions.  One which deletes all
> entries belonging to a device, and one deleting only in case the suffix
> matches (the later being needed to handle the floppy case I guess?).
> 
Yes.

> Can't we combine the two into one, to avoid code duplication?

Yes, we can. :)

> For example by deleting all entries for a device in case suffix == NULL?
> 
Good point. When we hot-unplug a device we can pass 'suffix == NULL'
to del_original_boot_device(DeviceState *dev, const char *suffix), and
then remove all entries belonging to this device.

Thanks! Will rework it.

Best regards,
-Gonglei

Reply via email to