- 27 9月, 2019 1 次提交
-
-
由 Daniel Henrique Barboza 提交于
The code to validate the URI path is repeated across several files. This patch creates a common validation code to be used across all of them. Reviewed-by: NCole Robinson <crobinso@redhat.com> Suggested-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 09 8月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Historically URIs handled by the remote driver will always connect to the libvirtd UNIX socket. There will now be one daemon per driver, and each of these has its own UNIX sockets to connect to. It will still be possible to run the traditional monolithic libvirtd though, which will have the original UNIX socket path. In addition there is a virproxyd daemon that doesn't run any drivers, but provides proxying for clients accessing libvirt over IP sockets, or tunnelling to the legacy libvirtd UNIX socket path. Finally when running inside a daemon, the remote driver must not reject connections unconditionally. For example, the QEMU driver needs to be able to connect to the network driver. The remote driver must thus be willing to handle connections even when inside the daemon, provided no local driver is registered. This refactoring enables the remote driver to be able to connect to the per-driver daemons. The URI parameter "mode" accepts the values "auto", "direct" and "legacy" to control which daemons are connected to. The client side libvirt.conf config file also supports a "remote_mode" setting which is used if the URI parameter is not set. If neither the config file or URI parameter set a mode, then "auto" is used, whereby the client looks to see which sockets actually exist right now. The remote driver will only ever spawn the per-driver daemons, or the legacy libvirtd. It won't ever try to spawn virtproxyd, as that is only there for IP based connectivity, or for access from legacy remote clients. If connecting to a remote host over any kind of ssh tunnel, for now we must assume only the legacy socket exists. A future patch will introduce a netcat replacement that is tailored for libvirt to make remote tunnelling easier. The configure arg '--with-remote-default-mode=legacy|direct' allows packagers to set a default at build time. If not given, it will default to legacy mode. Eventually the default will switch to direct mode. Distros can choose to do the switch earlier if desired. The main blocker is testing and suitable SELinux/AppArmor policies. Reviewed-by: NAndrea Bolognani <abologna@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 09 7月, 2019 1 次提交
-
-
由 Eric Blake 提交于
Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 13 6月, 2019 1 次提交
-
-
由 Jonathon Jongsma 提交于
Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 14 12月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Require that all headers are guarded by a symbol named LIBVIRT_$FILENAME where $FILENAME is the uppercased filename, with all characters outside a-z changed into '_'. Note we do not use a leading __ because that is technically a namespace reserved for the toolchain. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 05 12月, 2018 1 次提交
-
-
由 Yuri Chornoivan 提交于
Signed-off-by: NYuri Chornoivan <yurchor@ukr.net> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 11 7月, 2018 1 次提交
-
-
由 Marcos Paulo de Souza 提交于
This new flag will be set when a driver needs a remote URL in order to work, as ESX, HyperV and Phyp. Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com>
-
- 03 5月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
The driver.{c,h} files are primarily targetted at loading hypervisor drivers and some helper functions in that area. It also, however, contains a generically useful function for loading extension modules that is called by the storage driver. Split that functionality off into a new virmodule.{c,h} file to isolate it. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 25 4月, 2018 2 次提交
-
-
由 Daniel P. Berrangé 提交于
Currently the driver module loading code does not report an error if the driver module is physically missing on disk. This is useful for distro packaging optional pieces. When the daemons are split up into one daemon per driver, we will expect module loading to always succeed. If a driver is not desired, the entire daemon should not be installed. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Now that we've activated two hacks to prevent unloading of modules, there is no point passing back a pointer to the loaded library handle. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 12 4月, 2018 2 次提交
-
-
由 Daniel P. Berrangé 提交于
Declare what URI schemes a driver supports in its virConnectDriver struct. This allows us to skip trying to open the driver entirely if the URI scheme doesn't match. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Add a localOnly flag to the virConnectDriver struct which allows a driver to indicate whether it is local-only, or permits remote connections. Stateful drivers running inside libvirtd are generally local only. This allows us to remote the check for uri->server != NULL from most drivers. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 19 2月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
When the test suite is running, we don't want to be triggering the startup of daemons for the secondary drivers. Thus we must provide a way to set a custom connection for the secondary drivers, to override the default logic which opens a new connection. This will also be useful for code where we have a whole set of separate functions calls all needing the secret driver. Currently the connection to the secret driver is opened & closed many times in quick succession. This will allow us to pre-open a connection temporarily, improving the performance of startup. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 01 2月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Various parts of libvirt will want to open connections to secondary drivers. The right URI to use will depend on the context, so rather than duplicating that logic in various places, use some helper APIs. This will also make it easier for us to later pre-open/cache connections to avoid repeated opening & closing the same connectiong during autostart. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 03 11月, 2017 1 次提交
-
-
由 Andrea Bolognani 提交于
Right-aligning backslashes when defining macros or using complex commands in Makefiles looks cute, but as soon as any changes is required to the code you end up with either distractingly broken alignment or unnecessarily big diffs where most of the changes are just pushing all backslashes a few characters to one side. Generated using $ git grep -El '[[:blank:]][[:blank:]]\\$' | \ grep -E '*\.([chx]|am|mk)$$' | \ while read f; do \ sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \ done Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
-
- 21 2月, 2017 2 次提交
-
-
由 Peter Krempa 提交于
Pass the registration function name to virDriverLoadModule so that we can later call specific functions if necessary (e.g. for testing purposes). This gets rid of the rather ugly automatic name generator and unifies the code to load/initialize the modules. It's also clear which registration function gets called.
-
由 Peter Krempa 提交于
Split the convoluted driver loader function into simpler parts which will potentially allow reuse.
-
- 27 1月, 2015 2 次提交
-
-
由 Daniel P. Berrange 提交于
For stateless, client side drivers, it is never correct to probe for secondary drivers. It is only ever appropriate to use the secondary driver that is associated with the hypervisor in question. As a result the ESX & HyperV drivers have both been forced to do hacks where they register no-op drivers for the ones they don't implement. For stateful, server side drivers, we always just want to use the same built-in shared driver. The exception is virtualbox which is really a stateless driver and so wants to use its own server side secondary drivers. To deal with this virtualbox has to be built as 3 separate loadable modules to allow registration to work in the right order. This can all be simplified by introducing a new struct recording the precise set of secondary drivers each hypervisor driver wants struct _virConnectDriver { virHypervisorDriverPtr hypervisorDriver; virInterfaceDriverPtr interfaceDriver; virNetworkDriverPtr networkDriver; virNodeDeviceDriverPtr nodeDeviceDriver; virNWFilterDriverPtr nwfilterDriver; virSecretDriverPtr secretDriver; virStorageDriverPtr storageDriver; }; Instead of registering the hypervisor driver, we now just register a virConnectDriver instead. This allows us to remove all probing of secondary drivers. Once we have chosen the primary driver, we immediately know the correct secondary drivers to use. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
A bunch of code is wrapped in #if WITH_LIBVIRTD in order to enable the virStateDriver to be disabled when libvirtd is not built. Disabling this code doesn't have any real functional benefit beyond removing 1 pointer from the virConnectPtr struct, while having a cost of many more conditionals. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 23 10月, 2014 2 次提交
-
-
由 Daniel P. Berrange 提交于
With the large number of APIs in libvirt the driver.h file, it is easy to get lost looking for things. Split each driver into a separate header file based on the functional driver groups. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
To prepare for introducing a single global driver, rename the virDriver struct to virHypervisorDriver and the registration API to virRegisterHypervisorDriver()
-
- 25 9月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
A long time ago in a galaxy far, far away it has been decided that libvirt will manage not only domains but host as well. And with my latest work on qemu driver supporting huge pages, we miss the cherry on top: an API to allocate huge pages on the run. Currently users are forced to log into the host and adjust the huge pages pool themselves. However, with this API the problem is gone - they can both size up and size down the pool. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 18 9月, 2014 3 次提交
-
-
由 Wang Yufei 提交于
Clean up all _virDomainMemoryStat. Signed-off-by: NJames <james.wangyufei@huawei.com> Signed-off-by: NWang Rui <moon.wangrui@huawei.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Wang Yufei 提交于
Clean up all _virDomainBlockStats. Signed-off-by: NJames <james.wangyufei@huawei.com> Signed-off-by: NWang Rui <moon.wangrui@huawei.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Wang Yufei 提交于
Clean up all _virDomainInterfaceStats. Signed-off-by: NWang Yufei <james.wangyufei@huawei.com> Signed-off-by: NWang Rui <moon.wangrui@huawei.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 27 8月, 2014 4 次提交
-
-
由 Eric Blake 提交于
Let's fix this before we bake in a painful API. Since we know that we have exactly one non-negative fd on success, we might as well return the fd directly instead of forcing the user to pass in a pointer. Furthermore, I found some memory and fd leaks while reviewing the code - the idea is that on success, libvirtd will have handed two fds in two different directions: one to qemu, and one to the RPC client. * include/libvirt/libvirt.h.in (virDomainOpenGraphicsFD): Drop unneeded parameter. * src/driver.h (virDrvDomainOpenGraphicsFD): Likewise. * src/libvirt.c (virDomainOpenGraphicsFD): Adjust interface to return fd directly. * daemon/remote.c (remoteDispatchDomainOpenGraphicsFd): Adjust semantics. * src/qemu/qemu_driver.c (qemuDomainOpenGraphicsFD): Likewise, and plug fd leak. * src/remote/remote_driver.c (remoteDomainOpenGraphicsFD): Likewise, and plug memory and fd leak. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
This commit (finally) adds the virDomainBlockCopy API, with the intent that it will provide more power to the existing 'virsh blockcopy' command. 'virsh blockcopy' was first added in Apr 2012 (v0.9.12), which corresponds to the upstream qemu 1.2 timeframe. It was done as a hack on top of the existing virDomainBlockRebase() API call, for two reasons: 1) it was targetting a feature that landed first in downstream RHEL qemu, but had not stabilized in upstream qemu at the time (and indeed, 'drive-mirror' only landed upstream in qemu 1.3 with slight differences to the first RHEL attempt, and later gained further parameters like granularity and buf-size that are also worth exposing), and 2) extending an existing API allowed it to be backported without worrying about bumping .so versions. A virDomainBlockCopy() API was proposed at that time [1], but we decided not to accept it into libvirt until after upstream qemu stabilized, and it ended up getting scrapped. Whether or not RHEL should have attempted adding a new feature without getting it upstream first is a debate that can be held another day; but enough time has now elapsed that we are ready to do the interface cleanly. [1] https://www.redhat.com/archives/libvir-list/2012-April/msg00768.html Delaying the creation of a clean API until now has also had a benefit: we've only recently learned of a few shortcomings in the original design: 1) it is unable to target a network destination (such as a gluster volume) because it hard-coded the assumption that the destination is a local file name. Because of all the refactoring we've done to add virStorageSourcePtr, we are in a better position to declare an API that parses XML describing a host storage source as the copy destination, which was not possible had we implemented virDomainBlockCopy as it had been originally envisioned (although a network target will have to wait until a later libvirt release compared to the API addition to actually be implemented). 2) the design of using MiB/sec as the bandwidth throttle is rather coarse; qemu is actually tuned to bytes/second, and libvirt is preventing access to that level of detail. A later patch will add flags to existing block job API that can request bytes/second instead of back-compat MiB/s, but as this is a new API, we can get it right to begin with. At least I had the foresight to create 'virsh blockcopy' as a separate command at the UI level (commit 1f06c007) rather than leaking the underlying API overload of virDomainBlockRebase onto shell users. A further note on the bandwidth option: virTypedParameters intentionally lacks unsigned long (since variable-width interaction between mixed 32- vs. 64-bit client/server setups is nasty), but we have to deal with the fact that we are interacting with existing older code that mistakenly chose unsigned long bandwidth at a point before we decided to prohibit it in all new API. The typed parameter is therefore unsigned long long, but the implementation (in a later patch) will have to do overflow detection on 32-bit platforms, as well as capping the value to match the LLONG_MAX>>20 cap of the existing MiB/s interfaces. * include/libvirt/libvirt.h.in (virDomainBlockCopy): New API. (virDomainBlockJobType, virConnectDomainEventBlockJobStatus): Update related documentation. * src/libvirt.c (virDomainBlockCopy): Implement it. * src/libvirt_public.syms (LIBVIRT_1.2.8): Export it. * src/driver.h (_virDriver): New driver callback. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
The motivation for this API is that management layers that use libvirt usually poll for statistics using various split up APIs we currently provide. To get all the necessary stuff, the app needs to issue a lot of calls and aggregate the results. The APIs I'm introducing here: 1) Returns data in a format that we can expand in the future and is (pseudo) hierarchical. The data is returned as typed parameters where the fields are constructed as dot-separated strings containing names and other stuff in a list of typed params. 2) Stats for multiple (all) domains can be queried at once and are returned in one call. This will decrease the overhead necessary to issue multiple calls per domain multiplied by the count of domains. 3) Selectable (bit mask) fields in the returned format. This will allow to retrieve only specific stats according to the app's need. The stats groups will be enabled using a bit field @stats passed as the function argument. A few sample stats groups that this API will support: VIR_DOMAIN_STATS_STATE VIR_DOMAIN_STATS_CPU VIR_DOMAIN_STATS_BLOCK VIR_DOMAIN_STATS_INTERFACE (Note that this is only an example, the initial implementation supports only VIR_DOMAIN_STATS_STATE while others will be added later.) the returned typed params will use the following scheme state.state = VIR_DOMAIN_RUNNING state.reason = VIR_DOMAIN_RUNNING_BOOTED (the actual values according to the enum) cpu.count = 8 cpu.0.state = running cpu.0.time = 1234
-
由 Ján Tomko 提交于
Define the public API implementation and declare internal driver prototype.
-
- 22 8月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
On some places in the libvirt code we have: f(a,z) instead of f(a, z) This trivial patch fixes couple of such occurrences. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 19 8月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
The prototype was along with domain API prototypes instead of network API ones.
-
- 03 7月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
The API should expose the information contained in virDomainCapsPtr. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 27 6月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
Instead of maintaining two very similar APIs, add the "@mac" parameter to virNetworkGetDHCPLeases and kill virNetworkGetDHCPLeasesForMAC. Both of those functions would return data the same way, so making @mac an optional filter simplifies a lot of stuff.
-
- 24 6月, 2014 1 次提交
-
-
由 Nehal J Wani 提交于
Introduce 3 new APIs, virNetworkGetDHCPLeases, virNetworkGetDHCPLeasesForMAC and virNetworkDHCPLeaseFree. * virNetworkGetDHCPLeases: returns the dhcp leases information for a given virtual network. For DHCPv4, the information returned: - Network Interface Name - Expiry Time - MAC address - IAID (NULL) - IPv4 address (with type and prefix) - Hostname (can be NULL) - Client ID (can be NULL) For DHCPv6, the information returned: - Network Interface Name - Expiry Time - MAC address - IAID (can be NULL, only in rare cases) - IPv6 address (with type and prefix) - Hostname (can be NULL) - Client DUID Note: @mac, @iaid, @ipaddr, @clientid are in ASCII form, not raw bytes. Note: @expirytime can 0, in case the lease is for infinite time. * virNetworkGetDHCPLeasesForMAC: returns the dhcp leases information for a given virtual network and specified MAC Address. * virNetworkDHCPLeaseFree: allows the upper layer application to free the network interface object conveniently. There is no support for flags, so user is expected to pass 0 for both the APIs. include/libvirt/libvirt.h.in: * Define virNetworkGetDHCPLeases * Define virNetworkGetDHCPLeasesForMAC * Define virNetworkDHCPLeaseFree src/driver.h: * Define networkGetDHCPLeases * Define networkGetDHCPLeasesForMAC src/libvirt.c: * Implement virNetworkGetDHCPLeases * Implement virNetworkGetDHCPLeasesForMAC * Implement virNetworkDHCPLeaseFree src/libvirt_public.syms: * Export the new symbols
-
- 19 6月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
The aim of the API is to get information on number of free pages on the system. The API behaves similar to the virNodeGetCellsFreeMemory(). User passes starting NUMA cell, the count of nodes that he's interested in, pages sizes (yes, multiple sizes can be queried at once) and the counts are returned in an array. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 5月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
These APIs allow users to get or set time in a domain, which may come handy if the domain has been resumed just recently and NTP is not configured or hasn't kicked in yet and the guest is running something time critical. In addition, NTP may refuse to re-set the clock if the skew is too big. In addition, new ACL attribute is introduced 'set_time'. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 07 5月, 2014 1 次提交
-
-
由 Tomoki Sekiyama 提交于
These will freeze and thaw filesystems within guest specified by @mountpoints parameters. The parameters can be NULL and 0, then all mounted filesystems are frozen or thawed. @flags parameter, which are currently not used, is for future extensions. Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@hds.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 25 4月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
Replace virDriverModuleInitialize with virFileFindResource usage. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 25 3月, 2014 1 次提交
-
-
由 Qiao Nuohan 提交于
--memory-only option is introduced without compression supported. Now qemu has support for dumping domain's memory in kdump-compressed format. This patch adds a new virDomainCoreDumpWithFormat API, so that the format in which qemu dumps domain's memory can be specified. Signed-off-by: NQiao Nuohan <qiaonuohan@cn.fujitsu.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 21 3月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Several times in the past, qemu has implemented a new event, but libvirt has not yet caught up to reporting that event to the user applications. While it is possible to track libvirt logs to see that an unknown event was received and ignored, it would be nicer to copy what 'virsh qemu-monitor-command' does, and expose this information to the end developer as one of our unsupported qemu-specific commands. If you find yourself needing to use this API for more than just development purposes, please ask on the libvirt list for a supported counterpart event to be added in libvirt.so. While the supported virConnectDomainEventRegisterAny() API takes an id which determines the signature of the callback, this version takes a string filter and always uses the same signature. Furthermore, I chose to expose this as a new API instead of trying to add a new eventID at the top level, in part because the generic option lacks event name filtering, and in part because the normal domain event namespace should not be polluted by a qemu-only event. I also added a flags argument; unused for now, but we might decide to use it to allow a user to request event names by glob or regex instead of literal match. This API intentionally requires full write access (while normal event registration is allowed on read-only clients); this is in part due to the fact that it should only be used by debugging situations, and in part because the design of per-event filtering in later patches ended up allowing for duplicate registrations that could potentially be abused to exhaust server memory - requiring write privileges means that such abuse will not serve as a denial of service attack against users with higher privileges. * include/libvirt/libvirt-qemu.h (virConnectDomainQemuMonitorEventCallback) (virConnectDomainQemuMonitorEventRegister) (virConnectDomainQemuMonitorEventDeregister): New prototypes. * src/libvirt-qemu.c (virConnectDomainQemuMonitorEventRegister) (virConnectDomainQemuMonitorEventDeregister): New functions. * src/libvirt_qemu.syms (LIBVIRT_QEMU_1.2.1): Export them. * src/driver.h (virDrvConnectDomainQemuMonitorEventRegister) (virDrvConnectDomainQemuMonitorEventDeregister): New callbacks. Signed-off-by: NEric Blake <eblake@redhat.com>
-