Update test suite accordingly.
+################################################################################
+## video #######################################################################
+
+def->videos[0]...
+->type = _VIDEO_TYPE_VMVGA
+->vram = <value kilobyte> <=> svga.vramSize = "<value byte>"
+->heads = 1
+
+
+
################################################################################
## serials #####################################################################
/* def:inputs */
/* FIXME */
+ /* def:videos */
+ if (VIR_ALLOC_N(def->videos, 1) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ def->nvideos = 0;
+
+ if (virVMXParseSVGA(conf, &def->videos[def->nvideos]) < 0) {
+ goto cleanup;
+ }
+
+ def->nvideos = 1;
+
/* def:sounds */
/* FIXME */
+int
+virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr *def)
+{
+ int result = -1;
+ long long svga_vramSize = 0;
+
+ if (def == NULL || *def != NULL) {
+ VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
+ return -1;
+ }
+
+ if (VIR_ALLOC(*def) < 0) {
+ virReportOOMError();
+ return -1;
+ }
+
+ (*def)->type = VIR_DOMAIN_VIDEO_TYPE_VMVGA;
+
+ /* vmx:vramSize */
+ if (virVMXGetConfigLong(conf, "svga.vramSize", &svga_vramSize,
+ 4 * 1024 * 1024, true) < 0) {
+ goto cleanup;
+ }
+
+ (*def)->vram = svga_vramSize / 1024; /* Scale from bytes to kilobytes */
+
+ result = 0;
+
+ cleanup:
+ if (result < 0) {
+ virDomainVideoDefFree(*def);
+ *def = NULL;
+ }
+
+ return result;
+}
+
+
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Domain XML -> VMX
*/
/* def:sounds */
/* FIXME */
+ /* def:videos */
+ if (def->nvideos > 0) {
+ if (def->nvideos > 1) {
+ VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("No support for multiple video devices"));
+ goto cleanup;
+ }
+
+ if (virVMXFormatSVGA(def->videos[0], &buffer) < 0) {
+ goto cleanup;
+ }
+ }
+
/* def:hostdevs */
/* FIXME */
return 0;
}
+
+
+
+int
+virVMXFormatSVGA(virDomainVideoDefPtr def, virBufferPtr buffer)
+{
+ if (def->type != VIR_DOMAIN_VIDEO_TYPE_VMVGA) {
+ VMX_ERROR(VIR_ERR_INTERNAL_ERROR,
+ _("Unsupported video device type '%s'"),
+ virDomainVideoTypeToString(def->type));
+ return -1;
+ }
+
+ /*
+ * For Windows guests the VRAM size should be a multiple of 64 kilobyte.
+ * See http://kb.vmware.com/kb/1003 and http://kb.vmware.com/kb/1001558
+ */
+ if (def->vram % 64 != 0) {
+ VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Video device VRAM size must be a multiple of 64 kilobyte"));
+ return -1;
+ }
+
+ if (def->heads > 1) {
+ VMX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Multi-head video devices are unsupported"));
+ return -1;
+ }
+
+ virBufferVSprintf(buffer, "svga.vramSize = \"%lld\"\n",
+ def->vram * 1024LL); /* Scale from kilobytes to bytes */
+
+ return 0;
+}
int virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port,
virDomainChrDefPtr *def);
+int virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr *def);
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
int virVMXFormatParallel(virVMXContext *ctx, virDomainChrDefPtr def,
virBufferPtr buffer);
+int virVMXFormatSVGA(virDomainVideoDefPtr def, virBufferPtr buffer);
+
#endif /* __VIR_VMX_H__ */
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<mac address='00:50:56:91:48:c7'/>
<source bridge='VM NETWORK'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<mac address='00:50:56:91:48:c7'/>
<source bridge='vm network'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='scsi' index='0'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='scsi' index='0'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<mac address='00:50:56:91:48:c7'/>
<source bridge='VM Network'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source bridge='VM Network'/>
<model type='vlance'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<mac address='00:0c:29:f5:c3:0c'/>
<source bridge='VM Network'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source path='[498076b2-02796c1a-ef5b-000ae484a6a3] virtMonServ1/serial1.file'/>
<target type='serial' port='0'/>
</console>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source bridge='VM-LAN'/>
<model type='e1000'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<mac address='00:50:56:11:22:33'/>
<source bridge='VM Network'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source bridge='VM Network'/>
<target dev='vmnet7'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source bridge='VM Network'/>
<model type='e1000'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<mac address='00:0c:29:11:22:33'/>
<source bridge='VM Network'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<mac address='00:12:34:56:78:90'/>
<source bridge='VM Network'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<mac address='00:50:56:11:22:33'/>
<source bridge='VM Network'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source bridge='VM Network'/>
<model type='vmxnet2'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<mac address='00:50:56:87:65:43'/>
<source bridge='VM Network'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='fdc' index='0'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='fdc' index='0'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<devices>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5903' autoport='no' keymap='de' passwd='password'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source bridge='net1'/>
<target dev='/dev/vmnet1'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source bridge='net1'/>
<target dev='/dev/vmnet1'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source bridge='net2'/>
<target dev='/dev/vmnet2'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source bridge='net2'/>
<target dev='/dev/vmnet2'/>
</interface>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='scsi' index='0'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source path='/dev/parallel0'/>
<target port='0'/>
</parallel>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source path='[datastore] directory/parallel0.file'/>
<target port='0'/>
</parallel>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<controller type='scsi' index='1' model='lsilogic'/>
<controller type='scsi' index='2' model='lsisas1068'/>
<controller type='scsi' index='3' model='vmpvscsi'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='scsi' index='0' model='buslogic'/>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source path='/dev/ttyS0'/>
<target type='serial' port='0'/>
</console>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source path='[datastore] directory/serial0.file'/>
<target type='serial' port='0'/>
</console>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<protocol type='raw'/>
<target type='serial' port='0'/>
</console>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<protocol type='telnets'/>
<target type='serial' port='0'/>
</console>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<source path='serial0.pipe'/>
<target type='serial' port='0'/>
</console>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
+ <video>
+ <model type='vmvga' vram='4096'/>
+ </video>
</devices>
</domain>
--- /dev/null
+config.version = "8"
+virtualHW.version = "4"
+svga.vramSize = "8388608"
--- /dev/null
+<domain type='vmware'>
+ <uuid>00000000-0000-0000-0000-000000000000</uuid>
+ <memory>32768</memory>
+ <currentMemory>32768</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <video>
+ <model type='vmvga' vram='8192'/>
+ </video>
+ </devices>
+</domain>
DO_TEST("smbios", "smbios");
+ DO_TEST("svga", "svga");
+
virCapabilitiesFree(caps);
return result == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
RemoteDisplay.vnc.password = "password"
floppy0.present = "false"
floppy1.present = "false"
+svga.vramSize = "4194304"
--- /dev/null
+.encoding = "UTF-8"
+config.version = "8"
+virtualHW.version = "4"
+guestOS = "other"
+uuid.bios = "56 4d 9b ef ac d9 b4 e0-c8 f0 ae a8 b9 10 35 15"
+displayName = "minimal"
+memsize = "4"
+numvcpus = "1"
+floppy0.present = "false"
+floppy1.present = "false"
+svga.vramSize = "8388608"
--- /dev/null
+<domain type='vmware'>
+ <name>minimal</name>
+ <uuid>564d9bef-acd9-b4e0-c8f0-aea8b9103515</uuid>
+ <memory>4096</memory>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <video>
+ <model type='vmvga' vram='8192'/>
+ </video>
+ </devices>
+</domain>
DO_TEST("smbios", "smbios", 4);
+ DO_TEST("svga", "svga", 4);
+
virCapabilitiesFree(caps);
return result == 0 ? EXIT_SUCCESS : EXIT_FAILURE;