本文整理汇总了C++中qdict_haskey函数的典型用法代码示例。如果您正苦于以下问题:C++ qdict_haskey函数的具体用法?C++ qdict_haskey怎么用?C++ qdict_haskey使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qdict_haskey函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: vxhs_parse_filename
static void vxhs_parse_filename(const char *filename, QDict *options,
Error **errp)
{
if (qdict_haskey(options, "vdisk-id") || qdict_haskey(options, "server")) {
error_setg(errp, "vdisk-id/server and a file name may not be specified "
"at the same time");
return;
}
if (strstr(filename, "://")) {
int ret = vxhs_parse_uri(filename, options);
if (ret < 0) {
error_setg(errp, "Invalid URI. URI should be of the form "
" vxhs://<host_ip>:<port>/<vdisk-id>");
}
}
}
开发者ID:Mellanox,项目名称:qemu,代码行数:17,代码来源:vxhs.c
示例2: do_info_migrate_print
void do_info_migrate_print(Monitor *mon, const QObject *data)
{
QDict *qdict;
qdict = qobject_to_qdict(data);
monitor_printf(mon, "Migration status: %s\n",
qdict_get_str(qdict, "status"));
if (qdict_haskey(qdict, "ram")) {
migrate_print_status(mon, "ram", qdict);
}
if (qdict_haskey(qdict, "disk")) {
migrate_print_status(mon, "disk", qdict);
}
}
开发者ID:daisu-mi,项目名称:qemu,代码行数:17,代码来源:migration.c
示例3: migrate_start_postcopy
static void migrate_start_postcopy(QTestState *who)
{
QDict *rsp;
rsp = wait_command(who, "{ 'execute': 'migrate-start-postcopy' }");
g_assert(qdict_haskey(rsp, "return"));
qobject_unref(rsp);
}
开发者ID:bear987978897,项目名称:qemu,代码行数:8,代码来源:migration-test.c
示例4: test_panic
static void test_panic(void)
{
uint8_t val;
QDict *response, *data;
val = inb(0x505);
g_assert_cmpuint(val, ==, 1);
outb(0x505, 0x1);
response = qmp_receive();
g_assert(qdict_haskey(response, "event"));
g_assert_cmpstr(qdict_get_str(response, "event"), ==, "GUEST_PANICKED");
g_assert(qdict_haskey(response, "data"));
data = qdict_get_qdict(response, "data");
g_assert(qdict_haskey(data, "action"));
g_assert_cmpstr(qdict_get_str(data, "action"), ==, "pause");
}
开发者ID:AmesianX,项目名称:panda,代码行数:18,代码来源:pvpanic-test.c
示例5: read_blocktime
static void read_blocktime(QTestState *who)
{
QDict *rsp, *rsp_return;
rsp = wait_command(who, "{ 'execute': 'query-migrate' }");
rsp_return = qdict_get_qdict(rsp, "return");
g_assert(qdict_haskey(rsp_return, "postcopy-blocktime"));
qobject_unref(rsp);
}
开发者ID:bear987978897,项目名称:qemu,代码行数:9,代码来源:migration-test.c
示例6: process_event
/* handle requests/control events coming in over the channel */
static void process_event(JSONMessageParser *parser, GQueue *tokens)
{
GAState *s = container_of(parser, GAState, parser);
QDict *qdict;
Error *err = NULL;
int ret;
g_assert(s && parser);
g_debug("process_event: called");
qdict = qobject_to_qdict(json_parser_parse_err(tokens, NULL, &err));
if (err || !qdict) {
QDECREF(qdict);
qdict = qdict_new();
if (!err) {
g_warning("failed to parse event: unknown error");
error_setg(&err, QERR_JSON_PARSING);
} else {
g_warning("failed to parse event: %s", error_get_pretty(err));
}
qdict_put_obj(qdict, "error", qmp_build_error_object(err));
error_free(err);
}
/* handle host->guest commands */
if (qdict_haskey(qdict, "execute")) {
process_command(s, qdict);
} else {
if (!qdict_haskey(qdict, "error")) {
QDECREF(qdict);
qdict = qdict_new();
g_warning("unrecognized payload format");
error_setg(&err, QERR_UNSUPPORTED);
qdict_put_obj(qdict, "error", qmp_build_error_object(err));
error_free(err);
}
ret = send_response(s, QOBJECT(qdict));
if (ret < 0) {
g_warning("error sending error response: %s", strerror(-ret));
}
}
QDECREF(qdict);
}
开发者ID:JunaidLoonat,项目名称:qemu,代码行数:45,代码来源:main.c
示例7: archipelago_parse_filename
static void archipelago_parse_filename(const char *filename, QDict *options,
Error **errp)
{
const char *start;
char *volume = NULL, *segment_name = NULL;
xport mport = NoPort, vport = NoPort;
if (qdict_haskey(options, ARCHIPELAGO_OPT_VOLUME)
|| qdict_haskey(options, ARCHIPELAGO_OPT_SEGMENT)
|| qdict_haskey(options, ARCHIPELAGO_OPT_MPORT)
|| qdict_haskey(options, ARCHIPELAGO_OPT_VPORT)) {
error_setg(errp, "volume/mport/vport/segment and a file name may not"
" be specified at the same time");
return;
}
if (!strstart(filename, "archipelago:", &start)) {
error_setg(errp, "File name must start with 'archipelago:'");
return;
}
if (!strlen(start) || strstart(start, "/", NULL)) {
error_setg(errp, "volume name must be specified");
return;
}
parse_filename_opts(filename, errp, &volume, &segment_name, &mport, &vport);
if (volume) {
qdict_put(options, ARCHIPELAGO_OPT_VOLUME, qstring_from_str(volume));
g_free(volume);
}
if (segment_name) {
qdict_put(options, ARCHIPELAGO_OPT_SEGMENT,
qstring_from_str(segment_name));
g_free(segment_name);
}
if (mport != NoPort) {
qdict_put(options, ARCHIPELAGO_OPT_MPORT, qint_from_int(mport));
}
if (vport != NoPort) {
qdict_put(options, ARCHIPELAGO_OPT_VPORT, qint_from_int(vport));
}
}
开发者ID:Acidburn0zzz,项目名称:qemu,代码行数:44,代码来源:archipelago.c
示例8: qdict_haskey_test
static void qdict_haskey_test(void)
{
const char *key = "test";
QDict *tests_dict = qdict_new();
qdict_put(tests_dict, key, qint_from_int(0));
g_assert(qdict_haskey(tests_dict, key) == 1);
QDECREF(tests_dict);
}
开发者ID:AmesianX,项目名称:panda,代码行数:10,代码来源:check-qdict.c
示例9: test_qga_get_vcpus
static void test_qga_get_vcpus(gconstpointer fix)
{
const TestFixture *fixture = fix;
QDict *ret;
QList *list;
const QListEntry *entry;
ret = qmp_fd(fixture->fd, "{'execute': 'guest-get-vcpus'}");
g_assert_nonnull(ret);
qmp_assert_no_error(ret);
/* check there is at least a cpu */
list = qdict_get_qlist(ret, "return");
entry = qlist_first(list);
g_assert(qdict_haskey(qobject_to_qdict(entry->value), "online"));
g_assert(qdict_haskey(qobject_to_qdict(entry->value), "logical-id"));
QDECREF(ret);
}
开发者ID:BinaryAnalysisPlatform,项目名称:qemu,代码行数:19,代码来源:test-qga.c
示例10: do_instruction_trace
void do_instruction_trace(Monitor* monitor, const QDict* qdict)
{
if (target_cr3 != 0) {
return;
}
DECAF_printf("do_instruction_trace\n");
if ((qdict != NULL) && (qdict_haskey(qdict, DICT_KEY_PROCNAME))) {
strncpy(target_name, qdict_get_str(qdict, DICT_KEY_PROCNAME), TARGET_NAME_BUF_SIZE);
target_name_len = strlen(target_name);
}
target_name[TARGET_NAME_BUF_SIZE - 1] = '\0';
}
开发者ID:Oga-Jun,项目名称:decaf1.9,代码行数:12,代码来源:instruction_tracer.c
示例11: test_qga_get_fsinfo
static void test_qga_get_fsinfo(gconstpointer fix)
{
const TestFixture *fixture = fix;
QDict *ret;
QList *list;
const QListEntry *entry;
ret = qmp_fd(fixture->fd, "{'execute': 'guest-get-fsinfo'}");
g_assert_nonnull(ret);
qmp_assert_no_error(ret);
/* check there is at least a fs */
list = qdict_get_qlist(ret, "return");
entry = qlist_first(list);
g_assert(qdict_haskey(qobject_to_qdict(entry->value), "name"));
g_assert(qdict_haskey(qobject_to_qdict(entry->value), "mountpoint"));
g_assert(qdict_haskey(qobject_to_qdict(entry->value), "type"));
g_assert(qdict_haskey(qobject_to_qdict(entry->value), "disk"));
QDECREF(ret);
}
开发者ID:BinaryAnalysisPlatform,项目名称:qemu,代码行数:21,代码来源:test-qga.c
示例12: monitor_print_balloon
void monitor_print_balloon(Monitor *mon, const QObject *data)
{
QDict *qdict;
qdict = qobject_to_qdict(data);
if (!qdict_haskey(qdict, "actual")) {
return;
}
monitor_printf(mon, "balloon: actual=%" PRId64,
qdict_get_int(qdict, "actual") >> 20);
qdict_iter(qdict, print_balloon_stat, mon);
monitor_printf(mon, "\n");
}
开发者ID:AsherBond,项目名称:qemu-kvm,代码行数:13,代码来源:balloon.c
示例13: deprecated_set_speed
static void deprecated_set_speed(QTestState *who, const char *value)
{
QDict *rsp;
gchar *cmd;
cmd = g_strdup_printf("{ 'execute': 'migrate_set_speed',"
"'arguments': { 'value': %s } }", value);
rsp = qtest_qmp(who, cmd);
g_free(cmd);
g_assert(qdict_haskey(rsp, "return"));
qobject_unref(rsp);
migrate_check_parameter(who, "max-bandwidth", value);
}
开发者ID:bear987978897,项目名称:qemu,代码行数:13,代码来源:migration-test.c
示例14: migrate
static void migrate(QTestState *who, const char *uri)
{
QDict *rsp;
gchar *cmd;
cmd = g_strdup_printf("{ 'execute': 'migrate',"
"'arguments': { 'uri': '%s' } }",
uri);
rsp = qtest_qmp(who, cmd);
g_free(cmd);
g_assert(qdict_haskey(rsp, "return"));
qobject_unref(rsp);
}
开发者ID:bear987978897,项目名称:qemu,代码行数:13,代码来源:migration-test.c
示例15: qmp_dispatch
static QObject *test_qmp_dispatch(QDict *req)
{
QDict *resp;
QObject *ret;
resp = qmp_dispatch(&qmp_commands, QOBJECT(req), false);
assert(resp && !qdict_haskey(resp, "error"));
ret = qdict_get(resp, "return");
assert(ret);
qobject_ref(ret);
qobject_unref(resp);
return ret;
}
开发者ID:JayFoxRox,项目名称:xqemu,代码行数:13,代码来源:test-qmp-cmds.c
示例16: test_dispatch_cmd
/* test commands with no input and no return value */
static void test_dispatch_cmd(void)
{
QDict *req = qdict_new();
QDict *resp;
qdict_put_str(req, "execute", "user_def_cmd");
resp = qmp_dispatch(&qmp_commands, QOBJECT(req), false);
assert(resp != NULL);
assert(!qdict_haskey(resp, "error"));
qobject_unref(resp);
qobject_unref(req);
}
开发者ID:JayFoxRox,项目名称:xqemu,代码行数:15,代码来源:test-qmp-cmds.c
示例17: qmp
static QList *device_type_list(bool abstract)
{
QDict *resp;
QList *ret;
resp = qmp("{'execute': 'qom-list-types',"
" 'arguments': {'implements': 'device', 'abstract': %i}}",
abstract);
g_assert(qdict_haskey(resp, "return"));
ret = qdict_get_qlist(resp, "return");
QINCREF(ret);
QDECREF(resp);
return ret;
}
开发者ID:01org,项目名称:qemu-lite,代码行数:14,代码来源:device-introspect-test.c
示例18: qpci_unplug_acpi_device_test
void qpci_unplug_acpi_device_test(QTestState *qts, const char *id, uint8_t slot)
{
QDict *response;
response = qtest_qmp(qts, "{'execute': 'device_del',"
" 'arguments': {'id': %s}}", id);
g_assert(response);
g_assert(!qdict_haskey(response, "error"));
qobject_unref(response);
qtest_outb(qts, ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot);
qtest_qmp_eventwait(qts, "DEVICE_DELETED");
}
开发者ID:OSLL,项目名称:qemu-xtensa,代码行数:14,代码来源:pci-pc.c
示例19: do_taint_sendkey
void do_taint_sendkey(Monitor *mon, const QDict *qdict)
{
// Set the origin and offset for the callback
if(qdict_haskey(qdict, "key") &&
qdict_haskey(qdict, "taint_origin") &&
qdict_haskey(qdict, "offset"))
{
//register keystroke callback
taint_key_enabled=1;
if (!keystroke_cb_handle) {
keystroke_cb_handle = DECAF_register_callback(DECAF_KEYSTROKE_CB,
tracing_send_keystroke, &taint_key_enabled);
}
taint_sendkey_origin = qdict_get_int(qdict, "taint_origin");
taint_sendkey_offset = qdict_get_int(qdict, "offset");
// Send the key
do_send_key(qdict_get_str(qdict, "key"));
}
else
monitor_printf(mon, "taint_sendkey command is malformed\n");
}
开发者ID:xqx12,项目名称:decaf-tfd,代码行数:23,代码来源:tfd.c
示例20: test_qga_get_fsinfo
static void test_qga_get_fsinfo(gconstpointer fix)
{
const TestFixture *fixture = fix;
QDict *ret;
QList *list;
const QListEntry *entry;
ret = qmp_fd(fixture->fd, "{'execute': 'guest-get-fsinfo'}");
g_assert_nonnull(ret);
qmp_assert_no_error(ret);
/* sanity-check the response if there are any filesystems */
list = qdict_get_qlist(ret, "return");
entry = qlist_first(list);
if (entry) {
g_assert(qdict_haskey(qobject_to(QDict, entry->value), "name"));
g_assert(qdict_haskey(qobject_to(QDict, entry->value), "mountpoint"));
g_assert(qdict_haskey(qobject_to(QDict, entry->value), "type"));
g_assert(qdict_haskey(qobject_to(QDict, entry->value), "disk"));
}
qobject_unref(ret);
}
开发者ID:CTU-IIG,项目名称:qemu,代码行数:23,代码来源:test-qga.c
注:本文中的qdict_haskey函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论