]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
ch: add ch_hotplug.{h,c} files to CH build
authorStefan Kober <stefan.kober@cyberus-technology.de>
Thu, 4 Sep 2025 12:10:23 +0000 (14:10 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 8 Sep 2025 14:40:08 +0000 (16:40 +0200)
The files are meant to contain all device hotplug related code. The
first implementation will be live storage attach and detach.

On-behalf-of: SAP stefan.kober@sap.com
Signed-off-by: Stefan Kober <stefan.kober@cyberus-technology.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/ch/ch_hotplug.c [new file with mode: 0644]
src/ch/ch_hotplug.h [new file with mode: 0644]
src/ch/meson.build

diff --git a/src/ch/ch_hotplug.c b/src/ch/ch_hotplug.c
new file mode 100644 (file)
index 0000000..c46628e
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * ch_hotplug.c: CH device hotplug handling
+ *
+ * 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/>.
+ */
+
+#include <config.h>
+
+#include "ch_hotplug.h"
+
+#define VIR_FROM_THIS VIR_FROM_CH
+
+int
+chDomainAttachDeviceLiveAndUpdateConfig(virDomainObj *vm G_GNUC_UNUSED,
+                                        virCHDriver *driver G_GNUC_UNUSED,
+                                        const char *xml G_GNUC_UNUSED,
+                                        unsigned int flags)
+{
+    virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+                  VIR_DOMAIN_AFFECT_CONFIG, -1);
+
+    return -1;
+}
diff --git a/src/ch/ch_hotplug.h b/src/ch/ch_hotplug.h
new file mode 100644 (file)
index 0000000..04915ba
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * ch_hotplug.h: CH device hotplug handling
+ *
+ * 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/>.
+ */
+
+#pragma once
+
+#include "ch_conf.h"
+
+int
+chDomainAttachDeviceLiveAndUpdateConfig(virDomainObj *vm,
+                                        virCHDriver *driver,
+                                        const char *xml,
+                                        unsigned int flags);
index cd20c3d0652d3cac85e1e48ed713c35c5d4aef8e..bba7ee90eef42f0f2e501dd1262fffd82e296ec4 100644 (file)
@@ -17,6 +17,8 @@ ch_driver_sources = [
   'ch_process.h',
   'ch_hostdev.c',
   'ch_hostdev.h',
+  'ch_hotplug.c',
+  'ch_hotplug.h',
 ]
 
 driver_source_files += files(ch_driver_sources)