xen_machine_pv.c

来自「xen虚拟机源代码安装包」· C语言 代码 · 共 91 行

C
91
字号
/* * QEMU Xen PV Machine * * Copyright (c) 2007 Red Hat * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */#include "hw.h"#include "pc.h"#include "xen_console.h"#include "xenfb.h"#include "sysemu.h"#include "boards.h"extern void init_blktap(void);/* The Xen PV machine currently provides *   - a virtual framebuffer *   - .... */static void xen_init_pv(ram_addr_t ram_size, int vga_ram_size,			const char *boot_device, DisplayState *ds,			const char *kernel_filename,			const char *kernel_cmdline,			const char *initrd_filename,			const char *cpu_model,			const char *direct_pci){    struct xenfb *xenfb;    extern int domid;    CPUState *env;#ifndef CONFIG_STUBDOM    /* Initialize tapdisk client */    init_blktap();#endif    /* Initialize a dummy CPU */    env = cpu_init(NULL);    /* Connect to text console */    if (serial_hds[0]) {        if (xencons_init(domid, serial_hds[0]) < 0) {            fprintf(stderr, "Could not connect to domain console\n");            exit(1);        }    }    /* Prepare PVFB state */    xenfb = xenfb_new(domid, ds);    if (xenfb == NULL) {        fprintf(stderr, "Could not create framebuffer (%s)\n",                strerror(errno));        exit(1);    }}QEMUMachine xenpv_machine = {    "xenpv",    "Xen Para-virtualized PC",    xen_init_pv,    (VGA_RAM_SIZE + BIOS_SIZE) | RAMSIZE_FIXED,};/* * Local variables: *  indent-tabs-mode: nil *  c-indent-level: 4 *  c-basic-offset: 4 *  tab-width: 4 * End: */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?