- 07 5月, 2014 1 次提交
-
-
由 Tomoki Sekiyama 提交于
New rules are added in fixup_name in gendispatch.pl to keep the name FSFreeze and FSThaw. This adds a new ACL permission 'fs_freeze', which is also applied to VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE flag. Signed-off-by: NTomoki Sekiyama <tomoki.sekiyama@hds.com> Acked-by: NDaniel P. Berrange <berrange@redhat.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 21 3月, 2014 1 次提交
-
-
由 Eric Blake 提交于
These are the first async events in the qemu protocol, so this patch looks rather big compared to most RPC additions. However, a large majority of this patch is just mechanical copy-and-paste from recently-added network events. It didn't help that this is also the first virConnect rather than virDomain prefix associated with a qemu-specific API. * src/remote/qemu_protocol.x (qemu_*_domain_monitor_event_*): New structs and RPC messages. * src/rpc/gendispatch.pl: Adjust naming conventions. * daemon/libvirtd.h (daemonClientPrivate): Track qemu events. * daemon/remote.c (remoteClientFreeFunc): Likewise. (remoteRelayDomainQemuMonitorEvent) (qemuDispatchConnectDomainMonitorEventRegister) (qemuDispatchConnectDomainMonitorEventDeregister): New functions. * src/remote/remote_driver.c (qemuEvents): Handle qemu events. (doRemoteOpen): Register for events. (remoteNetworkBuildEventLifecycle) (remoteConnectDomainQemuMonitorEventRegister) (remoteConnectDomainQemuMonitorEventDeregister): New functions. * src/qemu_protocol-structs: Regenerate. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 10 8月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
The gendispatch.pl script puts comments at the top of files it creates, saying that it auto-generated them. Also include the name of the source data file which it reads when doing the auto-generation. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 08 8月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
So that app developers / admins know what access control checks are performed for each API, this patch extends the API docs generator to include details of the ACLs for each. The gendispatch.pl script is extended so that it generates a simple XML describing ACL rules, eg. <aclinfo> ... <api name='virConnectNumOfDomains'> <check object='connect' perm='search_domains'/> <filter object='domain' perm='getattr'/> </api> <api name='virDomainAttachDeviceFlags'> <check object='domain' perm='write'/> <check object='domain' perm='save' flags='!VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE'/> <check object='domain' perm='save' flags='VIR_DOMAIN_AFFECT_CONFIG'/> </api> ... </aclinfo> The newapi.xsl template loads the XML files containing the ACL rules and generates a short block of HTML for each API describing the parameter checks and return value filters (if any). Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 11 7月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Convert the type of loop iterators named 'i', 'j', k', 'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or 'unsigned int', also santizing 'ii', 'jj', 'kk' to use the normal 'i', 'j', 'k' naming Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 10 7月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 03 7月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Change the ACL filter functions to use a 'bool' return type instead of a tri-state 'int' return type. The callers of these functions don't want to distinguish 'auth failed' from other errors. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 24 6月, 2013 2 次提交
-
-
由 Daniel P. Berrange 提交于
Extend the 'gendispatch.pl' script to be able to generate three new types of file. - 'aclheader' - defines signatures of helper APIs for doing authorization checks. There is one helper API for each API requiring an auth check. Any @acl annotations result in a method being generated with a suffix of 'EnsureACL'. If the ACL check requires examination of flags, an extra 'flags' param will be present. Some examples extern int virConnectBaselineCPUEnsureACL(void); extern int virConnectDomainEventDeregisterEnsureACL(virDomainDefPtr domain); extern int virDomainAttachDeviceFlagsEnsureACL(virDomainDefPtr domain, unsigned int flags); Any @aclfilter annotations resuilt in a method being generated with a suffix of 'CheckACL'. extern int virConnectListAllDomainsCheckACL(virDomainDefPtr domain); These are used for filtering individual objects from APIs which return a list of objects - 'aclbody' - defines the actual implementation of the methods described above. This calls into the access manager APIs. A complex example: /* Returns: -1 on error (denied==error), 0 on allowed */ int virDomainAttachDeviceFlagsEnsureACL(virConnectPtr conn, virDomainDefPtr domain, unsigned int flags) { virAccessManagerPtr mgr; int rv; if (!(mgr = virAccessManagerGetDefault())) return -1; if ((rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_WRITE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE)) == 0) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } if (((flags & (VIR_DOMAIN_AFFECT_CONFIG)) == (VIR_DOMAIN_AFFECT_CONFIG)) && (rv = virAccessManagerCheckDomain(mgr, conn->driver->name, domain, VIR_ACCESS_PERM_DOMAIN_SAVE)) <= 0) { virObjectUnref(mgr); if (rv == 0) virReportError(VIR_ERR_ACCESS_DENIED, NULL); return -1; } virObjectUnref(mgr); return 0; } - 'aclsyms' - generates a linker script to export the APIs to drivers. Some examples virConnectBaselineCPUEnsureACL; virConnectCompareCPUEnsureACL; Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Introduce annotations to all RPC messages to declare what access control checks are required. There are two new annotations defined: @acl: <object>:<permission> @acl: <object>:<permission>:<flagname> Declare the access control requirements for the API. May be repeated multiple times, if multiple rules are required. <object> is one of 'connect', 'domain', 'network', 'storagepool', 'interface', 'nodedev', 'secret'. <permission> is one of the permissions in access/viraccessperm.h <flagname> indicates the rule only applies if the named flag is set in the API call @aclfilter: <object>:<permission> Declare an access control filter that will be applied to a list of objects being returned by an API. This allows the returned list to be filtered to only show those the user has permissions against Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 23 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 21 5月, 2013 1 次提交
-
-
由 Eric Blake 提交于
Several files called out COPYING or COPYING.LIB instead of using the normal boilerplate. It's especially important that we don't call out COPYING from an LGPL file, since COPYING is traditionally used for the GPL. A few files were lacking copyright altogether. * src/rpc/gendispatch.pl: Add missing copyright. * Makefile.nonreentrant: Likewise. * src/check-symfile.pl: Likewise. * src/check-symsorting.pl: Likewise. * src/driver.h: Likewise. * src/internal.h: Likewise. * tools/libvirt-guests.sh.in: Likewise. * tools/virt-pki-validate.in: Mention copyright in comment, not just code. * tools/virt-sanlock-cleanup.in: Likewise. * src/rpc/genprotocol.pl: Spell out license terms. * src/xen/xend_internal.h: Likewise. * src/xen/xend_internal.c: Likewise. * Makefile.am: Likewise. * daemon/Makefile.am: Likewise. * docs/Makefile.am: Likewise. * docs/schemas/Makefile.am: Likewise. * examples/apparmor/Makefile.am: Likewise. * examples/domain-events/events-c/Makefile.am: Likewise. * examples/dominfo/Makefile.am: Likewise. * examples/domsuspend/Makefile.am: Likewise. * examples/hellolibvirt/Makefile.am: Likewise. * examples/openauth/Makefile.am: Likewise. * examples/python/Makefile.am: Likewise. * examples/systemtap/Makefile.am: Likewise. * examples/xml/nwfilter/Makefile.am: Likewise. * gnulib/lib/Makefile.am: Likewise. * gnulib/tests/Makefile.am: Likewise. * include/Makefile.am: Likewise. * include/libvirt/Makefile.am: Likewise. * python/Makefile.am: Likewise. * python/tests/Makefile.am: Likewise. * src/Makefile.am: Likewise. * tests/Makefile.am: Likewise. * tools/Makefile.am: Likewise. * configure.ac: Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 03 5月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
If an early dispatch check caused a jump to the 'cleanup' branch then virTypeParamsFree() would be called with an uninitialized 'nparams' variable. Fortunately 'params' is initialized to NULL, so the uninitialized 'nparams' variable would not be used. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 24 4月, 2013 4 次提交
-
-
由 Daniel P. Berrange 提交于
Ensure that all drivers implementing public APIs use a naming convention for their implementation that matches the public API name. eg for the public API virDomainCreate make sure QEMU uses qemuDomainCreate and not qemuDomainStart Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The driver.h struct for node devices used an inconsistent naming scheme 'DeviceMonitor' instead of the more usual 'NodeDeviceDriver'. Fix this everywhere it has leaked out to. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
A number of the remote procedure names did not match the corresponding API names. For example, many lacked the word 'CONNECT', others re-arranged the names. Update the procedures so their names exactly match the API names. Then remove the special case handling of these APIs in the generator Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
There are many declared options in gendispatch.pl that were no longer used. Those which were used were obscure '-b', '-k' and '-d'. Switch to use --mode={debug|client|server}. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 23 4月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Currently the RPC protocol files can contain annotations after the protocol enum eg REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_CHILDREN_NAMES = 247, /* autogen autogen priority:high */ This is not very extensible as the number of annotations grows. Change it to use /** * @generate: both * @priority: high */ REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_CHILDREN_NAMES = 247, Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 23 2月, 2013 1 次提交
-
-
由 Jiri Denemark 提交于
remoteDeserializeTypedParameters can now be called with either preallocated params array (size of which is announced by nparams) or it can allocate params array according to the number of parameters received from the server.
-
- 12 2月, 2013 1 次提交
-
-
由 Osier Yang 提交于
Like virNodeDeviceCreateXML, virNodeDeviceLookupSCSIHostByWWN has to be treated specially when generating the RPC codes. Also new rules are added in fixup_name to keep the name SCSIHostByWWN.
-
- 18 1月, 2013 1 次提交
-
-
由 Jiri Denemark 提交于
The function is just a renamed public version of former virTypedParameterArrayClear.
-
- 28 11月, 2012 1 次提交
-
-
由 Michal Privoznik 提交于
A new rule to fixup_name() in gendispatch.pl needs to be added, otherwise we are left with remoteDomainFstrim which is not wanted.
-
- 18 9月, 2012 1 次提交
-
-
由 Eric Blake 提交于
Relatively straightforward. Our decision to make block job speed a long keeps haunting us on new API. * src/remote/remote_protocol.x (remote_domain_block_commit_args): New struct. * src/remote/remote_driver.c (remote_driver): Enable it. * src/remote_protocol-structs: Regenerate. * src/rpc/gendispatch.pl (long_legacy): Exempt another bandwidth.
-
- 17 9月, 2012 1 次提交
-
-
由 Osier Yang 提交于
* src/rpc/gendispatch.pl: (virNodeSetMemoryParameters is the the special one which needs a connection object as the first argument, improve the generator to support it). * daemon/remote.c: (Implement the server side handler for virDomainGetMemoryParameters) * src/remote/remote_driver.c: (Implement the client side handler for virDomainGetMemoryParameters) * src/remote/remote_protocol.x: (New RPC procedures for the two new APIs and structs to represent the args and ret for it) * src/remote_protocol-structs: Likewise
-
- 07 8月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
Make all the virNetClient* objects use virObject APIs for reference counting Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 30 7月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
The cfg.mk file rule to check for tab characters was not applied to perl files. Much of our Perl code is full of tabs as a result. Kill them, kill them all !
-
由 Daniel P. Berrange 提交于
Update the gendispatch.pl script to get a little closer to being able to generate code for the LXC monitor, by passing in the struct prefix separately from the procedure prefix. Also allow method names using virCapitalLetters instead of vir_underscore_separator Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 20 7月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
Update the libvirtd dispatch code to use virReportError instead of the virNetError custom macro Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Update the remote driver to use virReportError instead of the remoteError custom macro Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 30 3月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
The code is splattered with a mix of sizeof foo sizeof (foo) sizeof(foo) Standardize on sizeof(foo) and add a syntax check rule to enforce it Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 08 3月, 2012 1 次提交
-
-
由 Eric Blake 提交于
On 64-bit platforms, unsigned long and unsigned long long are identical, so we don't have to worry about overflow checks. On 32-bit platforms, anywhere we narrow unsigned long long back to unsigned long, we have to worry about overflow; it's easier to do this in one place by having most of the code use the same or wider types, and only doing the narrowing at the last minute. Therefore, the memory set commands remain unsigned long, and the memory get command now centralizes the overflow check into libvirt.c, so that drivers don't have to repeat the work. This also fixes a bug where xen returned the wrong value on failure (most APIs return -1 on failure, but getMaxMemory must return 0 on failure). * src/driver.h (virDrvDomainGetMaxMemory): Use long long. * src/libvirt.c (virDomainGetMaxMemory): Raise overflow. * src/test/test_driver.c (testGetMaxMemory): Fix driver. * src/rpc/gendispatch.pl (name_to_ProcName): Likewise. * src/xen/xen_hypervisor.c (xenHypervisorGetMaxMemory): Likewise. * src/xen/xen_driver.c (xenUnifiedDomainGetMaxMemory): Likewise. * src/xen/xend_internal.c (xenDaemonDomainGetMaxMemory): Likewise. * src/xen/xend_internal.h (xenDaemonDomainGetMaxMemory): Likewise. * src/xen/xm_internal.c (xenXMDomainGetMaxMemory): Likewise. * src/xen/xm_internal.h (xenXMDomainGetMaxMemory): Likewise. * src/xen/xs_internal.c (xenStoreDomainGetMaxMemory): Likewise. * src/xen/xs_internal.h (xenStoreDomainGetMaxMemory): Likewise. * src/xenapi/xenapi_driver.c (xenapiDomainGetMaxMemory): Likewise. * src/esx/esx_driver.c (esxDomainGetMaxMemory): Likewise. * src/libxl/libxl_driver.c (libxlDomainGetMaxMemory): Likewise. * src/qemu/qemu_driver.c (qemudDomainGetMaxMemory): Likewise. * src/lxc/lxc_driver.c (lxcDomainGetMaxMemory): Likewise. * src/uml/uml_driver.c (umlDomainGetMaxMemory): Likewise.
-
- 02 2月, 2012 1 次提交
-
-
由 Eric Blake 提交于
Qemu is adding the ability to do a partial rebase. That is, given: base <- intermediate <- current virDomainBlockPull will produce: current but qemu now has the ability to leave base in the chain, to produce: base <- current Note that current qemu can only do a forward merge, and only with the current image as the destination, which is fully described by this API without flags. But in the future, it may be possible to enhance this API for additional scenarios by using flags: Merging the current image back into a previous image (that is, undoing a live snapshot), could be done by passing base as the destination and flags with a bit requesting a backward merge. Merging any other part of the image chain, whether forwards (the backing image contents are pulled into the newer file) or backwards (the deltas recorded in the newer file are merged back into the backing file), could also be done by passing a new flag that says that base should be treated as an XML snippet rather than an absolute path name, where the XML could then supply the additional instructions of which part of the image chain is being merged into any other part. * include/libvirt/libvirt.h.in (virDomainBlockRebase): New declaration. * src/libvirt.c (virDomainBlockRebase): Implement it. * src/libvirt_public.syms (LIBVIRT_0.9.10): Export it. * src/driver.h (virDrvDomainBlockRebase): New driver callback. * src/rpc/gendispatch.pl (long_legacy): Add exemption. * docs/apibuild.py (long_legacy_functions): Likewise.
-
- 28 1月, 2012 1 次提交
-
-
由 Michal Privoznik 提交于
This API allows a domain to be put into one of S# ACPI states. Currently, S3 and S4 are supported. These states are shared with virNodeSuspendForDuration. However, for now we don't support any duration other than zero. The same apply for flags.
-
- 19 1月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
The RPC generator transforms methods matching certain patterns like 'id' or 'uuid', etc but does not anchor its matches to the end of the word. So if a method contains 'id' in the middle (eg virIdentity) then the RPC generator munges that. * src/rpc/gendispatch.pl: Anchor matches
-
- 12 11月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Send and receive string typed parameters across RPC. This also completes the back-compat mentioned in the previous patch - the only time we have an older client talking to a newer server is if RPC is in use, so filtering out strings during RPC prevents returning an unknown type to the older client. * src/remote/remote_protocol.x (remote_typed_param_value): Add another union value. * daemon/remote.c (remoteDeserializeTypedParameters): Handle strings on rpc. (remoteSerializeTypedParameters): Likewise; plus filter out strings when replying to older clients. Adjust callers. * src/remote/remote_driver.c (remoteFreeTypedParameters) (remoteSerializeTypedParameters) (remoteDeserializeTypedParameters): Handle strings on rpc. * src/rpc/gendispatch.pl: Properly clean up typed arrays. * src/remote_protocol-structs: Update. Based on an initial patch by Hu Tao, with feedback from Daniel P. Berrange. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 28 10月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
The RPC server classes are extended to allow FDs to be received from clients with calls. There is not currently any way for a procedure to pass FDs back to the client with replies * daemon/remote.c, src/rpc/gendispatch.pl: Change virNetMessageHeaderPtr param to virNetMessagePtr in dispatcher impls * src/rpc/virnetserver.c, src/rpc/virnetserverclient.c, src/rpc/virnetserverprogram.c, src/rpc/virnetserverprogram.h: Extend to support FD passing
-
- 04 10月, 2011 1 次提交
-
-
由 Marc-André Lureau 提交于
Do not crash if virStreamFinish is called after error. ==11000== Invalid read of size 4 ==11000== at 0x373A8099A0: pthread_mutex_lock (pthread_mutex_lock.c:51) ==11000== by 0x4C7CADE: virMutexLock (threads-pthread.c:85) ==11000== by 0x4D57C31: virNetClientStreamRaiseError (virnetclientstream.c:203) ==11000== by 0x4D385E4: remoteStreamFinish (remote_driver.c:3541) ==11000== by 0x4D182F9: virStreamFinish (libvirt.c:14157) ==11000== by 0x40FDC4: cmdScreenshot (virsh.c:3075) ==11000== by 0x42BA40: vshCommandRun (virsh.c:14922) ==11000== by 0x42ECCA: main (virsh.c:16381) ==11000== Address 0x59b86c0 is 16 bytes inside a block of size 216 free'd ==11000== at 0x4A06928: free (vg_replace_malloc.c:427) ==11000== by 0x4C69E2B: virFree (memory.c:310) ==11000== by 0x4D57B56: virNetClientStreamFree (virnetclientstream.c:184) ==11000== by 0x4D3DB7A: remoteDomainScreenshot (remote_client_bodies.h:1812) ==11000== by 0x4CFD245: virDomainScreenshot (libvirt.c:2903) ==11000== by 0x40FB73: cmdScreenshot (virsh.c:3029) ==11000== by 0x42BA40: vshCommandRun (virsh.c:14922) ==11000== by 0x42ECCA: main (virsh.c:16381)
-
- 28 9月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Mostly straight-forward, although this is the first API that returns a new snapshot based on a snapshot rather than a domain. * src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_SNAPSHOT_GET_PARENT): New rpc. (remote_domain_snapshot_get_parent_args) (remote_domain_snapshot_get_parent_ret): New structs. * src/rpc/gendispatch.pl: Adjust generator. * src/remote/remote_driver.c (remote_driver): Use it. * src/remote_protocol-structs: Update.
-
- 06 9月, 2011 1 次提交
-
-
由 Michal Privoznik 提交于
This patch annotates APIs with low or high priority. In low set MUST be all APIs which might eventually access monitor (and thus block indefinitely). Other APIs may be marked as high priority. However, some must be (e.g. domainDestroy). For high priority calls (HPC), there are some high priority workers (HPW) created in the pool. HPW can execute only HPC, although normal worker can process any call regardless priority. Therefore, only those APIs which are guaranteed to end in reasonable small amount of time can be marked as HPC. The size of this HPC pool is static, because HPC are expected to end quickly, therefore jobs assigned to this pool will be served quickly. It can be configured in libvirtd.conf via prio_workers variable. Default is set to 5. To mark API with low or high priority, append priority:{low|high} to it's comment in src/remote/remote_protocol.x. This is similar to autogen|skipgen. If not marked, the generator assumes low as default.
-
- 02 9月, 2011 1 次提交
-
-
由 Jim Fehlig 提交于
Includes impl of python binding since the generator was not able to cope. Note: Requires gendispatch.pl patch from Matthias Bolte https://www.redhat.com/archives/libvir-list/2011-August/msg01367.html
-
- 27 8月, 2011 1 次提交
-
-
由 Jim Fehlig 提交于
From: Matthias Bolte <matthias.bolte@googlemail.com> Tested-by: NJim Fehlig <jfehlig@novell.com> Matthias provided this patch to fix an issue I encountered in the generator with APIs containing call-by-ref long type, e.g. int virDomainMigrateGetMaxSpeed(virDomainPtr domain, unsigned long *bandwidth, unsigned int flags);
-