type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | void vm_state_notify(int running, RunState state)
{
VMChangeStateEntry *e, *next;
trace_vm_state_notify(running, state);
QLIST_FOREACH_SAFE(e, &vm_change_state_head, entries, next) {
e->cb(e->opaque, running, state);
} |
functions | int qemu_shutdown_requested_get(void)
{
return shutdown_requested;
} |
functions | int qemu_reset_requested_get(void)
{
return reset_requested;
} |
functions | int qemu_shutdown_requested(void)
{
return atomic_xchg(&shutdown_requested, 0);
} |
functions | void qemu_kill_report(void)
{
if (!qtest_driver() && shutdown_signal != -1) {
fprintf(stderr, "qemu: terminating on signal %d", shutdown_signal);
if (shutdown_pid == 0) {
/* This happens for eg ^C at the terminal, so it's worth
* avoiding printing an odd message in that case... |
functions | int qemu_reset_requested(void)
{
int r = reset_requested;
reset_requested = 0;
return r;
} |
functions | int qemu_suspend_requested(void)
{
int r = suspend_requested;
suspend_requested = 0;
return r;
} |
functions | WakeupReason qemu_wakeup_requested(void)
{
return wakeup_reason;
} |
functions | int qemu_powerdown_requested(void)
{
int r = powerdown_requested;
powerdown_requested = 0;
return r;
} |
functions | int qemu_debug_requested(void)
{
int r = debug_requested;
debug_requested = 0;
return r;
} |
functions | void qemu_register_reset(QEMUResetHandler *func, void *opaque)
{
QEMUResetEntry *re = g_malloc0(sizeof(QEMUResetEntry));
re->func = func;
re->opaque = opaque;
QTAILQ_INSERT_TAIL(&reset_handlers, re, entry);
} |
functions | void qemu_unregister_reset(QEMUResetHandler *func, void *opaque)
{
QEMUResetEntry *re;
QTAILQ_FOREACH(re, &reset_handlers, entry) {
if (re->func == func && re->opaque == opaque) {
QTAILQ_REMOVE(&reset_handlers, re, entry);
g_free(re);
return;
} |
functions | void qemu_devices_reset(void)
{
QEMUResetEntry *re, *nre;
/* reset all devices */
QTAILQ_FOREACH_SAFE(re, &reset_handlers, entry, nre) {
re->func(re->opaque);
} |
functions | void qemu_system_reset(bool report)
{
MachineClass *mc;
mc = current_machine ? MACHINE_GET_CLASS(current_machine) : NULL;
if (mc && mc->reset) {
mc->reset();
} |
functions | void qemu_system_reset_request(void)
{
if (no_reboot) {
shutdown_requested = 1;
} |
functions | void qemu_system_suspend(void)
{
pause_all_vcpus();
notifier_list_notify(&suspend_notifiers, NULL);
runstate_set(RUN_STATE_SUSPENDED);
qapi_event_send_suspend(&error_abort);
} |
functions | void qemu_system_suspend_request(void)
{
if (runstate_check(RUN_STATE_SUSPENDED)) {
return;
} |
functions | void qemu_register_suspend_notifier(Notifier *notifier)
{
notifier_list_add(&suspend_notifiers, notifier);
} |
functions | void qemu_system_wakeup_request(WakeupReason reason)
{
trace_system_wakeup_request(reason);
if (!runstate_check(RUN_STATE_SUSPENDED)) {
return;
} |
functions | void qemu_system_wakeup_enable(WakeupReason reason, bool enabled)
{
if (enabled) {
wakeup_reason_mask |= (1 << reason);
} |
functions | void qemu_register_wakeup_notifier(Notifier *notifier)
{
notifier_list_add(&wakeup_notifiers, notifier);
} |
functions | void qemu_system_killed(int signal, pid_t pid)
{
shutdown_signal = signal;
shutdown_pid = pid;
no_shutdown = 0;
qemu_system_shutdown_request();
} |
functions | void qemu_system_shutdown_request(void)
{
trace_qemu_system_shutdown_request();
shutdown_requested = 1;
qemu_notify_event();
} |
functions | void qemu_system_powerdown(void)
{
qapi_event_send_powerdown(&error_abort);
notifier_list_notify(&powerdown_notifiers, NULL);
} |
functions | void qemu_system_powerdown_request(void)
{
trace_qemu_system_powerdown_request();
powerdown_requested = 1;
qemu_notify_event();
} |
functions | void qemu_register_powerdown_notifier(Notifier *notifier)
{
notifier_list_add(&powerdown_notifiers, notifier);
} |
functions | void qemu_system_debug_request(void)
{
debug_requested = 1;
qemu_notify_event();
} |
functions | bool main_loop_should_exit(void)
{
RunState r;
if (qemu_debug_requested()) {
vm_stop(RUN_STATE_DEBUG);
} |
functions | void main_loop(void)
{
bool nonblocking;
int last_io = 0;
#ifdef CONFIG_PROFILER
int64_t ti;
#endif
do {
nonblocking = !kvm_enabled() && !xen_enabled() && last_io > 0;
#ifdef CONFIG_PROFILER
ti = profile_getclock();
#endif
last_io = main_loop_wait(nonblocking);
#ifdef CONFIG_PROF... |
functions | void version(void)
{
printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n");
} |
functions | void help(int exitcode)
{
version();
printf("usage: %s [options] [disk_image]\n\n"
"'disk_image' is a raw hard disk image for IDE hard disk 0\n\n",
error_get_progname());
#include "qemu-options-wrapper.h"
printf("\nDuring emulation, the following keys are useful:\n"
"ctrl... |
functions | bool vga_available(void)
{
return object_class_by_name("VGA") || object_class_by_name("isa-vga");
} |
functions | bool cirrus_vga_available(void)
{
return object_class_by_name("cirrus-vga")
|| object_class_by_name("isa-cirrus-vga");
} |
functions | bool vmware_vga_available(void)
{
return object_class_by_name("vmware-svga");
} |
functions | bool qxl_vga_available(void)
{
return object_class_by_name("qxl-vga");
} |
functions | bool tcx_vga_available(void)
{
return object_class_by_name("SUNW,tcx");
} |
functions | bool cg3_vga_available(void)
{
return object_class_by_name("cgthree");
} |
functions | void select_vgahw (const char *p)
{
const char *opts;
assert(vga_interface_type == VGA_NONE);
if (strstart(p, "std", &opts)) {
if (vga_available()) {
vga_interface_type = VGA_STD;
} |
functions | DisplayType select_display(const char *p)
{
const char *opts;
DisplayType display = DT_DEFAULT;
if (strstart(p, "sdl", &opts)) {
#ifdef CONFIG_SDL
display = DT_SDL;
while (*opts) {
const char *nextopt;
if (strstart(opts, ",frame=", &nextopt)) {
opts ... |
functions | int balloon_parse(const char *arg)
{
QemuOpts *opts;
if (strcmp(arg, "none") == 0) {
return 0;
} |
functions | int device_help_func(QemuOpts *opts, void *opaque)
{
return qdev_device_help(opts);
} |
functions | int device_init_func(QemuOpts *opts, void *opaque)
{
DeviceState *dev;
dev = qdev_device_add(opts);
if (!dev)
return -1;
object_unref(OBJECT(dev));
return 0;
} |
functions | int chardev_init_func(QemuOpts *opts, void *opaque)
{
Error *local_err = NULL;
qemu_chr_new_from_opts(opts, NULL, &local_err);
if (local_err) {
error_report("%s", error_get_pretty(local_err));
error_free(local_err);
return -1;
} |
functions | int fsdev_init_func(QemuOpts *opts, void *opaque)
{
int ret;
ret = qemu_fsdev_add(opts);
return ret;
} |
functions | int mon_init_func(QemuOpts *opts, void *opaque)
{
CharDriverState *chr;
const char *chardev;
const char *mode;
int flags;
mode = qemu_opt_get(opts, "mode");
if (mode == NULL) {
mode = "readline";
} |
functions | void monitor_parse(const char *optarg, const char *mode)
{
static int monitor_device_index = 0;
QemuOpts *opts;
const char *p;
char label[32];
int def = 0;
if (strstart(optarg, "chardev:", &p)) {
snprintf(label, sizeof(label), "%s", p);
} |
functions | void add_device_config(int type, const char *cmdline)
{
struct device_config *conf;
conf = g_malloc0(sizeof(*conf));
conf->type = type;
conf->cmdline = cmdline;
loc_save(&conf->loc);
QTAILQ_INSERT_TAIL(&device_configs, conf, next);
} |
functions | int serial_parse(const char *devname)
{
static int index = 0;
char label[32];
if (strcmp(devname, "none") == 0)
return 0;
if (index == MAX_SERIAL_PORTS) {
fprintf(stderr, "qemu: too many serial ports\n");
exit(1);
} |
functions | int parallel_parse(const char *devname)
{
static int index = 0;
char label[32];
if (strcmp(devname, "none") == 0)
return 0;
if (index == MAX_PARALLEL_PORTS) {
fprintf(stderr, "qemu: too many parallel ports\n");
exit(1);
} |
functions | int virtcon_parse(const char *devname)
{
QemuOptsList *device = qemu_find_opts("device");
static int index = 0;
char label[32];
QemuOpts *bus_opts, *dev_opts;
if (strcmp(devname, "none") == 0)
return 0;
if (index == MAX_VIRTIO_CONSOLES) {
fprintf(stderr, "qemu: too many virtio c... |
functions | int sclp_parse(const char *devname)
{
QemuOptsList *device = qemu_find_opts("device");
static int index = 0;
char label[32];
QemuOpts *dev_opts;
if (strcmp(devname, "none") == 0) {
return 0;
} |
functions | int debugcon_parse(const char *devname)
{
QemuOpts *opts;
if (!qemu_chr_new("debugcon", devname, NULL)) {
exit(1);
} |
functions | gint machine_class_cmp(gconstpointer a, gconstpointer b)
{
const MachineClass *mc1 = a, *mc2 = b;
int res;
if (mc1->family == NULL) {
if (mc2->family == NULL) {
/* Compare standalone machine types against each other; they sort
* in increasing order.
*/
... |
functions | void qemu_add_exit_notifier(Notifier *notify)
{
notifier_list_add(&exit_notifiers, notify);
} |
functions | void qemu_remove_exit_notifier(Notifier *notify)
{
notifier_remove(notify);
} |
functions | void qemu_run_exit_notifiers(void)
{
notifier_list_notify(&exit_notifiers, NULL);
} |
functions | void qemu_add_machine_init_done_notifier(Notifier *notify)
{
notifier_list_add(&machine_init_done_notifiers, notify);
} |
functions | void qemu_run_machine_init_done_notifiers(void)
{
notifier_list_notify(&machine_init_done_notifiers, NULL);
} |
functions | gpointer malloc_and_trace(gsize n_bytes)
{
void *ptr = malloc(n_bytes);
trace_g_malloc(n_bytes, ptr);
return ptr;
} |
functions | gpointer realloc_and_trace(gpointer mem, gsize n_bytes)
{
void *ptr = realloc(mem, n_bytes);
trace_g_realloc(mem, n_bytes, ptr);
return ptr;
} |
functions | void free_and_trace(gpointer mem)
{
trace_g_free(mem);
free(mem);
} |
functions | int machine_set_property(const char *name, const char *value,
void *opaque)
{
Object *obj = OBJECT(opaque);
StringInputVisitor *siv;
Error *local_err = NULL;
char *c, *qom_name;
if (strcmp(name, "type") == 0) {
return 0;
} |
functions | int object_create(QemuOpts *opts, void *opaque)
{
Error *err = NULL;
char *type = NULL;
char *id = NULL;
void *dummy = NULL;
OptsVisitor *ov;
QDict *pdict;
ov = opts_visitor_new(opts);
pdict = qemu_opts_to_qdict(opts, NULL);
visit_start_struct(opts_get_visitor(ov), &dummy, NULL, NU... |
functions | int main(int argc, char **argv, char **envp)
{
int i;
int snapshot, linux_boot;
const char *initrd_filename;
const char *kernel_filename, *kernel_cmdline;
const char *boot_order;
DisplayState *ds;
int cyls, heads, secs, translation;
QemuOpts *hda_opts = NULL, *opts, *machine_opts, *icoun... |
functions | else if (*p != '\0') {
chs_fail:
fprintf(stderr, "qemu: invalid physical CHS format\n");
exit(1);
} |
functions | else if (translation == BIOS_ATA_TRANSLATION_RECHS) {
qemu_opt_set(hda_opts, "trans", "rechs");
} |
functions | else if (translation == BIOS_ATA_TRANSLATION_LBA) {
qemu_opt_set(hda_opts, "trans", "lba");
} |
functions | else if (translation == BIOS_ATA_TRANSLATION_NONE) {
qemu_opt_set(hda_opts, "trans", "none");
} |
functions | else if (*p == '\0') {
depth = graphic_depth;
} |
functions | endif
if (machine_class == NULL) {
fprintf(stderr, "No machine specified, and there is no default.\n"
"Use -machine help to list supported machines!\n");
exit(1);
} |
functions | CONFIG_CURSES
if (display_type == DT_CURSES) {
fprintf(stderr, "curses display can not be used with -daemonize\n");
exit(1);
} |
functions | else if (default_virtcon && default_monitor) {
add_device_config(DEV_VIRTCON, "mon:stdio");
} |
functions | else if (default_sclp && default_monitor) {
add_device_config(DEV_SCLP, "mon:stdio");
} |
functions | else if (bios_name) {
semihosting_argv[0] = bios_name;
} |
functions | CONFIG_SPICE
if (using_spice) {
qemu_spice_display_init();
} |
functions | else if (autostart) {
vm_start();
} |
main | int main(int argc, char **argv)
{
return qemu_main(argc, argv, NULL);
} |
includes |
#include <linux/crypto.h> |
includes | #include <linux/module.h> |
includes | #include <linux/kernel.h> |
includes | #include <linux/types.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/socket.h> |
includes | #include <linux/string.h> |
includes | #include <linux/net.h> |
includes | #include <linux/skbuff.h> |
includes | #include <linux/pfkeyv2.h> |
includes | #include <linux/ipsec.h> |
includes | #include <linux/init.h> |
includes | #include <linux/security.h> |
includes | #include <net/sock.h> |
includes | #include <net/xfrm.h> |
includes | #include <net/netlink.h> |
includes | #include <net/ah.h> |
includes | #include <asm/uaccess.h> |
includes | #include <linux/in6.h> |
defines |
#define XMSGSIZE(type) sizeof(struct type) |
structs | struct xfrm_dump_info {
struct sk_buff *in_skb;
struct sk_buff *out_skb;
u32 nlmsg_seq;
u16 nlmsg_flags;
}; |
functions | int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type)
{
struct nlattr *rt = attrs[type];
struct xfrm_algo *algp;
if (!rt)
return 0;
algp = nla_data(rt);
if (nla_len(rt) < xfrm_alg_len(algp))
return -EINVAL;
switch (type) {
case XFRMA_ALG_AUTH:
case XFRMA_ALG_CRYPT:
case XFRMA_ALG_COMP:
... |
functions | int verify_auth_trunc(struct nlattr **attrs)
{
struct nlattr *rt = attrs[XFRMA_ALG_AUTH_TRUNC];
struct xfrm_algo_auth *algp;
if (!rt)
return 0;
algp = nla_data(rt);
if (nla_len(rt) < xfrm_alg_auth_len(algp))
return -EINVAL;
algp->alg_name[CRYPTO_MAX_ALG_NAME - 1] = '\0';
return 0;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.