mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-29 17:33:09 +00:00
Fix autoport when domain is inactive
This commit is contained in:
parent
6f17fb2851
commit
42e559a324
@ -1,3 +1,9 @@
|
|||||||
|
Thu Jul 31 15:37:00 BST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* src/domain_conf.c: fix previous patch to ensure port number
|
||||||
|
is kept as '-1' when autoport is set, and the domain is not
|
||||||
|
running.
|
||||||
|
|
||||||
Thu Jul 31 14:27:00 CEST 2008 Chris Lalancette <clalance@redhat.com>
|
Thu Jul 31 14:27:00 CEST 2008 Chris Lalancette <clalance@redhat.com>
|
||||||
|
|
||||||
* src/domain_conf.c: patch from Charles Duffy to make sure we print
|
* src/domain_conf.c: patch from Charles Duffy to make sure we print
|
||||||
|
@ -2416,6 +2416,7 @@ virDomainInputDefFormat(virConnectPtr conn,
|
|||||||
static int
|
static int
|
||||||
virDomainGraphicsDefFormat(virConnectPtr conn,
|
virDomainGraphicsDefFormat(virConnectPtr conn,
|
||||||
virBufferPtr buf,
|
virBufferPtr buf,
|
||||||
|
virDomainDefPtr vm,
|
||||||
virDomainGraphicsDefPtr def,
|
virDomainGraphicsDefPtr def,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
@ -2431,7 +2432,8 @@ virDomainGraphicsDefFormat(virConnectPtr conn,
|
|||||||
|
|
||||||
switch (def->type) {
|
switch (def->type) {
|
||||||
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
|
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
|
||||||
if (def->data.vnc.port)
|
if (def->data.vnc.port &&
|
||||||
|
(!def->data.vnc.autoport || vm->id != -1))
|
||||||
virBufferVSprintf(buf, " port='%d'",
|
virBufferVSprintf(buf, " port='%d'",
|
||||||
def->data.vnc.port);
|
def->data.vnc.port);
|
||||||
else if (def->data.vnc.autoport)
|
else if (def->data.vnc.autoport)
|
||||||
@ -2674,7 +2676,7 @@ char *virDomainDefFormat(virConnectPtr conn,
|
|||||||
if (virDomainInputDefFormat(conn, &buf, &autoInput) < 0)
|
if (virDomainInputDefFormat(conn, &buf, &autoInput) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virDomainGraphicsDefFormat(conn, &buf, def->graphics, flags) < 0)
|
if (virDomainGraphicsDefFormat(conn, &buf, def, def->graphics, flags) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user