[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 110/113] vhost-user: delete net client if necessary
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 110/113] vhost-user: delete net client if necessary |
Date: |
Mon, 18 Jun 2018 20:43:16 -0500 |
From: linzhecheng <address@hidden>
As qemu_new_net_client create new ncs but error happens later,
ncs will be left in global net_clients list and we can't use them any
more, so we need to cleanup them.
Cc: address@hidden
Signed-off-by: linzhecheng <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
(cherry picked from commit c67daf4a24442d1bb404a11a6a54dc45ea10f234)
Conflicts:
net/vhost-user.c
* drop functional dep on 4d0cf552
Signed-off-by: Michael Roth <address@hidden>
---
net/vhost-user.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/net/vhost-user.c b/net/vhost-user.c
index c23927c912..d2015e30b6 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -296,7 +296,7 @@ static int net_vhost_user_init(NetClientState *peer, const
char *device,
s = DO_UPCAST(VhostUserState, nc, nc);
if (!qemu_chr_fe_init(&s->chr, chr, &err)) {
error_report_err(err);
- return -1;
+ goto err;
}
}
@@ -306,7 +306,7 @@ static int net_vhost_user_init(NetClientState *peer, const
char *device,
do {
if (qemu_chr_fe_wait_connected(&s->chr, &err) < 0) {
error_report_err(err);
- return -1;
+ goto err;
}
qemu_chr_fe_set_handlers(&s->chr, NULL, NULL,
net_vhost_user_event, NULL, nc0->name, NULL,
@@ -316,6 +316,13 @@ static int net_vhost_user_init(NetClientState *peer, const
char *device,
assert(s->vhost_net);
return 0;
+
+err:
+ if (nc0) {
+ qemu_del_net_client(nc0);
+ }
+
+ return -1;
}
static Chardev *net_vhost_claim_chardev(
--
2.11.0
- [Qemu-stable] [PATCH 100/113] arm_gicv3_kvm: kvm_dist_get/put: skip the registers banked by GICR, (continued)
- [Qemu-stable] [PATCH 100/113] arm_gicv3_kvm: kvm_dist_get/put: skip the registers banked by GICR, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 101/113] block: Make bdrv_is_writable() public, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 009/113] spapr: use spapr->vsmt to compute VCPU ids, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 102/113] qcow2: Do not mark inactive images corrupt, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 104/113] throttle: Fix crash on reopen, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 103/113] iotests: Add case for a corrupted inactive image, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 105/113] vga: fix region calculation, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 106/113] i386: define the 'ssbd' CPUID feature bit (CVE-2018-3639), Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 107/113] i386: Define the Virt SSBD MSR and handling of it (CVE-2018-3639), Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 108/113] i386: define the AMD 'virt-ssbd' CPUID feature bit (CVE-2018-3639), Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 110/113] vhost-user: delete net client if necessary,
Michael Roth <=
- [Qemu-stable] [PATCH 109/113] tap: set vhostfd passed from qemu cli to non-blocking, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 010/113] spapr: move VCPU calculation to core machine code, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 111/113] qemu-img: Fix assert when mapping unaligned raw file, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 113/113] arm_gicv3_kvm: kvm_dist_get/put_priority: skip the registers banked by GICR_IPRIORITYR, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 112/113] iotests: Add test 221 to catch qemu-img map regression, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 011/113] target/ppc: Clarify compat mode max_threads value, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 012/113] spapr: rename spapr_vcpu_id() to spapr_get_vcpu_id(), Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 013/113] spapr: consolidate the VCPU id numbering logic in a single place, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 015/113] spapr: register dummy ICPs later, Michael Roth, 2018/06/18
- [Qemu-stable] [PATCH 014/113] spapr: fix missing CPU core nodes in DT when running with TCG, Michael Roth, 2018/06/18