vboxDumpDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
{
/* dump display options vrdp/gui/sdl */
- int vrdpPresent = 0;
int sdlPresent = 0;
int guiPresent = 0;
int totalPresent = 0;
char *valueTypeUtf8 = NULL;
IVRDxServer *VRDxServer = NULL;
PRBool VRDxEnabled = PR_FALSE;
+ bool addDesktop = false;
def->ngraphics = 0;
totalPresent++;
}
VBOX_UTF8_FREE(valueDisplayUtf8);
+ } else if (STRNEQ_NULLABLE(valueTypeUtf8, "vrdp")) {
+ addDesktop = true;
}
- if (STREQ_NULLABLE(valueTypeUtf8, "vrdp"))
- vrdpPresent = 1;
-
if ((totalPresent > 0) && (VIR_ALLOC_N(def->graphics, totalPresent) >= 0)) {
if ((guiPresent) && (VIR_ALLOC(def->graphics[def->ngraphics]) >= 0)) {
def->graphics[def->ngraphics]->type = VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP;
def->graphics[def->ngraphics]->data.sdl.display = sdlDisplay;
def->ngraphics++;
}
- } else if ((vrdpPresent != 1) && (totalPresent == 0) && (VIR_ALLOC_N(def->graphics, 1) >= 0)) {
+ } else if (addDesktop && (VIR_ALLOC_N(def->graphics, 1) >= 0)) {
if (VIR_ALLOC(def->graphics[def->ngraphics]) >= 0) {
const char *tmp;
def->graphics[def->ngraphics]->type = VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP;