/* Returns a pointer to the first element of dest (or the newly allocated copy)  */
QEMUOptionParameter* append_option_parameters(QEMUOptionParameter *dest, QEMUOptionParameter *list)
/* Returns a pointer to the first element of dest (or the newly allocated copy)  */
QEMUOptionParameter* append_option_parameters(QEMUOptionParameter *dest, QEMUOptionParameter *list)
{
    size_t num_options, num_dest_options;
    num_options = count_option_parameters(dest);
    num_dest_options = num_options;
    num_options += count_option_parameters(list);
    dest = g_realloc(dest, (num_options + 1) * sizeof(QEMUOptionParameter));
    dest[num_dest_options].name = NULL;
    while (list && list->name) {
        if (get_option_parameter(dest, list->name) == NULL) {
            dest[num_dest_options++] = *list;
            dest[num_dest_options].name = NULL;
        }
        list++;
    }
    return dest;
}