├── ci ├── lcitool │ └── projects │ │ └── libvirt-csharp.yml ├── buildenv │ ├── fedora-40.sh │ ├── fedora-rawhide.sh │ └── fedora-39.sh ├── gitlab │ ├── containers.yml │ ├── builds.yml │ ├── sanity-checks.yml │ └── container-templates.yml ├── manifest.yml ├── containers │ ├── fedora-40.Dockerfile │ ├── fedora-rawhide.Dockerfile │ └── fedora-39.Dockerfile └── gitlab.yml ├── .gitignore ├── examples ├── VisualStudio │ ├── virConnectOpen │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Resources.Designer.cs │ │ │ └── Resources.resx │ │ ├── Program.cs │ │ ├── Form1.cs │ │ ├── virConnectOpen.csproj │ │ └── Form1.Designer.cs │ ├── virDomainStats │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Resources.Designer.cs │ │ │ └── Resources.resx │ │ ├── Program.cs │ │ ├── virDomainStats.csproj │ │ └── Form1.resx │ ├── virConnectOpenAuth │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Resources.Designer.cs │ │ │ └── Resources.resx │ │ ├── Program.cs │ │ └── virConnectOpenAuth.csproj │ ├── virEventRegisterImpl │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Resources.Designer.cs │ │ │ └── Resources.resx │ │ ├── Program.cs │ │ ├── Form1.Designer.cs │ │ ├── virEventRegisterImpl.csproj │ │ └── Form1.resx │ └── virConnectSetErrorFunc │ │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ │ ├── Program.cs │ │ ├── Form1.cs │ │ ├── virConnectSetErrorFunc.csproj │ │ └── Form1.resx └── MonoDevelop │ ├── virDomainStats │ ├── Main.cs │ ├── gtk-gui │ │ └── generated.cs │ ├── AssemblyInfo.cs │ └── virDomainStats.csproj │ ├── virConnectOpen │ ├── Main.cs │ ├── gtk-gui │ │ ├── generated.cs │ │ ├── MainWindow.cs │ │ └── gui.stetic │ ├── AssemblyInfo.cs │ ├── MainWindow.cs │ └── virConnectOpen.csproj │ ├── virConnectOpenAuth │ ├── Main.cs │ ├── gtk-gui │ │ └── generated.cs │ ├── AssemblyInfo.cs │ ├── virConnectOpenAuth.csproj │ └── MainWindow.cs │ ├── virEventRegisterImpl │ ├── Main.cs │ ├── gtk-gui │ │ ├── generated.cs │ │ ├── MainWindow.cs │ │ └── gui.stetic │ ├── AssemblyInfo.cs │ └── virEventRegisterImpl.csproj │ └── virConnectSetErrorFunc │ ├── Main.cs │ ├── gtk-gui │ └── generated.cs │ ├── AssemblyInfo.cs │ ├── MainWindow.cs │ └── virConnectSetErrorFunc.csproj ├── projects ├── MonoDevelop │ ├── LibvirtBindings.dll.config │ ├── AssemblyInfo.cs │ ├── LibvirtBindings.csproj │ └── LibvirtBindings.sln └── VisualStudio │ ├── Properties │ └── AssemblyInfo.cs │ └── LibvirtBindings.csproj ├── Interface.cs ├── Secret.cs ├── .gitlab-ci.yml ├── CONTRIBUTING.rst ├── StringWithoutNativeCleanUpMarshaler.cs ├── NativeFunctions.cs ├── .github └── workflows │ └── lockdown.yml ├── Event.cs ├── Library.cs └── MarshalHelper.cs /ci/lcitool/projects/libvirt-csharp.yml: -------------------------------------------------------------------------------- 1 | --- 2 | packages: 3 | - mono 4 | - monodevelop 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.pidb 3 | *.userprefs 4 | *.user 5 | _ReSharper* 6 | *.obj 7 | *.pdb 8 | Thumbs.db 9 | *.dll 10 | obj/ 11 | [Bb]in/ 12 | [Dd]ebug 13 | *.suo 14 | [Rr]elease/ -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpen/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/VisualStudio/virDomainStats/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpenAuth/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/VisualStudio/virEventRegisterImpl/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectSetErrorFunc/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virDomainStats/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Gtk; 3 | 4 | namespace virDomainStats 5 | { 6 | class MainClass 7 | { 8 | public static void Main (string[] args) 9 | { 10 | Application.Init (); 11 | MainWindow win = new MainWindow (); 12 | win.Show (); 13 | Application.Run (); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpen/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Gtk; 3 | 4 | namespace virConnectOpen 5 | { 6 | class MainClass 7 | { 8 | public static void Main (string[] args) 9 | { 10 | Application.Init (); 11 | MainWindow win = new MainWindow (); 12 | win.Show (); 13 | Application.Run (); 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpenAuth/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Gtk; 3 | 4 | namespace virConnectOpenAuth 5 | { 6 | class MainClass 7 | { 8 | public static void Main (string[] args) 9 | { 10 | Application.Init (); 11 | MainWindow win = new MainWindow (); 12 | win.Show (); 13 | Application.Run (); 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virEventRegisterImpl/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Gtk; 3 | 4 | namespace virEventRegisterImpl 5 | { 6 | class MainClass 7 | { 8 | public static void Main (string[] args) 9 | { 10 | Application.Init (); 11 | MainWindow win = new MainWindow (); 12 | win.Show (); 13 | Application.Run (); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectSetErrorFunc/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Gtk; 3 | 4 | namespace virConnectSetErrorFunc 5 | { 6 | class MainClass 7 | { 8 | public static void Main (string[] args) 9 | { 10 | Application.Init (); 11 | MainWindow win = new MainWindow (); 12 | win.Show (); 13 | Application.Run (); 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /ci/buildenv/fedora-40.sh: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | function install_buildenv() { 8 | dnf update -y 9 | dnf install -y \ 10 | ca-certificates \ 11 | git \ 12 | glibc-langpack-en \ 13 | libvirt-devel \ 14 | mono-devel \ 15 | monodevelop 16 | rpm -qa | sort > /packages.txt 17 | } 18 | 19 | export LANG="en_US.UTF-8" 20 | -------------------------------------------------------------------------------- /ci/buildenv/fedora-rawhide.sh: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | function install_buildenv() { 8 | dnf update -y --nogpgcheck fedora-gpg-keys 9 | dnf distro-sync -y 10 | dnf install -y \ 11 | ca-certificates \ 12 | git \ 13 | glibc-langpack-en \ 14 | libvirt-devel \ 15 | mono-devel \ 16 | monodevelop 17 | rpm -qa | sort > /packages.txt 18 | } 19 | 20 | export LANG="en_US.UTF-8" 21 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpen/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace virConnectOpen 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// Point d'entrée principal de l'application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/VisualStudio/virDomainStats/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace virDomainStats 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// Point d'entrée principal de l'application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ci/gitlab/containers.yml: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | 8 | # Native container jobs 9 | 10 | x86_64-fedora-39-container: 11 | extends: .container_job 12 | allow_failure: false 13 | variables: 14 | NAME: fedora-39 15 | 16 | 17 | x86_64-fedora-40-container: 18 | extends: .container_job 19 | allow_failure: false 20 | variables: 21 | NAME: fedora-40 22 | 23 | 24 | x86_64-fedora-rawhide-container: 25 | extends: .container_job 26 | allow_failure: true 27 | variables: 28 | NAME: fedora-rawhide 29 | -------------------------------------------------------------------------------- /examples/VisualStudio/virEventRegisterImpl/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace virEventRegisterImpl 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// Point d'entrée principal de l'application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /projects/MonoDevelop/LibvirtBindings.dll.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectSetErrorFunc/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace virConnectSetErrorFunc 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// Point d'entrée principal de l'application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ci/manifest.yml: -------------------------------------------------------------------------------- 1 | projects: 2 | - libvirt-csharp 3 | - https://gitlab.com/libvirt/libvirt/-/raw/master/ci/lcitool/projects/libvirt+dist.yml 4 | 5 | gitlab: 6 | namespace: libvirt 7 | project: libvirt-csharp 8 | 9 | targets: 10 | fedora-39: 11 | projects: 12 | - libvirt-csharp 13 | - https://gitlab.com/libvirt/libvirt/-/raw/master/ci/lcitool/projects/libvirt+minimal.yml 14 | - https://gitlab.com/libvirt/libvirt/-/raw/master/ci/lcitool/projects/libvirt+dist.yml 15 | 16 | jobs: 17 | - arch: x86_64 18 | 19 | - arch: x86_64 20 | suffix: -git 21 | template: .native_git_build_job 22 | 23 | fedora-40: x86_64 24 | 25 | fedora-rawhide: x86_64 26 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpen/gtk-gui/generated.cs: -------------------------------------------------------------------------------- 1 | 2 | // This file has been generated by the GUI designer. Do not modify. 3 | namespace Stetic 4 | { 5 | internal class Gui 6 | { 7 | private static bool initialized; 8 | 9 | static internal void Initialize (Gtk.Widget iconRenderer) 10 | { 11 | if ((Stetic.Gui.initialized == false)) { 12 | Stetic.Gui.initialized = true; 13 | } 14 | } 15 | } 16 | 17 | internal class ActionGroups 18 | { 19 | public static Gtk.ActionGroup GetActionGroup (System.Type type) 20 | { 21 | return Stetic.ActionGroups.GetActionGroup (type.FullName); 22 | } 23 | 24 | public static Gtk.ActionGroup GetActionGroup (string name) 25 | { 26 | return null; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpenAuth/gtk-gui/generated.cs: -------------------------------------------------------------------------------- 1 | 2 | // This file has been generated by the GUI designer. Do not modify. 3 | namespace Stetic 4 | { 5 | internal class Gui 6 | { 7 | private static bool initialized; 8 | 9 | static internal void Initialize (Gtk.Widget iconRenderer) 10 | { 11 | if ((Stetic.Gui.initialized == false)) { 12 | Stetic.Gui.initialized = true; 13 | } 14 | } 15 | } 16 | 17 | internal class ActionGroups 18 | { 19 | public static Gtk.ActionGroup GetActionGroup (System.Type type) 20 | { 21 | return Stetic.ActionGroups.GetActionGroup (type.FullName); 22 | } 23 | 24 | public static Gtk.ActionGroup GetActionGroup (string name) 25 | { 26 | return null; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virDomainStats/gtk-gui/generated.cs: -------------------------------------------------------------------------------- 1 | 2 | // This file has been generated by the GUI designer. Do not modify. 3 | namespace Stetic 4 | { 5 | internal class Gui 6 | { 7 | private static bool initialized; 8 | 9 | static internal void Initialize (Gtk.Widget iconRenderer) 10 | { 11 | if ((Stetic.Gui.initialized == false)) { 12 | Stetic.Gui.initialized = true; 13 | } 14 | } 15 | } 16 | 17 | internal class ActionGroups 18 | { 19 | public static Gtk.ActionGroup GetActionGroup (System.Type type) 20 | { 21 | return Stetic.ActionGroups.GetActionGroup (type.FullName); 22 | } 23 | 24 | public static Gtk.ActionGroup GetActionGroup (string name) 25 | { 26 | return null; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectSetErrorFunc/gtk-gui/generated.cs: -------------------------------------------------------------------------------- 1 | 2 | // This file has been generated by the GUI designer. Do not modify. 3 | namespace Stetic 4 | { 5 | internal class Gui 6 | { 7 | private static bool initialized; 8 | 9 | static internal void Initialize (Gtk.Widget iconRenderer) 10 | { 11 | if ((Stetic.Gui.initialized == false)) { 12 | Stetic.Gui.initialized = true; 13 | } 14 | } 15 | } 16 | 17 | internal class ActionGroups 18 | { 19 | public static Gtk.ActionGroup GetActionGroup (System.Type type) 20 | { 21 | return Stetic.ActionGroups.GetActionGroup (type.FullName); 22 | } 23 | 24 | public static Gtk.ActionGroup GetActionGroup (string name) 25 | { 26 | return null; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virEventRegisterImpl/gtk-gui/generated.cs: -------------------------------------------------------------------------------- 1 | 2 | // This file has been generated by the GUI designer. Do not modify. 3 | namespace Stetic 4 | { 5 | internal class Gui 6 | { 7 | private static bool initialized; 8 | 9 | static internal void Initialize (Gtk.Widget iconRenderer) 10 | { 11 | if ((Stetic.Gui.initialized == false)) { 12 | Stetic.Gui.initialized = true; 13 | } 14 | } 15 | } 16 | 17 | internal class ActionGroups 18 | { 19 | public static Gtk.ActionGroup GetActionGroup (System.Type type) 20 | { 21 | return Stetic.ActionGroups.GetActionGroup (type.FullName); 22 | } 23 | 24 | public static Gtk.ActionGroup GetActionGroup (string name) 25 | { 26 | return null; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpenAuth/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | */ 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Windows.Forms; 12 | 13 | namespace virConnectOpenAuth 14 | { 15 | static class Program 16 | { 17 | /// 18 | /// Point d'entrée principal de l'application. 19 | /// 20 | [STAThread] 21 | static void Main() 22 | { 23 | Application.EnableVisualStyles(); 24 | Application.SetCompatibleTextRenderingDefault(false); 25 | Application.Run(new Form1()); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ci/containers/fedora-40.Dockerfile: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | FROM registry.fedoraproject.org/fedora:40 8 | 9 | RUN dnf install -y nosync && \ 10 | printf '#!/bin/sh\n\ 11 | if test -d /usr/lib64\n\ 12 | then\n\ 13 | export LD_PRELOAD=/usr/lib64/nosync/nosync.so\n\ 14 | else\n\ 15 | export LD_PRELOAD=/usr/lib/nosync/nosync.so\n\ 16 | fi\n\ 17 | exec "$@"\n' > /usr/bin/nosync && \ 18 | chmod +x /usr/bin/nosync && \ 19 | nosync dnf update -y && \ 20 | nosync dnf install -y \ 21 | ca-certificates \ 22 | git \ 23 | glibc-langpack-en \ 24 | libvirt-devel \ 25 | mono-devel \ 26 | monodevelop && \ 27 | nosync dnf autoremove -y && \ 28 | nosync dnf clean all -y && \ 29 | rpm -qa | sort > /packages.txt 30 | 31 | ENV LANG "en_US.UTF-8" 32 | -------------------------------------------------------------------------------- /Interface.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | */ 8 | 9 | namespace Libvirt 10 | { 11 | /// 12 | /// The Interface class expose all interface related methods 13 | /// 14 | public class Interface 15 | { 16 | // TODO virInterfaceCreate 17 | 18 | // TODO virInterfaceDefineXML 19 | 20 | // TODO virInterfaceDestroy 21 | 22 | // TODO virInterfaceFree 23 | 24 | // TODO virInterfaceGetConnect 25 | 26 | // TODO virInterfaceGetMACString 27 | 28 | // TODO virInterfaceGetName 29 | 30 | // TODO virInterfaceGetXMLDesc 31 | 32 | // TODO virInterfaceIsActive 33 | 34 | // TODO virInterfaceLookupByMACString 35 | 36 | // TODO virInterfaceLookupByName 37 | 38 | // TODO virInterfaceRef 39 | 40 | // TODO virInterfaceUndefine 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ci/containers/fedora-rawhide.Dockerfile: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | FROM registry.fedoraproject.org/fedora:rawhide 8 | 9 | RUN dnf update -y --nogpgcheck fedora-gpg-keys && \ 10 | dnf install -y nosync && \ 11 | printf '#!/bin/sh\n\ 12 | if test -d /usr/lib64\n\ 13 | then\n\ 14 | export LD_PRELOAD=/usr/lib64/nosync/nosync.so\n\ 15 | else\n\ 16 | export LD_PRELOAD=/usr/lib/nosync/nosync.so\n\ 17 | fi\n\ 18 | exec "$@"\n' > /usr/bin/nosync && \ 19 | chmod +x /usr/bin/nosync && \ 20 | nosync dnf distro-sync -y && \ 21 | nosync dnf install -y \ 22 | ca-certificates \ 23 | git \ 24 | glibc-langpack-en \ 25 | libvirt-devel \ 26 | mono-devel \ 27 | monodevelop && \ 28 | nosync dnf autoremove -y && \ 29 | nosync dnf clean all -y && \ 30 | rpm -qa | sort > /packages.txt 31 | 32 | ENV LANG "en_US.UTF-8" 33 | -------------------------------------------------------------------------------- /Secret.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | */ 8 | 9 | namespace Libvirt 10 | { 11 | /// 12 | /// The Secret class expose all libvirt secret related functions 13 | /// 14 | public class Secret 15 | { 16 | // TODO virSecretDefineXML 17 | 18 | // TODO virSecretFree 19 | 20 | // TODO virSecretGetConnect 21 | 22 | // TODO virSecretGetUUID 23 | 24 | // TODO virSecretGetUUIDString 25 | 26 | // TODO virSecretGetUsageID 27 | 28 | // TODO virSecretGetUsageType 29 | 30 | // TODO virSecretGetValue 31 | 32 | // TODO virSecretGetXMLDesc 33 | 34 | // TODO virSecretLookupByUUID 35 | 36 | // TODO virSecretLookupByUUIDString 37 | 38 | // TODO virSecretLookupByUsage 39 | 40 | // TODO virSecretRef 41 | 42 | // TODO virSecretSetValue 43 | 44 | // TODO virSecretUndefine 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /projects/MonoDevelop/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("LibvirtBindings")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | 28 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virDomainStats/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("virDomainStats")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpen/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("virConnectOpen")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | 28 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | 2 | stages: 3 | - containers 4 | - builds 5 | - sanity_checks 6 | 7 | .native_git_build_job: 8 | extends: 9 | - .gitlab_native_build_job 10 | script: 11 | - export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)" 12 | - export SCRATCH_DIR="/tmp/scratch" 13 | - export VROOT="$SCRATCH_DIR/vroot" 14 | - export LIBDIR="$VROOT/lib" 15 | - export LD_LIBRARY_PATH="$LIBDIR" 16 | - export PATH="$VROOT/bin:$PATH" 17 | - export PKG_CONFIG_PATH="$LIBDIR/pkgconfig" 18 | - pushd "$PWD" 19 | - mkdir -p "$SCRATCH_DIR" 20 | - cd "$SCRATCH_DIR" 21 | - git clone --depth 1 https://gitlab.com/libvirt/libvirt.git 22 | - cd libvirt 23 | - meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR" 24 | - ninja -C build install 25 | - popd 26 | - mdtool build projects/MonoDevelop/LibvirtBindings.csproj 27 | 28 | .native_build_job: 29 | extends: 30 | - .gitlab_native_build_job 31 | script: 32 | - export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)" 33 | - mdtool build projects/MonoDevelop/LibvirtBindings.csproj 34 | 35 | include: '/ci/gitlab.yml' 36 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virEventRegisterImpl/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("virEventRegisterImpl")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpenAuth/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("virConnectOpenAuth")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | 28 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | ============================== 2 | Contributing to libvirt-csharp 3 | ============================== 4 | 5 | The libvirt Csharp API binding accepts code contributions via merge requests 6 | on the GitLab project: 7 | 8 | https://gitlab.com/libvirt/libvirt-csharp/-/merge_requests 9 | 10 | It is required that automated CI pipelines succeed before a merge request 11 | will be accepted. The global pipeline status for the ``master`` branch is 12 | visible at: 13 | 14 | https://gitlab.com/libvirt/libvirt-csharp/pipelines 15 | 16 | CI pipeline results for merge requests will be visible via the contributors' 17 | own private repository fork: 18 | 19 | https://gitlab.com/yourusername/libvirt-csharp/pipelines 20 | 21 | Contributions submitted to the project must be in compliance with the 22 | Developer Certificate of Origin Version 1.1. This is documented at: 23 | 24 | https://developercertificate.org/ 25 | 26 | To indicate compliance, each commit in a series must have a "Signed-off-by" 27 | tag with the submitter's name and email address. This can be added by passing 28 | the ``-s`` flag to ``git commit`` when creating the patches. 29 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectSetErrorFunc/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("virConnectSetErrorFunc")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | 28 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpen/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace virConnectOpen.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/VisualStudio/virDomainStats/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace virDomainStats.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpenAuth/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace virConnectOpenAuth.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /StringWithoutNativeCleanUpMarshaler.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | */ 8 | 9 | using System; 10 | using System.Runtime.InteropServices; 11 | 12 | namespace Libvirt 13 | { 14 | class StringWithoutNativeCleanUpMarshaler : ICustomMarshaler 15 | { 16 | public static ICustomMarshaler GetInstance(string cookie) 17 | { 18 | return new StringWithoutNativeCleanUpMarshaler(); 19 | } 20 | 21 | public object MarshalNativeToManaged(IntPtr pNativeData) 22 | { 23 | return Marshal.PtrToStringAnsi(pNativeData); 24 | } 25 | 26 | public IntPtr MarshalManagedToNative(object ManagedObj) 27 | { 28 | return Marshal.StringToHGlobalAnsi((string) ManagedObj); 29 | } 30 | 31 | public void CleanUpNativeData(IntPtr pNativeData) 32 | { 33 | } 34 | 35 | public void CleanUpManagedData(object ManagedObj) 36 | { 37 | } 38 | 39 | public int GetNativeDataSize() 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /examples/VisualStudio/virEventRegisterImpl/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace virEventRegisterImpl.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectSetErrorFunc/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace virConnectSetErrorFunc.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ci/buildenv/fedora-39.sh: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | function install_buildenv() { 8 | dnf update -y 9 | dnf install -y \ 10 | ca-certificates \ 11 | ccache \ 12 | cpp \ 13 | gcc \ 14 | gettext \ 15 | git \ 16 | glib2-devel \ 17 | glibc-devel \ 18 | glibc-langpack-en \ 19 | gnutls-devel \ 20 | libnl3-devel \ 21 | libtirpc-devel \ 22 | libvirt-devel \ 23 | libxml2 \ 24 | libxml2-devel \ 25 | libxslt \ 26 | make \ 27 | meson \ 28 | mono-devel \ 29 | monodevelop \ 30 | ninja-build \ 31 | perl-base \ 32 | pkgconfig \ 33 | python3 \ 34 | python3-docutils 35 | rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED 36 | rpm -qa | sort > /packages.txt 37 | mkdir -p /usr/libexec/ccache-wrappers 38 | ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc 39 | ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc 40 | } 41 | 42 | export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers" 43 | export LANG="en_US.UTF-8" 44 | export MAKE="/usr/bin/make" 45 | export NINJA="/usr/bin/ninja" 46 | export PYTHON="/usr/bin/python3" 47 | -------------------------------------------------------------------------------- /ci/gitlab/builds.yml: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | 8 | # Native build jobs 9 | 10 | x86_64-fedora-39: 11 | extends: .native_build_job 12 | needs: 13 | - job: x86_64-fedora-39-container 14 | optional: true 15 | allow_failure: false 16 | variables: 17 | NAME: fedora-39 18 | TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:39 19 | 20 | 21 | x86_64-fedora-39-git: 22 | extends: .native_git_build_job 23 | needs: 24 | - job: x86_64-fedora-39-container 25 | optional: true 26 | allow_failure: false 27 | variables: 28 | NAME: fedora-39 29 | TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:39 30 | 31 | 32 | x86_64-fedora-40: 33 | extends: .native_build_job 34 | needs: 35 | - job: x86_64-fedora-40-container 36 | optional: true 37 | allow_failure: false 38 | variables: 39 | NAME: fedora-40 40 | TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:40 41 | 42 | 43 | x86_64-fedora-rawhide: 44 | extends: .native_build_job 45 | needs: 46 | - job: x86_64-fedora-rawhide-container 47 | optional: true 48 | allow_failure: true 49 | variables: 50 | NAME: fedora-rawhide 51 | TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:rawhide 52 | -------------------------------------------------------------------------------- /ci/gitlab/sanity-checks.yml: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | 8 | check-dco: 9 | stage: sanity_checks 10 | needs: [] 11 | image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:latest 12 | interruptible: true 13 | script: 14 | - /check-dco "$RUN_UPSTREAM_NAMESPACE" 15 | rules: 16 | # upstream+forks: Run pipelines on MR 17 | - if: '$CI_PIPELINE_SOURCE =~ "merge_request_event"' 18 | when: on_success 19 | 20 | # forks: pushes to branches with pipeline requested (including upstream env pipelines) 21 | - if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE == "0"' 22 | when: manual 23 | - if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE == "1"' 24 | when: on_success 25 | - if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE_UPSTREAM_ENV == "0"' 26 | when: manual 27 | - if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE_UPSTREAM_ENV == "1"' 28 | when: on_success 29 | 30 | # upstream+forks: that's all folks 31 | - when: never 32 | variables: 33 | GIT_DEPTH: 1000 34 | -------------------------------------------------------------------------------- /NativeFunctions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | */ 8 | 9 | using System; 10 | using System.Runtime.InteropServices; 11 | 12 | namespace Libvirt 13 | { 14 | /// 15 | /// The class expose some useful native functions 16 | /// 17 | public class NativeFunctions 18 | { 19 | // TODO : this is a temporary workaround for virConnectOpenAuth callback, this should be removed 20 | /// 21 | /// duplicate a string. The strdup function shall return a pointer to a new string, which is a duplicate of the string pointed to by s1. 22 | /// 23 | /// Pointer to the string that should be duplicated 24 | /// a pointer to a new string on success. Otherwise, it shall return a null pointer 25 | [DllImport("msvcrt.dll", EntryPoint = "_strdup", CallingConvention = CallingConvention.Cdecl)] 26 | public static extern IntPtr StrDup(IntPtr strSource); 27 | 28 | // TODO : this is a temporary workaround for virConnectOpenAuth callback, this should be removed 29 | [DllImport("msvcrt.dll", EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] 30 | public static extern void Free(IntPtr ptr); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /projects/VisualStudio/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("LibvirtBindings")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("LibvirtBindings")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("293dffa5-843d-4a4e-9cd2-7fe1194cee18")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/VisualStudio/virDomainStats/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("virDomainStats")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("virDomainStats")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("c3dea695-d7b1-4713-979b-2a0a975256a0")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpen/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("virConnectOpen")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("virConnectOpen")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("1dc70eef-7f01-4712-9060-d44bad25ea88")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpenAuth/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("virConnectOpenAuth")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("virConnectOpenAuth")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("ba9903bd-9dd3-489f-b678-7ef7da81c27c")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /.github/workflows/lockdown.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Configuration for Repo Lockdown - https://github.com/dessant/repo-lockdown 3 | 4 | name: 'Repo Lockdown' 5 | 6 | on: 7 | issues: 8 | types: opened 9 | pull_request_target: 10 | types: opened 11 | 12 | permissions: 13 | pull-requests: write 14 | issues: write 15 | 16 | jobs: 17 | action: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: dessant/repo-lockdown@v2 21 | with: 22 | issue-comment: | 23 | Thank you for your interest in the libvirt project. 24 | 25 | Since this repository is a read-only mirror of the project's master 26 | repostory hosted on GitLab, issues opened here are not processed. 27 | 28 | We kindly request that new issues are reported to 29 | 30 | https://gitlab.com/libvirt/libvirt-csharp/-/issues/new 31 | 32 | Thank you for your time and understanding. 33 | lock-issue: true 34 | close-issue: true 35 | pr-comment: | 36 | Thank you for your interest in the libvirt project. 37 | 38 | Since this repository is a read-only mirror of the project's master 39 | repostory hosted on GitLab, merge requests opened here are not 40 | processed. 41 | 42 | We kindly request that contributors fork the project at 43 | 44 | https://gitlab.com/libvirt/libvirt-csharp/ 45 | 46 | push changes to the fork, and then open a new merge request at 47 | 48 | https://gitlab.com/libvirt/libvirt-csharp/-/merge_requests/new 49 | 50 | Thank you for your time and understanding. 51 | lock-pr: true 52 | close-pr: true 53 | -------------------------------------------------------------------------------- /examples/VisualStudio/virEventRegisterImpl/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("virEventRegisterImpl")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("virEventRegisterImpl")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("0634d67c-a40d-4da7-9228-2d2950616998")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectSetErrorFunc/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("virConnectSetErrorFunc")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("virConnectSetErrorFunc")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("308a32b7-b8a1-4093-bfc3-b74b0ee9663e")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ci/gitlab/container-templates.yml: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | 8 | # We want to publish containers with tag 'latest': 9 | # 10 | # - In upstream, for push to default branch with CI changes. 11 | # - In upstream, on request, for scheduled/manual pipelines 12 | # against default branch 13 | # 14 | # Note: never publish from merge requests since they have non-committed code 15 | # 16 | .container_job: 17 | image: docker:latest 18 | stage: containers 19 | interruptible: false 20 | needs: [] 21 | services: 22 | - docker:dind 23 | before_script: 24 | - export TAG="$CI_REGISTRY_IMAGE/ci-$NAME:latest" 25 | - docker info 26 | - docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" 27 | script: 28 | - docker build --tag "$TAG" -f "ci/containers/$NAME.Dockerfile" ci/containers ; 29 | - docker push "$TAG" 30 | after_script: 31 | - docker logout 32 | rules: 33 | # upstream: publish containers if there were CI changes on the default branch 34 | - if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' 35 | when: on_success 36 | changes: 37 | - ci/gitlab/container-templates.yml 38 | - ci/containers/$NAME.Dockerfile 39 | 40 | # upstream: allow force re-publishing containers on default branch for web/api/scheduled pipelines 41 | - if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE =~ /(web|api|schedule)/ && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $RUN_CONTAINER_BUILDS == "1"' 42 | when: on_success 43 | 44 | # upstream+forks: that's all folks 45 | - when: never 46 | -------------------------------------------------------------------------------- /ci/containers/fedora-39.Dockerfile: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | FROM registry.fedoraproject.org/fedora:39 8 | 9 | RUN dnf install -y nosync && \ 10 | printf '#!/bin/sh\n\ 11 | if test -d /usr/lib64\n\ 12 | then\n\ 13 | export LD_PRELOAD=/usr/lib64/nosync/nosync.so\n\ 14 | else\n\ 15 | export LD_PRELOAD=/usr/lib/nosync/nosync.so\n\ 16 | fi\n\ 17 | exec "$@"\n' > /usr/bin/nosync && \ 18 | chmod +x /usr/bin/nosync && \ 19 | nosync dnf update -y && \ 20 | nosync dnf install -y \ 21 | ca-certificates \ 22 | ccache \ 23 | cpp \ 24 | gcc \ 25 | gettext \ 26 | git \ 27 | glib2-devel \ 28 | glibc-devel \ 29 | glibc-langpack-en \ 30 | gnutls-devel \ 31 | libnl3-devel \ 32 | libtirpc-devel \ 33 | libvirt-devel \ 34 | libxml2 \ 35 | libxml2-devel \ 36 | libxslt \ 37 | make \ 38 | meson \ 39 | mono-devel \ 40 | monodevelop \ 41 | ninja-build \ 42 | perl-base \ 43 | pkgconfig \ 44 | python3 \ 45 | python3-docutils && \ 46 | nosync dnf autoremove -y && \ 47 | nosync dnf clean all -y && \ 48 | rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ 49 | rpm -qa | sort > /packages.txt && \ 50 | mkdir -p /usr/libexec/ccache-wrappers && \ 51 | ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ 52 | ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc 53 | 54 | ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" 55 | ENV LANG "en_US.UTF-8" 56 | ENV MAKE "/usr/bin/make" 57 | ENV NINJA "/usr/bin/ninja" 58 | ENV PYTHON "/usr/bin/python3" 59 | -------------------------------------------------------------------------------- /Event.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | */ 8 | 9 | using System.Runtime.InteropServices; 10 | 11 | namespace Libvirt 12 | { 13 | /// 14 | /// The Event class expose all the event related methods 15 | /// 16 | public class Event 17 | { 18 | /// 19 | /// Function to install callbacks 20 | /// 21 | ///the virEventAddHandleFunc which will be called (a delegate) 22 | ///the virEventUpdateHandleFunc which will be called (a delegate) 23 | ///the virEventRemoveHandleFunc which will be called (a delegate) 24 | ///the virEventAddTimeoutFunc which will be called (a delegate) 25 | ///the virEventUpdateTimeoutFunc which will be called (a delegate) 26 | ///the virEventRemoveTimeoutFunc which will be called (a delegate) 27 | [DllImport("libvirt-0.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "virEventRegisterImpl")] 28 | public static extern void RegisterImpl([MarshalAs(UnmanagedType.FunctionPtr)] EventAddHandleFunc addHandle, 29 | [MarshalAs(UnmanagedType.FunctionPtr)] EventUpdateHandleFunc updateHandle, 30 | [MarshalAs(UnmanagedType.FunctionPtr)] EventRemoveHandleFunc removeHandle, 31 | [MarshalAs(UnmanagedType.FunctionPtr)] EventAddTimeoutFunc addTimeout, 32 | [MarshalAs(UnmanagedType.FunctionPtr)] EventUpdateTimeoutFunc updateTimeout, 33 | [MarshalAs(UnmanagedType.FunctionPtr)] EventRemoveTimeoutFunc removeTimeout); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpen/Form1.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | * 8 | * Sample code for : 9 | * Function : 10 | * virConnectOpen 11 | * virConnectNumOfStoragePools 12 | * virConnectListStoragePools 13 | */ 14 | 15 | using System; 16 | using System.Windows.Forms; 17 | using Libvirt; 18 | 19 | namespace virConnectOpen 20 | { 21 | public partial class Form1 : Form 22 | { 23 | public Form1() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | private void btnConnect_Click(object sender, EventArgs e) 29 | { 30 | lbStoragePool.Items.Clear(); 31 | 32 | IntPtr conn = Connect.Open(tbURI.Text); 33 | if (conn != IntPtr.Zero) 34 | { 35 | int numOfStoragePools = Connect.NumOfStoragePools(conn); 36 | if (numOfStoragePools == -1) 37 | { 38 | ShowError("Unable to get the number of storage pools"); 39 | goto cleanup; 40 | } 41 | string[] storagePoolsNames = new string[numOfStoragePools]; 42 | int listStoragePools = Connect.ListStoragePools(conn, ref storagePoolsNames, numOfStoragePools); 43 | if (listStoragePools == -1) 44 | { 45 | ShowError("Unable to list storage pools"); 46 | goto cleanup; 47 | } 48 | foreach (string storagePoolName in storagePoolsNames) 49 | lbStoragePool.Items.Add(storagePoolName); 50 | cleanup: 51 | Connect.Close(conn); 52 | } 53 | else 54 | { 55 | ShowError("Unable to connect"); 56 | } 57 | } 58 | 59 | private void ShowError(string message) 60 | { 61 | MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectSetErrorFunc/Form1.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | * 8 | * Sample code for : 9 | * Functions : 10 | * Connect.OpenAuth 11 | * Domain.GetInfo 12 | * Domain.LookupByName 13 | * Errors.GetLastError 14 | * Errors.SetErrorFunc 15 | * 16 | * Types : 17 | * DomainInfo 18 | * Error 19 | * 20 | */ 21 | 22 | using System; 23 | using System.Windows.Forms; 24 | using Libvirt; 25 | 26 | namespace virConnectSetErrorFunc 27 | { 28 | public partial class Form1 : Form 29 | { 30 | public Form1() 31 | { 32 | InitializeComponent(); 33 | } 34 | 35 | private void btnConnect_Click(object sender, EventArgs e) 36 | { 37 | IntPtr conn = Connect.Open(tbURI.Text); 38 | 39 | if (conn != IntPtr.Zero) 40 | { 41 | Errors.SetErrorFunc(IntPtr.Zero, ErrorCallback); 42 | IntPtr domain = Domain.LookupByName(conn, tbDomainName.Text); 43 | DomainInfo di = new DomainInfo(); 44 | Domain.GetInfo(domain, di); 45 | textBox1.Text = di.State.ToString(); 46 | textBox2.Text = di.maxMem.ToString(); 47 | textBox3.Text = di.memory.ToString(); 48 | textBox4.Text = di.nrVirtCpu.ToString(); 49 | textBox5.Text = di.cpuTime.ToString(); 50 | } 51 | else 52 | { 53 | Error error = Errors.GetLastError(); 54 | ShowError(error); 55 | } 56 | } 57 | 58 | private void ErrorCallback(IntPtr userData, Error error) 59 | { 60 | ShowError(error); 61 | } 62 | 63 | private void ShowError(Error libvirtError) 64 | { 65 | string ErrorBoxMessage = string.Format("Error number : {0}. Error message : {1}", libvirtError.code, libvirtError.Message); 66 | MessageBox.Show(ErrorBoxMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Library.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | */ 8 | 9 | using System.Runtime.InteropServices; 10 | 11 | namespace Libvirt 12 | { 13 | /// 14 | /// The Library class expose all libvirt library related methods 15 | /// 16 | public class Library 17 | { 18 | /// 19 | /// Provides two information back, @libVer is the version of the library while @typeVer will be the version of the hypervisor 20 | /// type @type against which the library was compiled. If @type is NULL, "Xen" is assumed, 21 | /// if @type is unknown or not available, an error code will be returned and @typeVer will be 0. 22 | /// 23 | /// 24 | /// A return value for the library version (OUT). 25 | /// 26 | /// 27 | /// A the type of connection/driver looked at. 28 | /// 29 | /// 30 | /// A return value for the version of the hypervisor (OUT). 31 | /// 32 | /// 33 | /// -1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release. 34 | /// 35 | [DllImport("libvirt-0.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "virGetVersion")] 36 | public static extern int GetVersion([Out] out ulong libVer, [In] string type, [Out] out ulong typeVer); 37 | /// 38 | /// Initialize the library. It's better to call this routine at startup in multithreaded applications to avoid 39 | /// potential race when initializing the library. 40 | /// 41 | /// 42 | /// 0 in case of success, -1 in case of error. 43 | /// 44 | [DllImport("libvirt-0.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "virInitialize")] 45 | public static extern int Initialize(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectSetErrorFunc/MainWindow.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | * 8 | * Sample code for : 9 | * Functions : 10 | * Connect.OpenAuth 11 | * Domain.GetInfo 12 | * Domain.LookupByName 13 | * Errors.GetLastError 14 | * Errors.SetErrorFunc 15 | * 16 | * Types : 17 | * DomainInfo 18 | * Error 19 | * 20 | */ 21 | 22 | using System; 23 | using Gtk; 24 | using Libvirt; 25 | 26 | public partial class MainWindow : Gtk.Window 27 | { 28 | public MainWindow () : base(Gtk.WindowType.Toplevel) 29 | { 30 | Build (); 31 | } 32 | 33 | protected void OnDeleteEvent (object sender, DeleteEventArgs a) 34 | { 35 | Application.Quit (); 36 | a.RetVal = true; 37 | } 38 | protected virtual void OnButton1Clicked (object sender, System.EventArgs e) 39 | { 40 | // Connect to the host 41 | IntPtr conn = Connect.Open(entry1.Text); 42 | if (conn != IntPtr.Zero) 43 | { 44 | // Set error callback. The method "ErrorCallback" will be called when error raised 45 | Errors.SetErrorFunc(IntPtr.Zero, ErrorCallback); 46 | // Try to look up the domain by name 47 | IntPtr domain = Domain.LookupByName(conn, entry2.Text); 48 | 49 | if (domain != IntPtr.Zero) 50 | { 51 | DomainInfo di = new DomainInfo(); 52 | Domain.GetInfo(domain, di); 53 | entry3.Text = di.State.ToString(); 54 | entry4.Text = di.maxMem.ToString(); 55 | entry5.Text = di.memory.ToString(); 56 | entry6.Text = di.nrVirtCpu.ToString(); 57 | entry7.Text = di.cpuTime.ToString(); 58 | 59 | Domain.Free(domain); 60 | } 61 | 62 | Connect.Close(conn); 63 | } 64 | else 65 | { 66 | // Get the last error 67 | Error err = Errors.GetLastError(); 68 | ShowError(err); 69 | } 70 | } 71 | 72 | private void ErrorCallback(IntPtr userData, Error error) 73 | { 74 | ShowError(error); 75 | } 76 | 77 | private void ShowError(Error error) 78 | { 79 | MessageDialog errorMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, error.Message); 80 | errorMsg.Title = "Error"; 81 | if ((ResponseType) errorMsg.Run() == ResponseType.Close) 82 | { 83 | errorMsg.Destroy(); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpen/MainWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Gtk; 3 | using Libvirt; 4 | 5 | public partial class MainWindow : Gtk.Window 6 | { 7 | ListStore StoragePoolListStore = new ListStore(typeof(string)); 8 | TreeViewColumn tvcStoragePools = new TreeViewColumn(); 9 | 10 | public MainWindow () : base(Gtk.WindowType.Toplevel) 11 | { 12 | Build (); 13 | 14 | tvcStoragePools.Title = "Storage pools"; 15 | treeview1.AppendColumn(tvcStoragePools); 16 | 17 | treeview1.Model = StoragePoolListStore; 18 | } 19 | 20 | protected void OnDeleteEvent (object sender, DeleteEventArgs a) 21 | { 22 | Application.Quit (); 23 | a.RetVal = true; 24 | } 25 | 26 | protected virtual void OnButton1Clicked (object sender, System.EventArgs e) 27 | { 28 | StoragePoolListStore.Clear (); 29 | 30 | IntPtr conn = Connect.Open(entry1.Text); 31 | 32 | if (conn != IntPtr.Zero) 33 | { 34 | int numOfStoragePools = Connect.NumOfStoragePools(conn); 35 | if (numOfStoragePools == -1) 36 | { 37 | ShowError("Unable to get the number of storage pools"); 38 | goto cleanup; 39 | } 40 | string[] storagePoolsNames = new string[numOfStoragePools]; 41 | int listStoragePools = Connect.ListStoragePools(conn, ref storagePoolsNames, numOfStoragePools); 42 | if (listStoragePools == -1) 43 | { 44 | ShowError("Unable to list storage pools"); 45 | goto cleanup; 46 | } 47 | foreach (string storagePoolName in storagePoolsNames) 48 | AddStoragePoolInTreeView(storagePoolName); 49 | cleanup: 50 | Connect.Close(conn); 51 | } 52 | else 53 | { 54 | ShowError("Unable to connect"); 55 | } 56 | } 57 | 58 | private void ShowError(string errorMessage) 59 | { 60 | MessageDialog errorMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, errorMessage); 61 | errorMsg.Title = "Error"; 62 | if ((ResponseType) errorMsg.Run() == ResponseType.Close) 63 | { 64 | errorMsg.Destroy(); 65 | } 66 | } 67 | 68 | private void AddStoragePoolInTreeView(string storagePoolName) 69 | { 70 | StoragePoolListStore.AppendValues(storagePoolName); 71 | CellRendererText crtStoragePoolCell = new CellRendererText(); 72 | tvcStoragePools.PackStart(crtStoragePoolCell, true); 73 | tvcStoragePools.AddAttribute(crtStoragePoolCell, "text", 0); 74 | } 75 | } 76 | 77 | -------------------------------------------------------------------------------- /MarshalHelper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | */ 8 | 9 | using System; 10 | using System.Runtime.InteropServices; 11 | 12 | namespace Libvirt 13 | { 14 | /// 15 | /// The MarshalHelper class provide some methods that simplify marshaling 16 | /// 17 | public class MarshalHelper 18 | { 19 | /// 20 | /// Convert an IntPtr to a string array 21 | /// 22 | /// The pointer to the first element of the array 23 | /// The number of elements in the array 24 | /// The string array 25 | public static string[] ptrToStringArray(IntPtr stringPtr, int stringCount) 26 | { 27 | string[] members = new string[stringCount]; 28 | for (int i = 0; i < stringCount; ++i) 29 | { 30 | IntPtr s = Marshal.ReadIntPtr(stringPtr, i * IntPtr.Size); 31 | members[i] = Marshal.PtrToStringAnsi(s); 32 | } 33 | return members; 34 | } 35 | /// 36 | /// Convert an IntPtr to a string 37 | /// 38 | /// The pointer 39 | /// The string 40 | public static string ptrToString(IntPtr stringPtr) 41 | { 42 | IntPtr s = Marshal.ReadIntPtr(stringPtr, IntPtr.Size); 43 | return Marshal.PtrToStringAnsi(s); 44 | } 45 | /// 46 | /// Shift a pointer by offset (32 or 64 bits pointer) 47 | /// 48 | /// The pointer 49 | /// The offset in bytes 50 | /// the shifted pointer 51 | public static IntPtr IntPtrOffset(IntPtr src, int offset) 52 | { 53 | switch (IntPtr.Size) 54 | { 55 | case 4: 56 | return new IntPtr(src.ToInt32() + offset); 57 | case 8: 58 | return new IntPtr(src.ToInt64() + offset); 59 | default: 60 | throw new NotSupportedException("Surprise! This is running on a machine where pointers are " + IntPtr.Size + " bytes and arithmetic doesn't work in C# on them."); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virDomainStats/virDomainStats.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {767373FC-96BE-420A-8219-97146D33B2CB} 7 | WinExe 8 | virDomainStats 9 | virDomainStats 10 | v3.5 11 | 12 | 13 | true 14 | full 15 | false 16 | bin\Debug 17 | DEBUG 18 | prompt 19 | 4 20 | false 21 | 22 | 23 | none 24 | false 25 | bin\Release 26 | prompt 27 | 4 28 | false 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | gui.stetic 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpen/virConnectOpen.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {FFCD939E-7F9A-44D5-AEBC-84F40942E8B5} 7 | WinExe 8 | virConnectOpen 9 | virConnectOpen 10 | v3.5 11 | 12 | 13 | true 14 | full 15 | false 16 | bin\Debug 17 | DEBUG 18 | prompt 19 | 4 20 | false 21 | 22 | 23 | none 24 | false 25 | bin\Release 26 | prompt 27 | 4 28 | false 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | gui.stetic 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | {C51C70EB-9040-4F8E-9A18-DF2A77D04A37} 56 | LibvirtBindings 57 | 58 | 59 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpenAuth/virConnectOpenAuth.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {3259AE36-B12F-435E-9124-F6CAA781AD5C} 7 | WinExe 8 | virConnectOpenAuth 9 | virConnectOpenAuth 10 | v3.5 11 | 12 | 13 | true 14 | full 15 | false 16 | bin\Debug 17 | DEBUG 18 | prompt 19 | 4 20 | false 21 | 22 | 23 | none 24 | false 25 | bin\Release 26 | prompt 27 | 4 28 | false 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | gui.stetic 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | {C51C70EB-9040-4F8E-9A18-DF2A77D04A37} 55 | LibvirtBindings 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virEventRegisterImpl/virEventRegisterImpl.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {4576BB61-F143-4BC8-BD1D-D50F710CEA10} 7 | WinExe 8 | virEventRegisterImpl 9 | virEventRegisterImpl 10 | v3.5 11 | 12 | 13 | true 14 | full 15 | false 16 | bin\Debug 17 | DEBUG 18 | prompt 19 | 4 20 | false 21 | 22 | 23 | none 24 | false 25 | bin\Release 26 | prompt 27 | 4 28 | false 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | gui.stetic 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | {C51C70EB-9040-4F8E-9A18-DF2A77D04A37} 55 | LibvirtBindings 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectSetErrorFunc/virConnectSetErrorFunc.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {243DD685-9AB3-4CD0-93D5-92034C1D97D8} 7 | WinExe 8 | virConnectSetErrorFunc 9 | virConnectSetErrorFunc 10 | v3.5 11 | 12 | 13 | true 14 | full 15 | false 16 | bin\Debug 17 | DEBUG 18 | prompt 19 | 4 20 | false 21 | 22 | 23 | none 24 | false 25 | bin\Release 26 | prompt 27 | 4 28 | false 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | gui.stetic 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | {C51C70EB-9040-4F8E-9A18-DF2A77D04A37} 55 | LibvirtBindings 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpen/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ce code a été généré par un outil. 4 | // Version du runtime :4.0.30319.1 5 | // 6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si 7 | // le code est régénéré. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace virConnectOpen.Properties 12 | { 13 | 14 | 15 | /// 16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. 17 | /// 18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder 19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio. 20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen 21 | // avec l'option /str ou régénérez votre projet VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("virConnectOpen.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes 56 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /examples/VisualStudio/virDomainStats/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ce code a été généré par un outil. 4 | // Version du runtime :4.0.30319.1 5 | // 6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si 7 | // le code est régénéré. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace virDomainStats.Properties 12 | { 13 | 14 | 15 | /// 16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. 17 | /// 18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder 19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio. 20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen 21 | // avec l'option /str ou régénérez votre projet VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("virDomainStats.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes 56 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpenAuth/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ce code a été généré par un outil. 4 | // Version du runtime :4.0.30319.1 5 | // 6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si 7 | // le code est régénéré. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace virConnectOpenAuth.Properties 12 | { 13 | 14 | 15 | /// 16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. 17 | /// 18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder 19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio. 20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen 21 | // avec l'option /str ou régénérez votre projet VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("virConnectOpenAuth.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes 56 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /examples/VisualStudio/virEventRegisterImpl/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ce code a été généré par un outil. 4 | // Version du runtime :4.0.30319.1 5 | // 6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si 7 | // le code est régénéré. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace virEventRegisterImpl.Properties 12 | { 13 | 14 | 15 | /// 16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. 17 | /// 18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder 19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio. 20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen 21 | // avec l'option /str ou régénérez votre projet VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("virEventRegisterImpl.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes 56 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectSetErrorFunc/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ce code a été généré par un outil. 4 | // Version du runtime :4.0.30319.1 5 | // 6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si 7 | // le code est régénéré. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace virConnectSetErrorFunc.Properties 12 | { 13 | 14 | 15 | /// 16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. 17 | /// 18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder 19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio. 20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen 21 | // avec l'option /str ou régénérez votre projet VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("virConnectSetErrorFunc.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes 56 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ci/gitlab.yml: -------------------------------------------------------------------------------- 1 | # THIS FILE WAS AUTO-GENERATED 2 | # 3 | # $ lcitool manifest ci/manifest.yml 4 | # 5 | # https://gitlab.com/libvirt/libvirt-ci 6 | 7 | 8 | # Variables that can be set to control the behaviour of 9 | # pipelines that are run 10 | # 11 | # - RUN_PIPELINE - force creation of a CI pipeline when 12 | # pushing to a branch in a forked repository. Official 13 | # CI pipelines are triggered when merge requests are 14 | # created/updated. Setting this variable allows CI 15 | # testing prior to opening a merge request. A value 16 | # of "0" will create the pipeline but leave all jobs 17 | # to be manually started, while "1" will immediately 18 | # run all default jobs. 19 | # 20 | # - RUN_PIPELINE_UPSTREAM_ENV - same semantics as RUN_PIPELINE, 21 | # but uses the CI environment (containers) from the upstream project 22 | # rather than creating and updating a throwaway environment 23 | # Should not be used if the pushed branch includes CI container 24 | # changes. 25 | # 26 | # - RUN_CONTAINER_BUILDS - CI pipelines in upstream only 27 | # publish containers if CI file changes are detected. 28 | # Setting this variable to a non-empty value will force 29 | # re-publishing, even when no file changes are detected. 30 | # Typically to use from a scheduled job once a month. 31 | # 32 | # - RUN_UPSTREAM_NAMESPACE - the upstream namespace is 33 | # configured to default to 'libvirt'. When testing 34 | # changes to CI it might be useful to use a different 35 | # upstream. Setting this variable will override the 36 | # namespace considered to be upstream. 37 | # 38 | # These can be set as git push options 39 | # 40 | # $ git push -o ci.variable=RUN_PIPELINE=1 41 | # 42 | # Aliases can be set for common usage 43 | # 44 | # $ git config --local alias.push-ci "push -o ci.variable=RUN_PIPELINE=0" 45 | # $ git config --local alias.push-ci-now "push -o ci.variable=RUN_PIPELINE=1" 46 | # 47 | # Allowing the less verbose invocation 48 | # 49 | # $ git push-ci (create pipeline but don't start jobs) 50 | # $ git push-ci-now (create pipeline and start default jobs) 51 | # 52 | # Pipeline variables can also be set in the repository 53 | # pipeline config globally, or set against scheduled pipelines 54 | 55 | 56 | variables: 57 | RUN_UPSTREAM_NAMESPACE: libvirt 58 | FF_SCRIPT_SECTIONS: 1 59 | 60 | 61 | workflow: 62 | rules: 63 | # upstream+forks: Avoid duplicate pipelines on pushes, if a MR is open 64 | - if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS' 65 | when: never 66 | 67 | # upstream+forks: Avoid pipelines on tag pushes 68 | - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG' 69 | when: never 70 | 71 | # upstream+forks: Allow pipelines in scenarios we've figured out job rules 72 | - if: '$CI_PIPELINE_SOURCE =~ /^(push|merge_request_event|api|web|schedule)$/' 73 | when: always 74 | 75 | # upstream+forks: Avoid all other pipelines 76 | - when: never 77 | 78 | 79 | debug: 80 | image: docker.io/library/alpine:3 81 | stage: sanity_checks 82 | interruptible: true 83 | needs: [] 84 | script: 85 | - printenv | sort 86 | rules: 87 | - if: '$RUN_DEBUG' 88 | when: always 89 | 90 | include: 91 | - local: '/ci/gitlab/container-templates.yml' 92 | - local: '/ci/gitlab/build-templates.yml' 93 | - local: '/ci/gitlab/sanity-checks.yml' 94 | - local: '/ci/gitlab/containers.yml' 95 | - local: '/ci/gitlab/builds.yml' 96 | -------------------------------------------------------------------------------- /projects/MonoDevelop/LibvirtBindings.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {C51C70EB-9040-4F8E-9A18-DF2A77D04A37} 7 | Library 8 | LibvirtBindings 9 | LibvirtBindings 10 | v4.5 11 | 12 | 13 | true 14 | full 15 | false 16 | bin\Debug 17 | DEBUG 18 | prompt 19 | 4 20 | false 21 | 22 | 23 | none 24 | false 25 | bin\Release 26 | prompt 27 | 4 28 | false 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | StringWithoutNativeCleanUpMarshaler.cs 37 | 38 | 39 | MarshalHelper.cs 40 | 41 | 42 | NativeFunctions.cs 43 | 44 | 45 | Connect.cs 46 | 47 | 48 | Domain.cs 49 | 50 | 51 | Event.cs 52 | 53 | 54 | Interface.cs 55 | 56 | 57 | Library.cs 58 | 59 | 60 | Network.cs 61 | 62 | 63 | Node.cs 64 | 65 | 66 | Secret.cs 67 | 68 | 69 | StoragePool.cs 70 | 71 | 72 | StorageVol.cs 73 | 74 | 75 | Stream.cs 76 | 77 | 78 | Types.cs 79 | 80 | 81 | Errors.cs 82 | 83 | 84 | 85 | 86 | 87 | Always 88 | 89 | 90 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpen/gtk-gui/MainWindow.cs: -------------------------------------------------------------------------------- 1 | 2 | // This file has been generated by the GUI designer. Do not modify. 3 | 4 | public partial class MainWindow 5 | { 6 | private global::Gtk.Table table1; 7 | 8 | private global::Gtk.Button button1; 9 | 10 | private global::Gtk.Entry entry1; 11 | 12 | private global::Gtk.ScrolledWindow GtkScrolledWindow; 13 | 14 | private global::Gtk.TreeView treeview1; 15 | 16 | private global::Gtk.Label label1; 17 | 18 | protected virtual void Build () 19 | { 20 | global::Stetic.Gui.Initialize (this); 21 | // Widget MainWindow 22 | this.Name = "MainWindow"; 23 | this.Title = global::Mono.Unix.Catalog.GetString ("MainWindow"); 24 | this.WindowPosition = ((global::Gtk.WindowPosition)(4)); 25 | // Container child MainWindow.Gtk.Container+ContainerChild 26 | this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); 27 | this.table1.Name = "table1"; 28 | this.table1.RowSpacing = ((uint)(6)); 29 | this.table1.ColumnSpacing = ((uint)(6)); 30 | // Container child table1.Gtk.Table+TableChild 31 | this.button1 = new global::Gtk.Button (); 32 | this.button1.CanFocus = true; 33 | this.button1.Name = "button1"; 34 | this.button1.UseUnderline = true; 35 | this.button1.Label = global::Mono.Unix.Catalog.GetString ("Connect"); 36 | this.table1.Add (this.button1); 37 | global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1[this.button1])); 38 | w1.TopAttach = ((uint)(1)); 39 | w1.BottomAttach = ((uint)(2)); 40 | w1.LeftAttach = ((uint)(1)); 41 | w1.RightAttach = ((uint)(2)); 42 | w1.XOptions = ((global::Gtk.AttachOptions)(4)); 43 | w1.YOptions = ((global::Gtk.AttachOptions)(4)); 44 | // Container child table1.Gtk.Table+TableChild 45 | this.entry1 = new global::Gtk.Entry (); 46 | this.entry1.CanFocus = true; 47 | this.entry1.Name = "entry1"; 48 | this.entry1.Text = "qemu+tcp://192.168.220.198/session"; 49 | this.entry1.IsEditable = true; 50 | this.table1.Add (this.entry1); 51 | global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1[this.entry1])); 52 | w2.LeftAttach = ((uint)(1)); 53 | w2.RightAttach = ((uint)(2)); 54 | w2.XOptions = ((global::Gtk.AttachOptions)(4)); 55 | w2.YOptions = ((global::Gtk.AttachOptions)(4)); 56 | // Container child table1.Gtk.Table+TableChild 57 | this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); 58 | this.GtkScrolledWindow.Name = "GtkScrolledWindow"; 59 | this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); 60 | // Container child GtkScrolledWindow.Gtk.Container+ContainerChild 61 | this.treeview1 = new global::Gtk.TreeView (); 62 | this.treeview1.CanFocus = true; 63 | this.treeview1.Name = "treeview1"; 64 | this.GtkScrolledWindow.Add (this.treeview1); 65 | this.table1.Add (this.GtkScrolledWindow); 66 | global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow])); 67 | w4.TopAttach = ((uint)(2)); 68 | w4.BottomAttach = ((uint)(3)); 69 | w4.LeftAttach = ((uint)(1)); 70 | w4.RightAttach = ((uint)(2)); 71 | w4.XOptions = ((global::Gtk.AttachOptions)(4)); 72 | // Container child table1.Gtk.Table+TableChild 73 | this.label1 = new global::Gtk.Label (); 74 | this.label1.Name = "label1"; 75 | this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("URI :"); 76 | this.table1.Add (this.label1); 77 | global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1[this.label1])); 78 | w5.XOptions = ((global::Gtk.AttachOptions)(4)); 79 | w5.YOptions = ((global::Gtk.AttachOptions)(4)); 80 | this.Add (this.table1); 81 | if ((this.Child != null)) { 82 | this.Child.ShowAll (); 83 | } 84 | this.DefaultWidth = 251; 85 | this.DefaultHeight = 300; 86 | this.Show (); 87 | this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent); 88 | this.button1.Clicked += new global::System.EventHandler (this.OnButton1Clicked); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virEventRegisterImpl/gtk-gui/MainWindow.cs: -------------------------------------------------------------------------------- 1 | 2 | // This file has been generated by the GUI designer. Do not modify. 3 | 4 | public partial class MainWindow 5 | { 6 | private global::Gtk.Table table1; 7 | 8 | private global::Gtk.Button button1; 9 | 10 | private global::Gtk.Entry entry1; 11 | 12 | private global::Gtk.ScrolledWindow GtkScrolledWindow; 13 | 14 | private global::Gtk.TextView textview1; 15 | 16 | private global::Gtk.Label label1; 17 | 18 | protected virtual void Build () 19 | { 20 | global::Stetic.Gui.Initialize (this); 21 | // Widget MainWindow 22 | this.Name = "MainWindow"; 23 | this.Title = global::Mono.Unix.Catalog.GetString ("MainWindow"); 24 | this.WindowPosition = ((global::Gtk.WindowPosition)(4)); 25 | // Container child MainWindow.Gtk.Container+ContainerChild 26 | this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); 27 | this.table1.Name = "table1"; 28 | this.table1.RowSpacing = ((uint)(6)); 29 | this.table1.ColumnSpacing = ((uint)(6)); 30 | // Container child table1.Gtk.Table+TableChild 31 | this.button1 = new global::Gtk.Button (); 32 | this.button1.CanFocus = true; 33 | this.button1.Name = "button1"; 34 | this.button1.UseUnderline = true; 35 | this.button1.Label = global::Mono.Unix.Catalog.GetString ("Connect"); 36 | this.table1.Add (this.button1); 37 | global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1[this.button1])); 38 | w1.TopAttach = ((uint)(1)); 39 | w1.BottomAttach = ((uint)(2)); 40 | w1.LeftAttach = ((uint)(1)); 41 | w1.RightAttach = ((uint)(2)); 42 | w1.XOptions = ((global::Gtk.AttachOptions)(4)); 43 | w1.YOptions = ((global::Gtk.AttachOptions)(4)); 44 | // Container child table1.Gtk.Table+TableChild 45 | this.entry1 = new global::Gtk.Entry (); 46 | this.entry1.CanFocus = true; 47 | this.entry1.Name = "entry1"; 48 | this.entry1.Text = global::Mono.Unix.Catalog.GetString ("qemu+tcp://192.168.220.198/session"); 49 | this.entry1.IsEditable = true; 50 | this.table1.Add (this.entry1); 51 | global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1[this.entry1])); 52 | w2.LeftAttach = ((uint)(1)); 53 | w2.RightAttach = ((uint)(2)); 54 | w2.XOptions = ((global::Gtk.AttachOptions)(4)); 55 | w2.YOptions = ((global::Gtk.AttachOptions)(4)); 56 | // Container child table1.Gtk.Table+TableChild 57 | this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); 58 | this.GtkScrolledWindow.Name = "GtkScrolledWindow"; 59 | this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); 60 | // Container child GtkScrolledWindow.Gtk.Container+ContainerChild 61 | this.textview1 = new global::Gtk.TextView (); 62 | this.textview1.CanFocus = true; 63 | this.textview1.Name = "textview1"; 64 | this.GtkScrolledWindow.Add (this.textview1); 65 | this.table1.Add (this.GtkScrolledWindow); 66 | global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow])); 67 | w4.TopAttach = ((uint)(2)); 68 | w4.BottomAttach = ((uint)(3)); 69 | w4.LeftAttach = ((uint)(1)); 70 | w4.RightAttach = ((uint)(2)); 71 | w4.XOptions = ((global::Gtk.AttachOptions)(4)); 72 | // Container child table1.Gtk.Table+TableChild 73 | this.label1 = new global::Gtk.Label (); 74 | this.label1.Name = "label1"; 75 | this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("URI :"); 76 | this.table1.Add (this.label1); 77 | global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1[this.label1])); 78 | w5.XOptions = ((global::Gtk.AttachOptions)(4)); 79 | w5.YOptions = ((global::Gtk.AttachOptions)(4)); 80 | this.Add (this.table1); 81 | if ((this.Child != null)) { 82 | this.Child.ShowAll (); 83 | } 84 | this.DefaultWidth = 208; 85 | this.DefaultHeight = 300; 86 | this.Show (); 87 | this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent); 88 | this.button1.Clicked += new global::System.EventHandler (this.OnButton1Clicked); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /examples/VisualStudio/virEventRegisterImpl/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace virEventRegisterImpl 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Variable nécessaire au concepteur. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Nettoyage des ressources utilisées. 12 | /// 13 | /// true si les ressources managées doivent être supprimées ; sinon, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Code généré par le Concepteur Windows Form 24 | 25 | /// 26 | /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas 27 | /// le contenu de cette méthode avec l'éditeur de code. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.tbURI = new System.Windows.Forms.TextBox(); 32 | this.label1 = new System.Windows.Forms.Label(); 33 | this.btnConnect = new System.Windows.Forms.Button(); 34 | this.tbEvents = new System.Windows.Forms.TextBox(); 35 | this.SuspendLayout(); 36 | // 37 | // tbURI 38 | // 39 | this.tbURI.Location = new System.Drawing.Point(50, 12); 40 | this.tbURI.Name = "tbURI"; 41 | this.tbURI.Size = new System.Drawing.Size(222, 20); 42 | this.tbURI.TabIndex = 0; 43 | this.tbURI.Text = "qemu+tcp://192.168.220.198/session"; 44 | // 45 | // label1 46 | // 47 | this.label1.AutoSize = true; 48 | this.label1.Location = new System.Drawing.Point(12, 15); 49 | this.label1.Name = "label1"; 50 | this.label1.Size = new System.Drawing.Size(32, 13); 51 | this.label1.TabIndex = 1; 52 | this.label1.Text = "URI :"; 53 | // 54 | // btnConnect 55 | // 56 | this.btnConnect.Location = new System.Drawing.Point(197, 38); 57 | this.btnConnect.Name = "btnConnect"; 58 | this.btnConnect.Size = new System.Drawing.Size(75, 23); 59 | this.btnConnect.TabIndex = 2; 60 | this.btnConnect.Text = "Connect"; 61 | this.btnConnect.UseVisualStyleBackColor = true; 62 | this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click); 63 | // 64 | // tbEvents 65 | // 66 | this.tbEvents.Location = new System.Drawing.Point(15, 67); 67 | this.tbEvents.Multiline = true; 68 | this.tbEvents.Name = "tbEvents"; 69 | this.tbEvents.ReadOnly = true; 70 | this.tbEvents.Size = new System.Drawing.Size(257, 183); 71 | this.tbEvents.TabIndex = 3; 72 | // 73 | // Form1 74 | // 75 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 76 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 77 | this.ClientSize = new System.Drawing.Size(284, 262); 78 | this.Controls.Add(this.tbEvents); 79 | this.Controls.Add(this.btnConnect); 80 | this.Controls.Add(this.label1); 81 | this.Controls.Add(this.tbURI); 82 | this.Name = "Form1"; 83 | this.Text = "Form1"; 84 | this.Load += new System.EventHandler(this.Form1_Load); 85 | this.ResumeLayout(false); 86 | this.PerformLayout(); 87 | 88 | } 89 | 90 | #endregion 91 | 92 | private System.Windows.Forms.TextBox tbURI; 93 | private System.Windows.Forms.Label label1; 94 | private System.Windows.Forms.Button btnConnect; 95 | private System.Windows.Forms.TextBox tbEvents; 96 | } 97 | } 98 | 99 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpen/virConnectOpen.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {54F79BD5-8E81-4100-BD13-C63072D00B0B} 9 | WinExe 10 | Properties 11 | virConnectOpen 12 | virConnectOpen 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | x86 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | x86 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Form 51 | 52 | 53 | Form1.cs 54 | 55 | 56 | 57 | 58 | Form1.cs 59 | 60 | 61 | ResXFileCodeGenerator 62 | Resources.Designer.cs 63 | Designer 64 | 65 | 66 | True 67 | Resources.resx 68 | 69 | 70 | SettingsSingleFileGenerator 71 | Settings.Designer.cs 72 | 73 | 74 | True 75 | Settings.settings 76 | True 77 | 78 | 79 | 80 | 81 | {592FE0DB-C205-4934-BD20-79BDAB1584C1} 82 | LibvirtBindings 83 | 84 | 85 | 86 | 93 | -------------------------------------------------------------------------------- /examples/VisualStudio/virDomainStats/virDomainStats.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {3BB761F4-FD1F-4089-9FBA-F84CA7452F6E} 9 | WinExe 10 | Properties 11 | virDomainStats 12 | virDomainStats 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | x86 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | x86 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Form 51 | 52 | 53 | Form1.cs 54 | 55 | 56 | 57 | 58 | Form1.cs 59 | 60 | 61 | ResXFileCodeGenerator 62 | Resources.Designer.cs 63 | Designer 64 | 65 | 66 | True 67 | Resources.resx 68 | 69 | 70 | SettingsSingleFileGenerator 71 | Settings.Designer.cs 72 | 73 | 74 | True 75 | Settings.settings 76 | True 77 | 78 | 79 | 80 | 81 | {592FE0DB-C205-4934-BD20-79BDAB1584C1} 82 | LibvirtBindings 83 | 84 | 85 | 86 | 93 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpenAuth/virConnectOpenAuth.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3} 9 | WinExe 10 | Properties 11 | virConnectOpenAuth 12 | virConnectOpenAuth 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | x86 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | x86 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Form 51 | 52 | 53 | Form1.cs 54 | 55 | 56 | 57 | 58 | Form1.cs 59 | 60 | 61 | ResXFileCodeGenerator 62 | Resources.Designer.cs 63 | Designer 64 | 65 | 66 | True 67 | Resources.resx 68 | 69 | 70 | SettingsSingleFileGenerator 71 | Settings.Designer.cs 72 | 73 | 74 | True 75 | Settings.settings 76 | True 77 | 78 | 79 | 80 | 81 | {592FE0DB-C205-4934-BD20-79BDAB1584C1} 82 | LibvirtBindings 83 | 84 | 85 | 86 | 93 | -------------------------------------------------------------------------------- /examples/VisualStudio/virEventRegisterImpl/virEventRegisterImpl.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {E3319DF1-30AA-4B43-82A3-B66463F07305} 9 | WinExe 10 | Properties 11 | virEventRegisterImpl 12 | virEventRegisterImpl 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | x86 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | x86 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Form 51 | 52 | 53 | Form1.cs 54 | 55 | 56 | 57 | 58 | Form1.cs 59 | 60 | 61 | ResXFileCodeGenerator 62 | Resources.Designer.cs 63 | Designer 64 | 65 | 66 | True 67 | Resources.resx 68 | 69 | 70 | SettingsSingleFileGenerator 71 | Settings.Designer.cs 72 | 73 | 74 | True 75 | Settings.settings 76 | True 77 | 78 | 79 | 80 | 81 | {592FE0DB-C205-4934-BD20-79BDAB1584C1} 82 | LibvirtBindings 83 | 84 | 85 | 86 | 93 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectSetErrorFunc/virConnectSetErrorFunc.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {C528AE73-95C1-4D92-961F-3B35A55E3E30} 9 | WinExe 10 | Properties 11 | virConnectSetErrorFunc 12 | virConnectSetErrorFunc 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | x86 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | x86 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Form 51 | 52 | 53 | Form1.cs 54 | 55 | 56 | 57 | 58 | Form1.cs 59 | 60 | 61 | ResXFileCodeGenerator 62 | Resources.Designer.cs 63 | Designer 64 | 65 | 66 | True 67 | Resources.resx 68 | 69 | 70 | SettingsSingleFileGenerator 71 | Settings.Designer.cs 72 | 73 | 74 | True 75 | Settings.settings 76 | True 77 | 78 | 79 | 80 | 81 | {592FE0DB-C205-4934-BD20-79BDAB1584C1} 82 | LibvirtBindings 83 | 84 | 85 | 86 | 93 | -------------------------------------------------------------------------------- /projects/VisualStudio/LibvirtBindings.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {592FE0DB-C205-4934-BD20-79BDAB1584C1} 9 | Library 10 | Properties 11 | Libvirt 12 | LibvirtBindings 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | TRACE;DEBUG;WINDOWS 22 | prompt 23 | 4 24 | false 25 | bin\Debug\LibvirtBindings.XML 26 | x86 27 | 28 | 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | Connect.cs 48 | 49 | 50 | Domain.cs 51 | 52 | 53 | Errors.cs 54 | 55 | 56 | Event.cs 57 | 58 | 59 | Interface.cs 60 | 61 | 62 | Library.cs 63 | 64 | 65 | MarshalHelper.cs 66 | 67 | 68 | NativeFunctions.cs 69 | 70 | 71 | Network.cs 72 | 73 | 74 | Node.cs 75 | 76 | 77 | Secret.cs 78 | 79 | 80 | StoragePool.cs 81 | 82 | 83 | StorageVol.cs 84 | 85 | 86 | Stream.cs 87 | 88 | 89 | StringWithoutNativeCleanUpMarshaler.cs 90 | 91 | 92 | Types.cs 93 | 94 | 95 | 96 | 97 | 104 | -------------------------------------------------------------------------------- /projects/MonoDevelop/LibvirtBindings.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibvirtBindings", "LibvirtBindings.csproj", "{C51C70EB-9040-4F8E-9A18-DF2A77D04A37}" 5 | EndProject 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{504BA6A7-9D0E-44BA-827D-D797773347FD}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virConnectOpenAuth", "..\..\examples\MonoDevelop\virConnectOpenAuth\virConnectOpenAuth.csproj", "{3259AE36-B12F-435E-9124-F6CAA781AD5C}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virConnectOpen", "..\..\examples\MonoDevelop\virConnectOpen\virConnectOpen.csproj", "{FFCD939E-7F9A-44D5-AEBC-84F40942E8B5}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virEventRegisterImpl", "..\..\examples\MonoDevelop\virEventRegisterImpl\virEventRegisterImpl.csproj", "{4576BB61-F143-4BC8-BD1D-D50F710CEA10}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virConnectSetErrorFunc", "..\..\examples\MonoDevelop\virConnectSetErrorFunc\virConnectSetErrorFunc.csproj", "{243DD685-9AB3-4CD0-93D5-92034C1D97D8}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virDomainStats", "..\..\examples\MonoDevelop\virDomainStats\virDomainStats.csproj", "{767373FC-96BE-420A-8219-97146D33B2CB}" 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Debug|Any CPU = Debug|Any CPU 21 | Release|Any CPU = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {243DD685-9AB3-4CD0-93D5-92034C1D97D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {243DD685-9AB3-4CD0-93D5-92034C1D97D8}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {243DD685-9AB3-4CD0-93D5-92034C1D97D8}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {243DD685-9AB3-4CD0-93D5-92034C1D97D8}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {3259AE36-B12F-435E-9124-F6CAA781AD5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {3259AE36-B12F-435E-9124-F6CAA781AD5C}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {3259AE36-B12F-435E-9124-F6CAA781AD5C}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {3259AE36-B12F-435E-9124-F6CAA781AD5C}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {4576BB61-F143-4BC8-BD1D-D50F710CEA10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {4576BB61-F143-4BC8-BD1D-D50F710CEA10}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {4576BB61-F143-4BC8-BD1D-D50F710CEA10}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {4576BB61-F143-4BC8-BD1D-D50F710CEA10}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {767373FC-96BE-420A-8219-97146D33B2CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {767373FC-96BE-420A-8219-97146D33B2CB}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {767373FC-96BE-420A-8219-97146D33B2CB}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {767373FC-96BE-420A-8219-97146D33B2CB}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {C51C70EB-9040-4F8E-9A18-DF2A77D04A37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {C51C70EB-9040-4F8E-9A18-DF2A77D04A37}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {C51C70EB-9040-4F8E-9A18-DF2A77D04A37}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {C51C70EB-9040-4F8E-9A18-DF2A77D04A37}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {FFCD939E-7F9A-44D5-AEBC-84F40942E8B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {FFCD939E-7F9A-44D5-AEBC-84F40942E8B5}.Debug|Any CPU.Build.0 = Debug|Any CPU 46 | {FFCD939E-7F9A-44D5-AEBC-84F40942E8B5}.Release|Any CPU.ActiveCfg = Release|Any CPU 47 | {FFCD939E-7F9A-44D5-AEBC-84F40942E8B5}.Release|Any CPU.Build.0 = Release|Any CPU 48 | EndGlobalSection 49 | GlobalSection(NestedProjects) = preSolution 50 | {3259AE36-B12F-435E-9124-F6CAA781AD5C} = {504BA6A7-9D0E-44BA-827D-D797773347FD} 51 | {FFCD939E-7F9A-44D5-AEBC-84F40942E8B5} = {504BA6A7-9D0E-44BA-827D-D797773347FD} 52 | {4576BB61-F143-4BC8-BD1D-D50F710CEA10} = {504BA6A7-9D0E-44BA-827D-D797773347FD} 53 | {243DD685-9AB3-4CD0-93D5-92034C1D97D8} = {504BA6A7-9D0E-44BA-827D-D797773347FD} 54 | {767373FC-96BE-420A-8219-97146D33B2CB} = {504BA6A7-9D0E-44BA-827D-D797773347FD} 55 | EndGlobalSection 56 | GlobalSection(MonoDevelopProperties) = preSolution 57 | StartupItem = ..\..\examples\MonoDevelop\virDomainStats\virDomainStats.csproj 58 | EndGlobalSection 59 | EndGlobal 60 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpen/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace virConnectOpen 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Variable nécessaire au concepteur. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Nettoyage des ressources utilisées. 12 | /// 13 | /// true si les ressources managées doivent être supprimées ; sinon, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Code généré par le Concepteur Windows Form 24 | 25 | /// 26 | /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas 27 | /// le contenu de cette méthode avec l'éditeur de code. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.gbDomains = new System.Windows.Forms.GroupBox(); 32 | this.lbStoragePool = new System.Windows.Forms.ListBox(); 33 | this.btnConnect = new System.Windows.Forms.Button(); 34 | this.label1 = new System.Windows.Forms.Label(); 35 | this.tbURI = new System.Windows.Forms.TextBox(); 36 | this.gbDomains.SuspendLayout(); 37 | this.SuspendLayout(); 38 | // 39 | // gbDomains 40 | // 41 | this.gbDomains.Controls.Add(this.lbStoragePool); 42 | this.gbDomains.Location = new System.Drawing.Point(15, 67); 43 | this.gbDomains.Name = "gbDomains"; 44 | this.gbDomains.Size = new System.Drawing.Size(257, 131); 45 | this.gbDomains.TabIndex = 15; 46 | this.gbDomains.TabStop = false; 47 | this.gbDomains.Text = "Storage Pools"; 48 | // 49 | // lbStoragePool 50 | // 51 | this.lbStoragePool.FormattingEnabled = true; 52 | this.lbStoragePool.Location = new System.Drawing.Point(6, 19); 53 | this.lbStoragePool.Name = "lbStoragePool"; 54 | this.lbStoragePool.Size = new System.Drawing.Size(245, 95); 55 | this.lbStoragePool.TabIndex = 0; 56 | // 57 | // btnConnect 58 | // 59 | this.btnConnect.Location = new System.Drawing.Point(197, 38); 60 | this.btnConnect.Name = "btnConnect"; 61 | this.btnConnect.Size = new System.Drawing.Size(75, 23); 62 | this.btnConnect.TabIndex = 14; 63 | this.btnConnect.Text = "Connect"; 64 | this.btnConnect.UseVisualStyleBackColor = true; 65 | this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click); 66 | // 67 | // label1 68 | // 69 | this.label1.AutoSize = true; 70 | this.label1.Location = new System.Drawing.Point(12, 15); 71 | this.label1.Name = "label1"; 72 | this.label1.Size = new System.Drawing.Size(32, 13); 73 | this.label1.TabIndex = 9; 74 | this.label1.Text = "URI :"; 75 | // 76 | // tbURI 77 | // 78 | this.tbURI.Location = new System.Drawing.Point(77, 12); 79 | this.tbURI.Name = "tbURI"; 80 | this.tbURI.Size = new System.Drawing.Size(195, 20); 81 | this.tbURI.TabIndex = 8; 82 | this.tbURI.Text = "qemu+tcp://192.168.220.198/session"; 83 | // 84 | // Form1 85 | // 86 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 87 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 88 | this.ClientSize = new System.Drawing.Size(284, 262); 89 | this.Controls.Add(this.gbDomains); 90 | this.Controls.Add(this.btnConnect); 91 | this.Controls.Add(this.label1); 92 | this.Controls.Add(this.tbURI); 93 | this.Name = "Form1"; 94 | this.Text = "Form1"; 95 | this.gbDomains.ResumeLayout(false); 96 | this.ResumeLayout(false); 97 | this.PerformLayout(); 98 | 99 | } 100 | 101 | #endregion 102 | 103 | private System.Windows.Forms.GroupBox gbDomains; 104 | private System.Windows.Forms.ListBox lbStoragePool; 105 | private System.Windows.Forms.Button btnConnect; 106 | private System.Windows.Forms.Label label1; 107 | private System.Windows.Forms.TextBox tbURI; 108 | } 109 | } 110 | 111 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpen/gtk-gui/gui.stetic: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | .. 5 | 2.12 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | MainWindow 14 | CenterOnParent 15 | 16 | 17 | 18 | 19 | 3 20 | 2 21 | 6 22 | 6 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | True 33 | TextOnly 34 | Connect 35 | True 36 | 37 | 38 | 39 | 1 40 | 2 41 | 1 42 | 2 43 | True 44 | Fill 45 | Fill 46 | False 47 | True 48 | False 49 | False 50 | True 51 | False 52 | 53 | 54 | 55 | 56 | 57 | True 58 | qemu+tcp://192.168.220.198/session 59 | True 60 | 61 | 62 | 1 63 | 2 64 | True 65 | Fill 66 | Fill 67 | False 68 | True 69 | False 70 | False 71 | True 72 | False 73 | 74 | 75 | 76 | 77 | 78 | In 79 | 80 | 81 | 82 | True 83 | True 84 | 85 | 86 | 87 | 88 | 2 89 | 3 90 | 1 91 | 2 92 | True 93 | Fill 94 | False 95 | True 96 | False 97 | True 98 | True 99 | False 100 | 101 | 102 | 103 | 104 | 105 | URI : 106 | 107 | 108 | True 109 | Fill 110 | Fill 111 | False 112 | True 113 | False 114 | False 115 | True 116 | False 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virEventRegisterImpl/gtk-gui/gui.stetic: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | .. 5 | 2.12 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | MainWindow 14 | CenterOnParent 15 | 16 | 17 | 18 | 19 | 3 20 | 2 21 | 6 22 | 6 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | True 33 | TextOnly 34 | Connect 35 | True 36 | 37 | 38 | 39 | 1 40 | 2 41 | 1 42 | 2 43 | True 44 | Fill 45 | Fill 46 | False 47 | True 48 | False 49 | False 50 | True 51 | False 52 | 53 | 54 | 55 | 56 | 57 | True 58 | qemu+tcp://192.168.220.198/session 59 | True 60 | 61 | 62 | 1 63 | 2 64 | True 65 | Fill 66 | Fill 67 | False 68 | True 69 | False 70 | False 71 | True 72 | False 73 | 74 | 75 | 76 | 77 | 78 | In 79 | 80 | 81 | 82 | True 83 | True 84 | 85 | 86 | 87 | 88 | 89 | 2 90 | 3 91 | 1 92 | 2 93 | True 94 | Fill 95 | False 96 | True 97 | False 98 | True 99 | True 100 | False 101 | 102 | 103 | 104 | 105 | 106 | URI : 107 | 108 | 109 | True 110 | Fill 111 | Fill 112 | False 113 | True 114 | False 115 | False 116 | True 117 | False 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /examples/VisualStudio/virDomainStats/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectSetErrorFunc/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /examples/VisualStudio/virEventRegisterImpl/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpen/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectOpenAuth/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /examples/VisualStudio/virDomainStats/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /examples/VisualStudio/virConnectSetErrorFunc/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /examples/VisualStudio/virEventRegisterImpl/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 3 | * Arnaud Champion 4 | * Jaromír Červenka 5 | * 6 | * See COPYING.LIB for the License of this software 7 | * 8 | * Sample code for : 9 | * Function : 10 | * virConnectOpen 11 | * virConnectNumOfStoragePools 12 | * virConnectListStoragePools 13 | */ 14 | 15 | using System; 16 | using Gtk; 17 | using Libvirt; 18 | using System.Runtime.InteropServices; 19 | 20 | public partial class MainWindow : Gtk.Window 21 | { 22 | struct AuthData 23 | { 24 | public string user_name; 25 | public string password; 26 | } 27 | 28 | ListStore domainListStore = new ListStore(typeof(string)); 29 | TreeViewColumn tvcDomains = new TreeViewColumn(); 30 | 31 | public MainWindow () : base(Gtk.WindowType.Toplevel) 32 | { 33 | Build (); 34 | 35 | tvcDomains.Title = "Domains"; 36 | treeview1.AppendColumn(tvcDomains); 37 | 38 | treeview1.Model = domainListStore; 39 | 40 | CellRendererText crtDomainCell = new CellRendererText(); 41 | tvcDomains.PackStart(crtDomainCell, true); 42 | tvcDomains.AddAttribute(crtDomainCell, "text", 0); 43 | } 44 | 45 | protected void OnDeleteEvent (object sender, DeleteEventArgs a) 46 | { 47 | Application.Quit (); 48 | a.RetVal = true; 49 | } 50 | 51 | protected virtual void OnButton1Clicked (object sender, System.EventArgs e) 52 | { 53 | // Remove all items 54 | domainListStore.Clear (); 55 | 56 | // Fill a structure to pass username and password to callbacks 57 | AuthData authData = new AuthData { password = entry3.Text, user_name = entry2.Text }; 58 | IntPtr authDataPtr = Marshal.AllocHGlobal(Marshal.SizeOf(authData)); 59 | Marshal.StructureToPtr(authData, authDataPtr, false); 60 | 61 | // Fill a virConnectAuth structure 62 | ConnectAuth auth = new ConnectAuth 63 | { 64 | cbdata = authDataPtr, // The authData structure 65 | cb = AuthCallback, // the method called by callbacks 66 | CredTypes = new[] 67 | { 68 | ConnectCredentialType.VIR_CRED_AUTHNAME, 69 | ConnectCredentialType.VIR_CRED_PASSPHRASE 70 | } // The list of credentials types 71 | }; 72 | 73 | // Request the connection 74 | IntPtr conn = Connect.OpenAuth(entry1.Text, ref auth, 0); 75 | Marshal.FreeHGlobal(authDataPtr); 76 | 77 | if (conn != IntPtr.Zero) 78 | { 79 | // Get the number of defined (not running) domains 80 | int numOfDefinedDomains = Connect.NumOfDefinedDomains(conn); 81 | string[] definedDomainNames = new string[numOfDefinedDomains]; 82 | if (Connect.ListDefinedDomains(conn, ref definedDomainNames, numOfDefinedDomains) == -1) 83 | { 84 | ShowError("Unable to list defined domains"); 85 | goto cleanup; 86 | } 87 | 88 | // Add the domain names to the listbox 89 | foreach (string domainName in definedDomainNames) 90 | { 91 | AddDomainInTreeView(domainName); 92 | } 93 | 94 | // Get the number of running domains 95 | int numOfRunningDomain = Connect.NumOfDomains(conn); 96 | int[] runningDomainIDs = new int[numOfRunningDomain]; 97 | if (Connect.ListDomains(conn, runningDomainIDs, numOfRunningDomain) == -1) 98 | { 99 | ShowError("Unable to list running domains"); 100 | goto cleanup; 101 | } 102 | 103 | // Add the domain names to the listbox 104 | foreach (int runningDomainID in runningDomainIDs) 105 | { 106 | IntPtr domainPtr = Domain.LookupByID(conn, runningDomainID); 107 | if (domainPtr == IntPtr.Zero) 108 | { 109 | ShowError("Unable to lookup domains by id"); 110 | goto cleanup; 111 | } 112 | string domainName = Domain.GetName(domainPtr); 113 | Domain.Free(domainPtr); 114 | if (string.IsNullOrEmpty(domainName)) 115 | { 116 | ShowError("Unable to get domain name"); 117 | goto cleanup; 118 | } 119 | AddDomainInTreeView(domainName); 120 | } 121 | 122 | cleanup: 123 | Connect.Close(conn); 124 | } 125 | else 126 | { 127 | ShowError("Unable to connect"); 128 | } 129 | } 130 | 131 | private void ShowError(string errorMessage) 132 | { 133 | MessageDialog errorMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, errorMessage); 134 | errorMsg.Title = "Error"; 135 | if ((ResponseType) errorMsg.Run() == ResponseType.Close) 136 | { 137 | errorMsg.Destroy(); 138 | } 139 | } 140 | 141 | private void AddDomainInTreeView(string domainName) 142 | { 143 | domainListStore.AppendValues(domainName); 144 | } 145 | 146 | private static int AuthCallback(ref ConnectCredential[] creds, IntPtr cbdata) 147 | { 148 | AuthData authData = (AuthData)Marshal.PtrToStructure(cbdata, typeof(AuthData)); 149 | for (int i = 0; i < creds.Length; i++) 150 | { 151 | ConnectCredential cred = creds[i]; 152 | switch (cred.type) 153 | { 154 | case ConnectCredentialType.VIR_CRED_AUTHNAME: 155 | // Fill the user name 156 | cred.Result = authData.user_name; 157 | break; 158 | case ConnectCredentialType.VIR_CRED_PASSPHRASE: 159 | // Fill the password 160 | cred.Result = authData.password; 161 | break; 162 | default: 163 | return -1; 164 | } 165 | } 166 | return 0; 167 | } 168 | } 169 | 170 | --------------------------------------------------------------------------------