qemu-option.c (12c06d6f967a63515399b9e1f6a40f5ce871a8b7) qemu-option.c (7dc847ebba953db90853d15f140c20eef74d4fb2)
1/*
2 * Commandline option parsing functions
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 * Copyright (c) 2009 Kevin Wolf <kwolf@redhat.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 905 unchanged lines hidden (view full) ---

914 const char *value;
915
916 if (!strcmp(key, "id") || *state->errp) {
917 return;
918 }
919
920 switch (qobject_type(obj)) {
921 case QTYPE_QSTRING:
1/*
2 * Commandline option parsing functions
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 * Copyright (c) 2009 Kevin Wolf <kwolf@redhat.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 905 unchanged lines hidden (view full) ---

914 const char *value;
915
916 if (!strcmp(key, "id") || *state->errp) {
917 return;
918 }
919
920 switch (qobject_type(obj)) {
921 case QTYPE_QSTRING:
922 value = qstring_get_str(qobject_to_qstring(obj));
922 value = qstring_get_str(qobject_to(QString, obj));
923 break;
924 case QTYPE_QNUM:
923 break;
924 case QTYPE_QNUM:
925 tmp = qnum_to_string(qobject_to_qnum(obj));
925 tmp = qnum_to_string(qobject_to(QNum, obj));
926 value = tmp;
927 break;
928 case QTYPE_QBOOL:
929 pstrcpy(buf, sizeof(buf),
926 value = tmp;
927 break;
928 case QTYPE_QBOOL:
929 pstrcpy(buf, sizeof(buf),
930 qbool_get_bool(qobject_to_qbool(obj)) ? "on" : "off");
930 qbool_get_bool(qobject_to(QBool, obj)) ? "on" : "off");
931 value = buf;
932 break;
933 default:
934 return;
935 }
936
937 qemu_opt_set(state->opts, key, value, state->errp);
938 g_free(tmp);

--- 258 unchanged lines hidden ---
931 value = buf;
932 break;
933 default:
934 return;
935 }
936
937 qemu_opt_set(state->opts, key, value, state->errp);
938 g_free(tmp);

--- 258 unchanged lines hidden ---