char *network = virXMLPropString(node, "network");
char *socketPath = virXMLPropString(node, "socket");
char *fromConfig = virXMLPropString(node, "fromConfig");
+ char *autoGenerated = virXMLPropString(node, "autoGenerated");
char *addressCompat = NULL;
char *socketCompat = NULL;
const char *graphicsType = virDomainGraphicsTypeToString(graphics->type);
def->fromConfig = tmp != 0;
}
+ if (autoGenerated &&
+ flags & VIR_DOMAIN_DEF_PARSE_STATUS) {
+ if (STREQ(autoGenerated, "yes")) {
+ def->autoGenerated = true;
+ } else if (STRNEQ(autoGenerated, "no")) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("Invalid autoGenerated value: %s"),
+ autoGenerated);
+ goto error;
+ }
+ }
+
ret = 0;
error:
if (ret < 0)
VIR_FREE(network);
VIR_FREE(socketPath);
VIR_FREE(fromConfig);
+ VIR_FREE(autoGenerated);
VIR_FREE(addressCompat);
VIR_FREE(socketCompat);
return ret;
virBufferEscapeString(buf, " socket='%s'", def->socket);
}
- if (flags & VIR_DOMAIN_DEF_FORMAT_STATUS)
+ if (flags & VIR_DOMAIN_DEF_FORMAT_STATUS) {
virBufferAsprintf(buf, " fromConfig='%d'", def->fromConfig);
+ virBufferAsprintf(buf, " autoGenerated='%s'",
+ def->autoGenerated ? "yes" : "no");
+ }
virBufferAddLit(buf, "/>\n");
}
/* This will happen only if we parse XML from old libvirts where
* unix socket was available only for VNC graphics. In this
* particular case we should follow the behavior and if we remove
- * the auto-generated socket base on config option from qemu.conf
+ * the auto-generated socket based on config option from qemu.conf
* we need to change the listen type to address. */
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
glisten->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET &&
glisten->socket &&
+ !glisten->autoGenerated &&
STRPREFIX(glisten->socket, cfg->libDir)) {
if (flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) {
VIR_FREE(glisten->socket);