mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
Replace support{2d,3d} with accel{2d,3d}
Following the domain XML naming Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
This commit is contained in:
parent
0e0149ce91
commit
56a4fe2818
@ -12007,41 +12007,41 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node)
|
||||
{
|
||||
xmlNodePtr cur;
|
||||
virDomainVideoAccelDefPtr def;
|
||||
char *support3d = NULL;
|
||||
char *support2d = NULL;
|
||||
char *accel3d = NULL;
|
||||
char *accel2d = NULL;
|
||||
|
||||
cur = node->children;
|
||||
while (cur != NULL) {
|
||||
if (cur->type == XML_ELEMENT_NODE) {
|
||||
if (!support3d && !support2d &&
|
||||
if (!accel3d && !accel2d &&
|
||||
xmlStrEqual(cur->name, BAD_CAST "acceleration")) {
|
||||
support3d = virXMLPropString(cur, "accel3d");
|
||||
support2d = virXMLPropString(cur, "accel2d");
|
||||
accel3d = virXMLPropString(cur, "accel3d");
|
||||
accel2d = virXMLPropString(cur, "accel2d");
|
||||
}
|
||||
}
|
||||
cur = cur->next;
|
||||
}
|
||||
|
||||
if (!support3d && !support2d)
|
||||
if (!accel3d && !accel2d)
|
||||
return NULL;
|
||||
|
||||
if (VIR_ALLOC(def) < 0)
|
||||
return NULL;
|
||||
|
||||
if (support3d) {
|
||||
if (STREQ(support3d, "yes"))
|
||||
def->support3d = true;
|
||||
if (accel3d) {
|
||||
if (STREQ(accel3d, "yes"))
|
||||
def->accel3d = true;
|
||||
else
|
||||
def->support3d = false;
|
||||
VIR_FREE(support3d);
|
||||
def->accel3d = false;
|
||||
VIR_FREE(accel3d);
|
||||
}
|
||||
|
||||
if (support2d) {
|
||||
if (STREQ(support2d, "yes"))
|
||||
def->support2d = true;
|
||||
if (accel2d) {
|
||||
if (STREQ(accel2d, "yes"))
|
||||
def->accel2d = true;
|
||||
else
|
||||
def->support2d = false;
|
||||
VIR_FREE(support2d);
|
||||
def->accel2d = false;
|
||||
VIR_FREE(accel2d);
|
||||
}
|
||||
|
||||
return def;
|
||||
@ -17212,17 +17212,17 @@ virDomainVideoDefCheckABIStability(virDomainVideoDefPtr src,
|
||||
}
|
||||
|
||||
if (src->accel) {
|
||||
if (src->accel->support2d != dst->accel->support2d) {
|
||||
if (src->accel->accel2d != dst->accel->accel2d) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("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;
|
||||
}
|
||||
|
||||
if (src->accel->support3d != dst->accel->support3d) {
|
||||
if (src->accel->accel3d != dst->accel->accel3d) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("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;
|
||||
}
|
||||
}
|
||||
@ -20874,9 +20874,9 @@ virDomainVideoAccelDefFormat(virBufferPtr buf,
|
||||
virDomainVideoAccelDefPtr def)
|
||||
{
|
||||
virBufferAsprintf(buf, "<acceleration accel3d='%s'",
|
||||
def->support3d ? "yes" : "no");
|
||||
def->accel3d ? "yes" : "no");
|
||||
virBufferAsprintf(buf, " accel2d='%s'",
|
||||
def->support2d ? "yes" : "no");
|
||||
def->accel2d ? "yes" : "no");
|
||||
virBufferAddLit(buf, "/>\n");
|
||||
}
|
||||
|
||||
|
@ -1382,8 +1382,8 @@ typedef enum {
|
||||
typedef struct _virDomainVideoAccelDef virDomainVideoAccelDef;
|
||||
typedef virDomainVideoAccelDef *virDomainVideoAccelDefPtr;
|
||||
struct _virDomainVideoAccelDef {
|
||||
bool support3d;
|
||||
bool support2d;
|
||||
bool accel3d;
|
||||
bool accel2d;
|
||||
};
|
||||
|
||||
|
||||
|
@ -1554,10 +1554,10 @@ vboxAttachVideo(virDomainDefPtr def, IMachine *machine)
|
||||
gVBoxAPI.UIMachine.SetMonitorCount(machine, def->videos[0]->heads);
|
||||
if (def->videos[0]->accel) {
|
||||
gVBoxAPI.UIMachine.SetAccelerate3DEnabled(machine,
|
||||
def->videos[0]->accel->support3d);
|
||||
def->videos[0]->accel->accel3d);
|
||||
if (gVBoxAPI.accelerate2DVideo)
|
||||
gVBoxAPI.UIMachine.SetAccelerate2DVideoEnabled(machine,
|
||||
def->videos[0]->accel->support2d);
|
||||
def->videos[0]->accel->accel2d);
|
||||
} else {
|
||||
gVBoxAPI.UIMachine.SetAccelerate3DEnabled(machine, 0);
|
||||
if (gVBoxAPI.accelerate2DVideo)
|
||||
@ -3277,8 +3277,8 @@ vboxDumpVideo(virDomainDefPtr def, vboxGlobalData *data ATTRIBUTE_UNUSED,
|
||||
def->videos[0]->vram = VRAMSize * 1024;
|
||||
def->videos[0]->heads = monitorCount;
|
||||
if (VIR_ALLOC(def->videos[0]->accel) >= 0) {
|
||||
def->videos[0]->accel->support3d = accelerate3DEnabled;
|
||||
def->videos[0]->accel->support2d = accelerate2DEnabled;
|
||||
def->videos[0]->accel->accel3d = accelerate3DEnabled;
|
||||
def->videos[0]->accel->accel2d = accelerate2DEnabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2320,7 +2320,7 @@ static int prlsdkCheckVideoUnsupportedParams(virDomainDefPtr def)
|
||||
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",
|
||||
_("vz driver doesn't support "
|
||||
"setting video acceleration parameters."));
|
||||
|
Loading…
x
Reference in New Issue
Block a user