mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
libvirt-domain.c: g_autofree in virDomainMigrate() and virDomainMigrate2()
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
47fe0737b3
commit
e056fdaed5
@ -3553,7 +3553,7 @@ virDomainMigrate(virDomainPtr domain,
|
|||||||
if (flags & VIR_MIGRATE_PEER2PEER) {
|
if (flags & VIR_MIGRATE_PEER2PEER) {
|
||||||
if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
||||||
VIR_DRV_FEATURE_MIGRATION_P2P)) {
|
VIR_DRV_FEATURE_MIGRATION_P2P)) {
|
||||||
char *dstURI = NULL;
|
g_autofree char *dstURI = NULL;
|
||||||
if (uri == NULL) {
|
if (uri == NULL) {
|
||||||
dstURI = virConnectGetURI(dconn);
|
dstURI = virConnectGetURI(dconn);
|
||||||
if (!dstURI)
|
if (!dstURI)
|
||||||
@ -3562,11 +3562,8 @@ virDomainMigrate(virDomainPtr domain,
|
|||||||
|
|
||||||
VIR_DEBUG("Using peer2peer migration");
|
VIR_DEBUG("Using peer2peer migration");
|
||||||
if (virDomainMigrateUnmanaged(domain, NULL, flags, dname,
|
if (virDomainMigrateUnmanaged(domain, NULL, flags, dname,
|
||||||
uri ? uri : dstURI, NULL, bandwidth) < 0) {
|
uri ? uri : dstURI, NULL, bandwidth) < 0)
|
||||||
VIR_FREE(dstURI);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
VIR_FREE(dstURI);
|
|
||||||
|
|
||||||
ddomain = virDomainLookupByName(dconn, dname ? dname : domain->name);
|
ddomain = virDomainLookupByName(dconn, dname ? dname : domain->name);
|
||||||
} else {
|
} else {
|
||||||
@ -3712,17 +3709,14 @@ virDomainMigrate2(virDomainPtr domain,
|
|||||||
if (flags & VIR_MIGRATE_PEER2PEER) {
|
if (flags & VIR_MIGRATE_PEER2PEER) {
|
||||||
if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
|
||||||
VIR_DRV_FEATURE_MIGRATION_P2P)) {
|
VIR_DRV_FEATURE_MIGRATION_P2P)) {
|
||||||
char *dstURI = virConnectGetURI(dconn);
|
g_autofree char *dstURI = virConnectGetURI(dconn);
|
||||||
if (!dstURI)
|
if (!dstURI)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
VIR_DEBUG("Using peer2peer migration");
|
VIR_DEBUG("Using peer2peer migration");
|
||||||
if (virDomainMigrateUnmanaged(domain, dxml, flags, dname,
|
if (virDomainMigrateUnmanaged(domain, dxml, flags, dname,
|
||||||
dstURI, uri, bandwidth) < 0) {
|
dstURI, uri, bandwidth) < 0)
|
||||||
VIR_FREE(dstURI);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
VIR_FREE(dstURI);
|
|
||||||
|
|
||||||
ddomain = virDomainLookupByName(dconn, dname ? dname : domain->name);
|
ddomain = virDomainLookupByName(dconn, dname ? dname : domain->name);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user