提交 4ff60912 编写于 作者: P Pritesh Kothari 提交者: Daniel Veillard

VBox support for defining/dumping video devices

* src/vbox/vbox_tmpl.c: add setting of video and acceleration in
  VBox driver, and the ability to save this back for serialization
上级 6aa576cd
......@@ -1750,6 +1750,33 @@ static char *vboxDomainDumpXML(virDomainPtr dom, int flags) {
* so locatime is always true here */
def->localtime = 1;
/* dump video options vram/2d/3d/directx/etc. */
{
/* Currently supports only one graphics card */
def->nvideos = 1;
if (VIR_ALLOC_N(def->videos, def->nvideos) >= 0) {
if (VIR_ALLOC(def->videos[0]) >= 0) {
/* the default is: vram is 8MB, One monitor, 3dAccel Off */
PRUint32 VRAMSize = 8 * 1024;
PRUint32 monitorCount = 1;
PRBool accelerate3DEnabled = PR_FALSE;
machine->vtbl->GetVRAMSize(machine, &VRAMSize);
machine->vtbl->GetMonitorCount(machine, &monitorCount);
machine->vtbl->GetAccelerate3DEnabled(machine, &accelerate3DEnabled);
def->videos[0]->type = VIR_DOMAIN_VIDEO_TYPE_VBOX;
def->videos[0]->vram = VRAMSize;
def->videos[0]->heads = monitorCount;
if (VIR_ALLOC(def->videos[0]->accel)) {
def->videos[0]->accel->support3d = accelerate3DEnabled;
/* Not supported yet, but should be in 3.1 soon */
def->videos[0]->accel->support2d = 0;
}
}
}
}
/* dump display options vrdp/gui/sdl */
{
int vrdpPresent = 0;
......@@ -3536,6 +3563,17 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml) {
}
} /* Finished:Block to attach the Parallel Port to the VM */
{ /* Started:Block to specify video card settings */
if ((def->nvideos == 1) && (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_VBOX)) {
machine->vtbl->SetVRAMSize(machine, def->videos[0]->vram);
machine->vtbl->SetMonitorCount(machine, def->videos[0]->heads);
if (def->videos[0]->accel)
machine->vtbl->SetAccelerate3DEnabled(machine, def->videos[0]->accel->support3d);
else
machine->vtbl->SetAccelerate3DEnabled(machine, 0);
}
} /* Finished:Block to specify video card settings */
{ /* Started:Block to attach the Remote Display to VM */
int vrdpPresent = 0;
int sdlPresent = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册