mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-10-07 15:34:05 +03:00
Compare commits
4 Commits
v6.9.0-rc1
...
v1.2.20-ma
Author | SHA1 | Date | |
---|---|---|---|
|
c5cc88c323 | ||
|
99ac102b83 | ||
|
8c30687b71 | ||
|
edeef640db |
@@ -1077,9 +1077,7 @@ virDomainRestoreFlags(virConnectPtr conn, const char *from, const char *dxml,
|
|||||||
* previously by virDomainSave() or virDomainSaveFlags().
|
* previously by virDomainSave() or virDomainSaveFlags().
|
||||||
*
|
*
|
||||||
* No security-sensitive data will be included unless @flags contains
|
* No security-sensitive data will be included unless @flags contains
|
||||||
* VIR_DOMAIN_XML_SECURE; this flag is rejected on read-only
|
* VIR_DOMAIN_XML_SECURE.
|
||||||
* connections. For this API, @flags should not contain either
|
|
||||||
* VIR_DOMAIN_XML_INACTIVE or VIR_DOMAIN_XML_UPDATE_CPU.
|
|
||||||
*
|
*
|
||||||
* Returns a 0 terminated UTF-8 encoded XML instance, or NULL in case of
|
* Returns a 0 terminated UTF-8 encoded XML instance, or NULL in case of
|
||||||
* error. The caller must free() the returned value.
|
* error. The caller must free() the returned value.
|
||||||
@@ -1095,12 +1093,7 @@ virDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *file,
|
|||||||
|
|
||||||
virCheckConnectReturn(conn, NULL);
|
virCheckConnectReturn(conn, NULL);
|
||||||
virCheckNonNullArgGoto(file, error);
|
virCheckNonNullArgGoto(file, error);
|
||||||
|
virCheckReadOnlyGoto(conn->flags, error);
|
||||||
if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
|
|
||||||
virReportError(VIR_ERR_OPERATION_DENIED, "%s",
|
|
||||||
_("virDomainSaveImageGetXMLDesc with secure flag"));
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (conn->driver->domainSaveImageGetXMLDesc) {
|
if (conn->driver->domainSaveImageGetXMLDesc) {
|
||||||
char *ret;
|
char *ret;
|
||||||
@@ -11125,6 +11118,7 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
|
|||||||
virResetLastError();
|
virResetLastError();
|
||||||
|
|
||||||
virCheckConnectReturn(conn, NULL);
|
virCheckConnectReturn(conn, NULL);
|
||||||
|
virCheckReadOnlyGoto(conn->flags, error);
|
||||||
|
|
||||||
if (conn->driver->connectGetDomainCapabilities) {
|
if (conn->driver->connectGetDomainCapabilities) {
|
||||||
char *ret;
|
char *ret;
|
||||||
|
@@ -6866,7 +6866,7 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path,
|
|||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virDomainSaveImageGetXMLDescEnsureACL(conn, def, flags) < 0)
|
if (virDomainSaveImageGetXMLDescEnsureACL(conn, def) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = qemuDomainDefFormatXML(driver, def, flags);
|
ret = qemuDomainDefFormatXML(driver, def, flags);
|
||||||
|
@@ -4041,6 +4041,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
char expire_time [64];
|
char expire_time [64];
|
||||||
const char *connected = NULL;
|
const char *connected = NULL;
|
||||||
|
const char *password;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||||
|
|
||||||
@@ -4048,16 +4049,14 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
password = auth->passwd ? auth->passwd : defaultPasswd;
|
||||||
|
|
||||||
if (auth->connected)
|
if (auth->connected)
|
||||||
connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
|
connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
|
||||||
|
|
||||||
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
ret = qemuMonitorSetPassword(priv->mon,
|
ret = qemuMonitorSetPassword(priv->mon, type, password, connected);
|
||||||
type,
|
|
||||||
auth->passwd ? auth->passwd : defaultPasswd,
|
|
||||||
connected);
|
|
||||||
|
|
||||||
if (ret == -2) {
|
if (ret == -2) {
|
||||||
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
||||||
@@ -4065,14 +4064,15 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|||||||
_("Graphics password only supported for VNC"));
|
_("Graphics password only supported for VNC"));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else {
|
} else {
|
||||||
ret = qemuMonitorSetVNCPassword(priv->mon,
|
ret = qemuMonitorSetVNCPassword(priv->mon, password);
|
||||||
auth->passwd ? auth->passwd : defaultPasswd);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
goto end_job;
|
goto end_job;
|
||||||
|
|
||||||
if (auth->expires) {
|
if (password[0] == '\0') {
|
||||||
|
snprintf(expire_time, sizeof(expire_time), "now");
|
||||||
|
} else if (auth->expires) {
|
||||||
time_t lifetime = auth->validTo - now;
|
time_t lifetime = auth->validTo - now;
|
||||||
if (lifetime <= 0)
|
if (lifetime <= 0)
|
||||||
snprintf(expire_time, sizeof(expire_time), "now");
|
snprintf(expire_time, sizeof(expire_time), "now");
|
||||||
|
@@ -4907,8 +4907,7 @@ enum remote_procedure {
|
|||||||
/**
|
/**
|
||||||
* @generate: both
|
* @generate: both
|
||||||
* @priority: high
|
* @priority: high
|
||||||
* @acl: domain:read
|
* @acl: domain:write
|
||||||
* @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
|
|
||||||
*/
|
*/
|
||||||
REMOTE_PROC_DOMAIN_SAVE_IMAGE_GET_XML_DESC = 235,
|
REMOTE_PROC_DOMAIN_SAVE_IMAGE_GET_XML_DESC = 235,
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* storage_backend_fs.c: storage backend for FS and directory handling
|
* storage_backend_fs.c: storage backend for FS and directory handling
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2014 Red Hat, Inc.
|
* Copyright (C) 2007-2015 Red Hat, Inc.
|
||||||
* Copyright (C) 2007-2008 Daniel P. Berrange
|
* Copyright (C) 2007-2008 Daniel P. Berrange
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
@@ -1057,6 +1057,14 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
else
|
else
|
||||||
vol->type = VIR_STORAGE_VOL_FILE;
|
vol->type = VIR_STORAGE_VOL_FILE;
|
||||||
|
|
||||||
|
/* Volumes within a directory pools are not recursive; do not
|
||||||
|
* allow escape to ../ or a subdir */
|
||||||
|
if (strchr(vol->name, '/')) {
|
||||||
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
|
_("volume name '%s' cannot contain '/'"), vol->name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
VIR_FREE(vol->target.path);
|
VIR_FREE(vol->target.path);
|
||||||
if (virAsprintf(&vol->target.path, "%s/%s",
|
if (virAsprintf(&vol->target.path, "%s/%s",
|
||||||
pool->def->target.path,
|
pool->def->target.path,
|
||||||
|
Reference in New Issue
Block a user