- 26 3月, 2010 11 次提交
-
-
由 Daniel P. Berrange 提交于
This introduces a new event type VIR_DOMAIN_EVENT_ID_WATCHDOG This event includes the action that is about to be taken as a result of the watchdog triggering typedef enum { VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0, VIR_DOMAIN_EVENT_WATCHDOG_PAUSE, VIR_DOMAIN_EVENT_WATCHDOG_RESET, VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF, VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN, VIR_DOMAIN_EVENT_WATCHDOG_DEBUG, } virDomainEventWatchdogAction; Thus there is a new callback definition for this event type typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn, virDomainPtr dom, int action, void *opaque); * daemon/remote.c: Dispatch watchdog events to client * examples/domain-events/events-c/event-test.c: Watch for watchdog events * include/libvirt/libvirt.h.in: Define new watchdg event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle watchdog events * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for watchdogs and emit a libvirt watchdog event * src/remote/remote_driver.c: Receive and dispatch watchdog events to application * src/remote/remote_protocol.x: Wire protocol definition for watchdog events * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for WATCHDOG event from QEMU monitor
-
由 Daniel P. Berrange 提交于
This introduces a new event type VIR_DOMAIN_EVENT_ID_RTC_CHANGE This event includes the new UTC offset measured in seconds. Thus there is a new callback definition for this event type typedef void (*virConnectDomainEventRTCChangeCallback)(virConnectPtr conn, virDomainPtr dom, long long utcoffset, void *opaque); If the guest XML configuration for the <clock> is set to offset='variable', then the XML will automatically be updated with the new UTC offset value. This ensures that during migration/save/restore the new offset is preserved. * daemon/remote.c: Dispatch RTC change events to client * examples/domain-events/events-c/event-test.c: Watch for RTC change events * include/libvirt/libvirt.h.in: Define new RTC change event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle RTC change events * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for RTC changes and emit a libvirt RTC change event * src/remote/remote_driver.c: Receive and dispatch RTC change events to application * src/remote/remote_protocol.x: Wire protocol definition for RTC change events * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for RTC_CHANGE event from QEMU monitor
-
由 Daniel P. Berrange 提交于
The reboot event is not a normal lifecycle event, since the virtual machine on the host does not change state. Rather the guest OS is resetting the virtual CPUs. ie, the QEMU process does not restart. Thus, this does not belong in the current lifecycle events callback. This introduces a new event type VIR_DOMAIN_EVENT_ID_REBOOT It takes no parameters, besides the virDomainPtr, so it can use the generic callback signature. * daemon/remote.c: Dispatch reboot events to client * examples/domain-events/events-c/event-test.c: Watch for reboot events * include/libvirt/libvirt.h.in: Define new reboot event ID * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle reboot events * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for reboots and emit a libvirt reboot event * src/remote/remote_driver.c: Receive and dispatch reboot events to application * src/remote/remote_protocol.x: Wire protocol definition for reboot events
-
由 Daniel P. Berrange 提交于
To avoid confusion, rename the current REMOTE_PROC_DOMAIN_EVENT message to REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE. This does not cause ABI problems, since the names are only relevant at the source code level. On the wire they encoding is a plain integer whose value does not change * src/remote/remote_protocol.x: Rename REMOTE_PROC_DOMAIN_EVENT to REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE. * daemon/remote.c, src/remote/remote_driver.c: Update code for renamed event
-
由 Daniel P. Berrange 提交于
This wires up the remote driver to handle the new events APIs. The public API allows an application to request a callback filters events to a specific domain object, and register multiple callbacks for the same event type. On the wire there are two strategies for this - Register multiple callbacks with the remote daemon, each with filtering as needed - Register only one callback per event type, with no filtering Both approaches have potential inefficiency. In the first scheme, the same event gets sent over the wire many times if multiple callbacks are registered. With the second scheme, unneccessary events get sent over the wire if a per-domain filter is set on the client. The second scheme is far easier to implement though, so this patch takes that approach. * daemon/dispatch.h: Don't export remoteRelayDomainEvent since it is no longer needed for unregistering callbacks, instead the unique callback ID is used * daemon/libvirtd.c, daemon/libvirtd.h: Track and unregister callbacks based on callback ID, instead of function pointer * daemon/remote.c: Switch over to using virConnectDomainEventRegisterAny instead of legacy virConnectDomainEventRegister function. Refactor remoteDispatchDomainEventSend() to cope with arbitrary event types * src/driver.h, src/driver.c: Move verify() call into source file instead of header, to avoid polluting the global namespace with the verify function name * src/remote/remote_driver.c: Implement new APIs for event registration. Refactor processCallDispatchMessage() to cope with arbitrary incoming event types. Merge remoteDomainQueueEvent() into processCallDispatchMessage() to avoid duplication of code. Rename remoteDomainReadEvent() to remoteDomainReadEventLifecycle() * src/remote/remote_protocol.x: Define wire format for the new virConnectDomainEventRegisterAny and virConnectDomainEventDeregisterAny functions
-
由 Daniel P. Berrange 提交于
The libvirtd daemon impl will need to switch over to using the new event APIs. To make this simpler, ensure all drivers currently providing events support both the new APIs and old APIs. * src/lxc/lxc_driver.c, src/qemu/qemu_driver.c, src/test/test_driver.c, src/vbox/vbox_tmpl.c, src/xen/xen_driver.c: Implement the new virConnectDomainEvent(Dereg|Reg)isterAny driver entry points
-
由 Daniel P. Berrange 提交于
The current internal domain events API tracks callbacks based on the function pointer, and only supports lifecycle events. This adds new internal APIs for registering callbacks for other event types. These new APIs are postfixed with the word 'ID' to indicate that they operated based on event ID, instead of hardcoded to lifecycle events * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Add new APIs for handling callbacks for non-lifecycle events
-
由 Daniel P. Berrange 提交于
The internal domain events APIs are designed to handle the lifecycle events. This needs to be refactored to allow arbitrary new event types to be handled. * The signature of virDomainEventDispatchFunc changes to use virConnectDomainEventGenericCallback instead of the lifecycle event specific virConnectDomainEventCallback * Every registered callback gains a unique ID to allow its removal based on ID, instead of function pointer * Every registered callback gains an 'eventID' to allow callbacks for different types of events to be distinguished * virDomainEventDispatch is adapted to filter out callbacks whose eventID does not match the eventID of the event being dispatched * virDomainEventDispatch is adapted to filter based on the domain name and uuid, if this filter is set for a callback. * virDomainEvent type/detail fields are moved into a union to allow different data fields for other types of events to be added later * src/conf/domain_event.h, src/conf/domain_event.c: Refactor to allow handling of different types of events * src/lxc/lxc_driver.c, src/qemu/qemu_driver.c, src/remote/remote_driver.c, src/test/test_driver.c, src/xen/xen_driver.c: Change dispatch function signature to use virConnectDomainEventGenericCallback
-
由 Daniel P. Berrange 提交于
The virtual box driver was directly accesing the domain events structs instead of using the APIs provided. To prevent this kind of abuse, make the struct definitions private, forcing use of the internal APIs. This requires adding one extra internal API. * src/conf/domain_event.h, src/conf/domain_event.c: Move virDomainEventCallback and virDomainEvent structs into the source file instead of header * src/vbox/vbox_tmpl.c: Use official APIs for dispatching domain events instead of accessing structs directly.
-
由 Daniel P. Berrange 提交于
The current API for domain events has a number of problems - Only allows for domain lifecycle change events - Does not allow the same callback to be registered multiple times - Does not allow filtering of events to a specific domain This introduces a new more general purpose domain events API typedef enum { VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0, /* virConnectDomainEventCallback */ ...more events later.. } int virConnectDomainEventRegisterAny(virConnectPtr conn, virDomainPtr dom, /* Optional, to filter */ int eventID, virConnectDomainEventGenericCallback cb, void *opaque, virFreeCallback freecb); int virConnectDomainEventDeregisterAny(virConnectPtr conn, int callbackID); Since different event types can received different data in the callback, the API is defined with a generic callback. Specific events will each have a custom signature for their callback. Thus when registering an event it is neccessary to cast the callback to the generic signature eg int myDomainEventCallback(virConnectPtr conn, virDomainPtr dom, int event, int detail, void *opaque) { ... } virConnectDomainEventRegisterAny(conn, NULL, VIR_DOMAIN_EVENT_ID_LIFECYCLE, VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback) NULL, NULL); The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast to the generic signature * include/libvirt/libvirt.h.in: Define new APIs for registering domain events * src/driver.h: Internal driver entry points for new events APIs * src/libvirt.c: Wire up public API to driver API for events APIs * src/libvirt_public.syms: Export new APIs * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c, src/openvz/openvz_driver.c, src/phyp/phyp_driver.c, src/qemu/qemu_driver.c, src/remote/remote_driver.c, src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c, src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Stub out new API entries
-
由 Jim Meyering 提交于
* cfg.mk (useless_free_options): Add virDomainDefFree to the list of free-like functions. * src/test/test_driver.c (testDomainCreateXML): Remove useless-if- before-virDomainDefFree. * src/conf/domain_conf.c (virDomainAssignDef): Likewise
-
- 25 3月, 2010 3 次提交
-
-
由 Jiri Denemark 提交于
-
由 Matthias Bolte 提交于
The keys of entries in a VMX file are case insensitive. Both scsi0:1.fileName and scsi0:1.filename are valid. Therefore, make the conf parser compare names case insensitive in VMX mode to accept every capitalization variation. Also add test cases for this.
-
由 Matthias Bolte 提交于
<source file=''/> results in def->disks[i]->src == NULL. But vboxDomainDefineXML and vboxDomainAttachDevice didn't check def->disks[i]->src for NULL and expected it to be a valid string. Add checks for def->disks[i]->src != NULL to fix the segfault.
-
- 24 3月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
* src/Makefile.am (augeas-check): New target, just to give the existing rule a name. At the same time, prefix the commands with $(AM_V_GEN), to avoid unexpected build output with V=0 which is the default.
-
- 23 3月, 2010 16 次提交
-
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
由 Jim Meyering 提交于
Before, this function would blindly accept an invalid def->dst and then abuse the idx=-1 it would get from virDiskNameToIndex, when passing it invalid strings like "xvda:disk" and "sda1". Now, this function returns -1 upon failure. * src/conf/domain_conf.c (virDomainDiskDefAssignAddress): as above. Update callers. * src/conf/domain_conf.h: Update prototype. * src/qemu/qemu_conf.c: Update callers.
-
由 Jim Meyering 提交于
* src/util/util.c (virDiskNameToIndex): Accept sda1, and map it to "sda". I.e., accept and ignore any string of trailing digits.
-
由 Matthias Bolte 提交于
virSetCloseExec and virExecDaemonize were missing a body on Windows.
-
由 Matthias Bolte 提交于
Correctly disable pthread related code if pthread is not avialable, in order to get it compile with MinGW on Windows.
-
由 Matthias Bolte 提交于
Even if gnulib can provide stubs, it won't help that much. So just replace affected util functions (virFileOperation and virDirCreate) with stubs on Windows. Both functions aren't used on libvirt's client side, so this is fine for MinGW builds.
-
由 Matthias Bolte 提交于
Add dummy bodies for HAVE_GETPWUID_R and HAVE_MNTENT_H dependent functions for MinGW builds.
-
由 Matthias Bolte 提交于
Use the __declspec(dllexport/dllimport) stuff to export the symbol, otherwise accessing virConnectAuthPtrDefault triggers a segfault.
-
由 Matthias Bolte 提交于
This symbol is conditional, it would need to be exported conditional to work properly with MinGW. So just remove it, as no other driver register function is listed in the symbols files.
-
由 Matthias Bolte 提交于
This is necessary for MinGW builds.
-
由 Matthias Bolte 提交于
Used in esxDomainLookupByName and to be used in esxDomainDefineXML later.
-
由 Matthias Bolte 提交于
If esxVI_String_DeepCopyValue or esxVI_SelectionSpec_AppendToList fail then selectionSpec would leak. Add a free call in the failure path to fix the leak.
-
由 Matthias Bolte 提交于
Replace 'method' with 'function' and get the filename's suffix right.
-
由 Matthias Bolte 提交于
This is actually a consequence of the reworked required parameter checking: Unify the required parameter check into a Validate function instead of doing it separately im the (de)serialization part. The required parameter checking for the mapped methods parameter was done in the (de)serialize functions before. Now it's explicitly done in the mapped method itself.
-
- 22 3月, 2010 3 次提交
-
-
由 Jim Fehlig 提交于
Invoking virDomainSetMemory() on lxc driver results in libvirtd segfault when cgroups has not been configured on the host. Ensure driver->cgroup is non-null before invoking virCgroupForDomain(). To prevent similar segfaults in the future, ensure driver parameter to virCgroupForDomain() is non-null before dereferencing.
-
由 Cole Robinson 提交于
This can be triggered by the qemuStartVMDaemon cleanup path if a VM references a non-existent USB device (by product) in the XML.
-
由 Guido Günther 提交于
"virsh dominfo <vm>" crashes if there's no primary security driver set since we only intialize the secmodel.model and secmodel.doi if we have one. Attached patch checks for securityPrimaryDriver instead of securityDriver since the later is always set in qemudSecurityInit(). Closes: http://bugs.debian.org/574359
-
- 20 3月, 2010 6 次提交
-
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
由 David Allan 提交于
-