提交 56a4fe28 编写于 作者: M Marc-André Lureau 提交者: Michal Privoznik

Replace support{2d,3d} with accel{2d,3d}

Following the domain XML naming
Signed-off-by: NMarc-André Lureau <marcandre.lureau@gmail.com>
上级 0e0149ce
...@@ -12007,41 +12007,41 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node) ...@@ -12007,41 +12007,41 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node)
{ {
xmlNodePtr cur; xmlNodePtr cur;
virDomainVideoAccelDefPtr def; virDomainVideoAccelDefPtr def;
char *support3d = NULL; char *accel3d = NULL;
char *support2d = NULL; char *accel2d = NULL;
cur = node->children; cur = node->children;
while (cur != NULL) { while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) { if (cur->type == XML_ELEMENT_NODE) {
if (!support3d && !support2d && if (!accel3d && !accel2d &&
xmlStrEqual(cur->name, BAD_CAST "acceleration")) { xmlStrEqual(cur->name, BAD_CAST "acceleration")) {
support3d = virXMLPropString(cur, "accel3d"); accel3d = virXMLPropString(cur, "accel3d");
support2d = virXMLPropString(cur, "accel2d"); accel2d = virXMLPropString(cur, "accel2d");
} }
} }
cur = cur->next; cur = cur->next;
} }
if (!support3d && !support2d) if (!accel3d && !accel2d)
return NULL; return NULL;
if (VIR_ALLOC(def) < 0) if (VIR_ALLOC(def) < 0)
return NULL; return NULL;
if (support3d) { if (accel3d) {
if (STREQ(support3d, "yes")) if (STREQ(accel3d, "yes"))
def->support3d = true; def->accel3d = true;
else else
def->support3d = false; def->accel3d = false;
VIR_FREE(support3d); VIR_FREE(accel3d);
} }
if (support2d) { if (accel2d) {
if (STREQ(support2d, "yes")) if (STREQ(accel2d, "yes"))
def->support2d = true; def->accel2d = true;
else else
def->support2d = false; def->accel2d = false;
VIR_FREE(support2d); VIR_FREE(accel2d);
} }
return def; return def;
...@@ -17212,17 +17212,17 @@ virDomainVideoDefCheckABIStability(virDomainVideoDefPtr src, ...@@ -17212,17 +17212,17 @@ virDomainVideoDefCheckABIStability(virDomainVideoDefPtr src,
} }
if (src->accel) { if (src->accel) {
if (src->accel->support2d != dst->accel->support2d) { if (src->accel->accel2d != dst->accel->accel2d) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Target video card 2d accel %u does not match source %u"), _("Target video card 2d accel %u does not match source %u"),
dst->accel->support2d, src->accel->support2d); dst->accel->accel2d, src->accel->accel2d);
return false; return false;
} }
if (src->accel->support3d != dst->accel->support3d) { if (src->accel->accel3d != dst->accel->accel3d) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Target video card 3d accel %u does not match source %u"), _("Target video card 3d accel %u does not match source %u"),
dst->accel->support3d, src->accel->support3d); dst->accel->accel3d, src->accel->accel3d);
return false; return false;
} }
} }
...@@ -20874,9 +20874,9 @@ virDomainVideoAccelDefFormat(virBufferPtr buf, ...@@ -20874,9 +20874,9 @@ virDomainVideoAccelDefFormat(virBufferPtr buf,
virDomainVideoAccelDefPtr def) virDomainVideoAccelDefPtr def)
{ {
virBufferAsprintf(buf, "<acceleration accel3d='%s'", virBufferAsprintf(buf, "<acceleration accel3d='%s'",
def->support3d ? "yes" : "no"); def->accel3d ? "yes" : "no");
virBufferAsprintf(buf, " accel2d='%s'", virBufferAsprintf(buf, " accel2d='%s'",
def->support2d ? "yes" : "no"); def->accel2d ? "yes" : "no");
virBufferAddLit(buf, "/>\n"); virBufferAddLit(buf, "/>\n");
} }
......
...@@ -1382,8 +1382,8 @@ typedef enum { ...@@ -1382,8 +1382,8 @@ typedef enum {
typedef struct _virDomainVideoAccelDef virDomainVideoAccelDef; typedef struct _virDomainVideoAccelDef virDomainVideoAccelDef;
typedef virDomainVideoAccelDef *virDomainVideoAccelDefPtr; typedef virDomainVideoAccelDef *virDomainVideoAccelDefPtr;
struct _virDomainVideoAccelDef { struct _virDomainVideoAccelDef {
bool support3d; bool accel3d;
bool support2d; bool accel2d;
}; };
......
...@@ -1554,10 +1554,10 @@ vboxAttachVideo(virDomainDefPtr def, IMachine *machine) ...@@ -1554,10 +1554,10 @@ vboxAttachVideo(virDomainDefPtr def, IMachine *machine)
gVBoxAPI.UIMachine.SetMonitorCount(machine, def->videos[0]->heads); gVBoxAPI.UIMachine.SetMonitorCount(machine, def->videos[0]->heads);
if (def->videos[0]->accel) { if (def->videos[0]->accel) {
gVBoxAPI.UIMachine.SetAccelerate3DEnabled(machine, gVBoxAPI.UIMachine.SetAccelerate3DEnabled(machine,
def->videos[0]->accel->support3d); def->videos[0]->accel->accel3d);
if (gVBoxAPI.accelerate2DVideo) if (gVBoxAPI.accelerate2DVideo)
gVBoxAPI.UIMachine.SetAccelerate2DVideoEnabled(machine, gVBoxAPI.UIMachine.SetAccelerate2DVideoEnabled(machine,
def->videos[0]->accel->support2d); def->videos[0]->accel->accel2d);
} else { } else {
gVBoxAPI.UIMachine.SetAccelerate3DEnabled(machine, 0); gVBoxAPI.UIMachine.SetAccelerate3DEnabled(machine, 0);
if (gVBoxAPI.accelerate2DVideo) if (gVBoxAPI.accelerate2DVideo)
...@@ -3277,8 +3277,8 @@ vboxDumpVideo(virDomainDefPtr def, vboxGlobalData *data ATTRIBUTE_UNUSED, ...@@ -3277,8 +3277,8 @@ vboxDumpVideo(virDomainDefPtr def, vboxGlobalData *data ATTRIBUTE_UNUSED,
def->videos[0]->vram = VRAMSize * 1024; def->videos[0]->vram = VRAMSize * 1024;
def->videos[0]->heads = monitorCount; def->videos[0]->heads = monitorCount;
if (VIR_ALLOC(def->videos[0]->accel) >= 0) { if (VIR_ALLOC(def->videos[0]->accel) >= 0) {
def->videos[0]->accel->support3d = accelerate3DEnabled; def->videos[0]->accel->accel3d = accelerate3DEnabled;
def->videos[0]->accel->support2d = accelerate2DEnabled; def->videos[0]->accel->accel2d = accelerate2DEnabled;
} }
} }
} }
......
...@@ -2320,7 +2320,7 @@ static int prlsdkCheckVideoUnsupportedParams(virDomainDefPtr def) ...@@ -2320,7 +2320,7 @@ static int prlsdkCheckVideoUnsupportedParams(virDomainDefPtr def)
return -1; return -1;
} }
if (v->accel != NULL && (v->accel->support2d || v->accel->support3d)) { if (v->accel != NULL && (v->accel->accel2d || v->accel->accel3d)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("vz driver doesn't support " _("vz driver doesn't support "
"setting video acceleration parameters.")); "setting video acceleration parameters."));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册