[libvirt] [PATCH v3 2/3] qemu: Remove qemu_hotplugpriv.h and qemuDomainRemoveDeviceWaitTime

Daniel Henrique Barboza danielhb413 at gmail.com
Fri Oct 18 18:36:33 UTC 2019


qemu_hotplugpriv.h is a header file created to share a global variable
called 'qemuDomainRemoveDeviceWaitTime', declared in qemu_hotplug.c,
to other files that would want to change the timeout value
(currently, only tests/qemuhotplugtest.c).

Previous patch deprecated the variable, using qemu_driver->unplugTimeout
to set the timeout instead. This means that the header file is now
unused, and can be safely discarded.

Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
---
 src/qemu/Makefile.inc.am    |  1 -
 src/qemu/qemu_hotplug.c     |  5 -----
 src/qemu/qemu_hotplugpriv.h | 32 --------------------------------
 tests/qemuhotplugtest.c     |  4 ----
 4 files changed, 42 deletions(-)
 delete mode 100644 src/qemu/qemu_hotplugpriv.h

diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am
index e66da76c0a..1827ef6e04 100644
--- a/src/qemu/Makefile.inc.am
+++ b/src/qemu/Makefile.inc.am
@@ -29,7 +29,6 @@ QEMU_DRIVER_SOURCES = \
 	qemu/qemu_hostdev.h \
 	qemu/qemu_hotplug.c \
 	qemu/qemu_hotplug.h \
-	qemu/qemu_hotplugpriv.h \
 	qemu/qemu_conf.c \
 	qemu/qemu_conf.h \
 	qemu/qemu_interop_config.c \
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index a7955e8062..32100b140e 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -23,8 +23,6 @@
 #include <config.h>
 
 #include "qemu_hotplug.h"
-#define LIBVIRT_QEMU_HOTPLUGPRIV_H_ALLOW
-#include "qemu_hotplugpriv.h"
 #include "qemu_alias.h"
 #include "qemu_capabilities.h"
 #include "qemu_domain.h"
@@ -70,9 +68,6 @@ VIR_LOG_INIT("qemu.qemu_hotplug");
 #define QEMU_UNPLUG_TIMEOUT 1000ull * 5
 #define QEMU_UNPLUG_TIMEOUT_PPC64 1000ull * 10
 
-/* Wait up to 5 seconds for device removal to finish. */
-unsigned long long qemuDomainRemoveDeviceWaitTime = 1000ull * 5;
-
 
 static void
 qemuDomainResetDeviceRemoval(virDomainObjPtr vm);
diff --git a/src/qemu/qemu_hotplugpriv.h b/src/qemu/qemu_hotplugpriv.h
deleted file mode 100644
index a5c443ba85..0000000000
--- a/src/qemu/qemu_hotplugpriv.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * qemu_hotplugpriv.h: private declarations for QEMU device hotplug management
- *
- * Copyright (C) 2013 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef LIBVIRT_QEMU_HOTPLUGPRIV_H_ALLOW
-# error "qemu_hotplugpriv.h may only be included by qemu_hotplug.c or test suites"
-#endif /* LIBVIRT_QEMU_HOTPLUGPRIV_H_ALLOW */
-
-#pragma once
-
-/*
- * This header file should never be used outside unit tests.
- */
-
-extern unsigned long long qemuDomainRemoveDeviceWaitTime;
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 5f2fc6a598..140ab902ce 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -22,8 +22,6 @@
 #include "qemu/qemu_alias.h"
 #include "qemu/qemu_conf.h"
 #include "qemu/qemu_hotplug.h"
-#define LIBVIRT_QEMU_HOTPLUGPRIV_H_ALLOW
-#include "qemu/qemu_hotplugpriv.h"
 #include "qemumonitortestutils.h"
 #include "testutils.h"
 #include "testutilsqemu.h"
@@ -643,8 +641,6 @@ mymain(void)
 
     driver.hostdevMgr = virHostdevManagerGetDefault();
 
-    /* wait only 100ms for DEVICE_DELETED event */
-    qemuDomainRemoveDeviceWaitTime = 100;
 
 #define DO_TEST(file, ACTION, dev, fial, kep, ...) \
     do { \
-- 
2.21.0




More information about the libvir-list mailing list