}
if (ram) {
- if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("ram attribute only supported for type of qxl"));
- return NULL;
- }
if (virStrToLong_uip(ram, NULL, 10, &def->ram) < 0) {
virReportError(VIR_ERR_XML_ERROR,
_("cannot parse video ram '%s'"), ram);
}
if (vram64) {
- if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("vram64 attribute only supported for type of qxl"));
- return NULL;
- }
if (virStrToLong_uip(vram64, NULL, 10, &def->vram64) < 0) {
virReportError(VIR_ERR_XML_ERROR,
_("cannot parse video vram64 '%s'"), vram64);
}
if (vgamem) {
- if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("vgamem attribute only supported for type of qxl"));
- return NULL;
- }
if (virStrToLong_uip(vgamem, NULL, 10, &def->vgamem) < 0) {
virReportError(VIR_ERR_XML_ERROR,
_("cannot parse video vgamem '%s'"), vgamem);
return -1;
}
+ if (video->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
+ if (video->ram != 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("ram attribute only supported for video type qxl"));
+ return -1;
+ }
+
+ if (video->vram64 != 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("vram64 attribute only supported for video type qxl"));
+ return -1;
+ }
+
+ if (video->vgamem != 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("vgamem attribute only supported for video type qxl"));
+ return -1;
+ }
+ }
+
return 0;
}