Skip to contentSkip to conversation

libxl: don't overwrite error from virNetSocketNewConnectTCP()

PATCH John Ferlan 3 participants 3 messages Sep 3, 2015 – Sep 4, 2015 2 messages not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 5 lines · Jim Fehlig

Remove redundant error reporting in libxlDomainMigrationPerform(). virNetSocketNewConnectTCP() is perfectly capable of reporting sensible errors.

Quoted 9 lines

---

V2:
Actually try to compile the code and find saved_errno is no longer used - remove it.

 src/libxl/libxl_migration.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

ACK

John

Also noteworthy that virNetSocketNewConnectTCP could overwrite errno when freeaddrinfo is run in error: or when VIR_FORCE_CLOSE() did it's thing...

#3 lore raw
In reply to a message not in the archive
Quoted 9 lines · John Ferlan
Quoted 7 lines · Jim Fehlig

Remove redundant error reporting in libxlDomainMigrationPerform(). virNetSocketNewConnectTCP() is perfectly capable of reporting sensible errors.

---

Quoted 8 lines
Quoted 7 lines

V2:
Actually try to compile the code and find saved_errno is no longer used - remove it.

  src/libxl/libxl_migration.c | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)

ACK

Thanks! Pushed now.

Regards,
Jim

#4 lore raw
In reply to a message not in the archive
Quoted 18 lines · John Ferlan
Quoted 5 lines · Jim Fehlig

Remove redundant error reporting in libxlDomainMigrationPerform(). virNetSocketNewConnectTCP() is perfectly capable of reporting sensible errors.

Quoted 9 lines

---

V2:
Actually try to compile the code and find saved_errno is no longer used - remove it.

 src/libxl/libxl_migration.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
Quoted 8 lines

ACK

John

Also noteworthy that virNetSocketNewConnectTCP could overwrite errno when freeaddrinfo is run in error: or when VIR_FORCE_CLOSE() did it's thing...

I don't think that either of those overwrites errno. Here's freeaddrinfo() impl that I've found in glibc:

void
freeaddrinfo (struct addrinfo *ai)
{
struct addrinfo *p;

while (ai != NULL)

    {
      p = ai;
      ai = ai->ai_next;
      free (p->ai_canonname);
      free (p);
    }
}

And VIR_FORCE_CLOSE() preserves errno too. But nevertheless, ACK stands.

Michal