From 415d62b9115181bcfc16a23b3b02542ee9753334 Mon Sep 17 00:00:00 2001
From: zhouli57 <zhouli57@huawei.com>
Date: Mon, 21 Feb 2022 16:38:18 +0800
Subject: [PATCH 05/10] root_port: correct the log of printing device info
 during hot unplug

Signed-off-by: zhouli57 <zhouli57@huawei.com>
---
 pci/src/root_port.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pci/src/root_port.rs b/pci/src/root_port.rs
index 286e92d..3dc97dd 100644
--- a/pci/src/root_port.rs
+++ b/pci/src/root_port.rs
@@ -168,6 +168,7 @@ impl RootPort {
                 error!("{}", e.display_chain());
                 error!("Failed to unrealize device {}.", locked_dev.name());
             }
+            info!("Device {} unplug from {}", locked_dev.name(), self.name);
 
             // Send QMP event for successful hot unplugging.
             if QmpChannel::is_connected() {
@@ -237,7 +238,6 @@ impl RootPort {
             && (old_ctl & PCI_EXP_SLTCTL_PCC != PCI_EXP_SLTCTL_PCC
                 || old_ctl & PCI_EXP_SLTCTL_PWR_IND_OFF != PCI_EXP_SLTCTL_PWR_IND_OFF)
         {
-            info!("Device {} unplug", self.name());
             self.remove_devices();
 
             if let Err(e) = self.update_register_status() {
-- 
2.25.1

