aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* network: implement virNetworkUpdate for test_driverLaine Stump2012-09-181-1/+52
| | | | | | | The test driver does nothing outside of keeping track of each network's config/state in the in-memory database maintained by network_conf functions, so all we have to do is call the function that updates the network's entry in the in-memory database.
* network: implement virNetworkUpdate for bridge_driverLaine Stump2012-09-181-8/+112
| | | | | | | | | | Call the network_conf function that modifies the live/persistent/both config, then refresh/restart dnsmasq/radvd if necessary, and finally save the config in the proper place(s). This patch also needed to uncomment a few utility functions that were added inside #if 0 in the previous commit (to avoid compiler errors due to unreferenced static functions).
* network: reorganize dnsmasq and radvd config file / startupLaine Stump2012-09-181-44/+282
| | | | | | | | | | | | | | | | | | | | This patch splits the starting of dnsmasq and radvd into multiple files, and adds new networkRefreshXX() and networkRestartXX() functions for each. These new functions are currently commented out because they won't be used until the next commit, and the compile options require all static functions to be used. networkRefreshXX() - rewrites any file-based config for dnsmasq/radvd, and sends SIGHUP to the process to make it reread its config. If the program isn't already running, it's just started. networkRestartXX() - kills the given program, waits for it to exit (see the comments in the function networkKillDaemon()), then calls networkStartXX(). This commit is here mostly as a checkpoint to verify no change in functional behavior after refactoring networkStartXX() functions to fit in with these new functions.
* conf: implement NetworkObj backend of virNetworkUpdate APILaine Stump2012-09-183-0/+317
| | | | | | | | | | | | | | virNetworkObjUpdate takes care of all virNetworkUpdate-related changes to the data stored in the in-memory virNetworkObj list. It should be called by network drivers that use this in-memory list. virNetworkObjUpdate *does not* take care of updating any disk-based copies of the config, nor does it perform any other operations necessary to have the new config data take effect (e.g. it won't re-write dnsmasq host files, nor will it send a SIGHUP to dnsmasq) - those things should all be taken care of in the network driver function that calls virNetworkObjUpdate (assuming that it returns success).
* network: utility functions for updating network configLaine Stump2012-09-185-21/+262
| | | | | | | | | | | | | | | | | These new functions are highly inspired by those in domain_conf.c (but not identical), and are intended to make it simpler to update the various combinations of live/persistent network configs. The network driver wasn't previously as careful about the separation between the live "status" in network->def and the persistent "config" in network->newDef (or sometimes in network->def). This series attempts to remedy some of that, but probably doesn't go all the way (enough to get these functions working and enable continued work on virNetworkUpdate though). bridge_driver.c and test_driver.c were updated in a few places to take advantage of the new functions and/or account for changes in argument lists.
* network: implement RPC calls for virNetworkUpdateLaine Stump2012-09-183-1/+21
| | | | | | | | | | | | | | This is very short, because almost everything is autogenerated. All that's needed are: * src/remote/remote_driver.c: add pointer to autogenerated remoteNetworkUpdate to the function table for the remote network driver. * src/remote/remote_protocol.x: add the "args" struct and add one more item to the remote_procedure enum for this function. * src/remote_protocol-struct: update to match remote_protocol.x
* network: define new API virNetworkUpdateLaine Stump2012-09-183-0/+71
| | | | | | This patch adds a new public API virNetworkUpdate that will permit updating an existing network configuration without requiring that the network be destroyed/restarted for the changes to take effect.
* qemu: add -sandbox to command line if requestedJán Tomko2012-09-181-0/+11
|
* qemu: conf: add seccomp_sandbox optionJán Tomko2012-09-184-0/+15
|
* qemu: add capability flag for seccomp sandboxJán Tomko2012-09-182-0/+4
| | | | | | This series adds support to run QEMU with seccomp sandbox enabled. It can be configured in qemu.conf to on, off, or the QEMU default, which is off in 1.2. Default value is the QEMU default.
* qemu: Avoid deadlock on HandleAgentEOFMichal Privoznik2012-09-181-3/+3
| | | | | | | | On agent EOF the qemuProcessHandleAgentEOF() callback is called which locks virDomainObjPtr. Then qemuAgentClose() is called (with domain object locked) which eventually calls qemuAgentDispose() and qemuProcessHandleAgentDestroy(). This tries to lock the domain object again. Hence the deadlock.
* qemu: Use disk wwn in qemu command lineOsier Yang2012-09-181-0/+33
| | | | | | | | | | | | | | All of ide-drive, ide-hd, ide-cd, scsi-disk, scsi-hd, and scsi-cd supports wwn property. (NB, scsi-block doesn't support to set wwn). * src/qemu/qemu_command.c: Error out if underlying QEMU doesn't support wwn property for the device; Set wwn for the device otherwise. * tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.args: New test * tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.xml: Likewise * tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.args: Likewise * tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.xml: Likewise * tests/qemuxml2argvtest.c: Add the new tests.
* qemu: Add caps to indentify if setting wwn is supported by qemuOsier Yang2012-09-182-0/+10
| | | | | | | This assumes ide-drive.wwn, ide-hd.wwn, ide-cd.wwn were supported at the same time, similar for scsi-disk.wwn, scsi-hd.wwn, and scsi-cd.wwn. So only two new caps (QEMU_CAPS_IDE_DRIVE_WWN, and QEMU_CAPS_SCSI_DISK_WWN) are introduced.
* conf: Parse and format disk <wwn>Osier Yang2012-09-185-0/+33
| | | | | | | | | | Validates the wwn while parsing, error out if it's malformed. * src/util/util.h: Declare virValidateWWN * src/util/util.c: Implement virValidateWWN * src/libvirt_private.syms: Export virValidateWWN. * src/conf/domain_conf.h: New member 'wwn' for disk def. * src/conf/domain_conf.c: Parse and format disk <wwn>
* blockjob: add blockcommit support to rpcEric Blake2012-09-174-1/+22
| | | | | | | | | | | 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.
* blockjob: add virDomainBlockCommitEric Blake2012-09-173-2/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A block commit moves data in the opposite direction of block pull. Block pull reduces the chain length by dropping backing files after data has been pulled into the top overlay, and is always safe; block commit reduces the chain length by dropping overlays after data has been committed into the backing file, and any files that depended on base but not on top are invalidated at any point where they have unallocated data that is now pointing to changed contents in base. Both directions are useful, however: a qcow2 layer that is more than 50% allocated will typically be faster with a pull operation, while a qcow2 layer with less than 50% allocation will be faster as a commit operation. Committing across multiple layers can be more efficient than repeatedly committing one layer at a time, but requires extra support from the hypervisor. This API matches Jeff Cody's proposed qemu command 'block-commit': https://lists.gnu.org/archive/html/qemu-devel/2012-09/msg02226.html Jeff's command is still in the works for qemu 1.3, and may gain further enhancements, such as the ability to control on-error handling (it will be comparable to the error handling Paolo is adding to 'drive-mirror', so a similar solution will be needed when I finally propose virDomainBlockCopy with more functionality than the basics supported by virDomainBlockRebase). However, even without qemu support, this API will be useful for _offline_ block commits, by wrapping qemu-img calls and turning them into a block job, so this API is worth committing now. For some examples of how this will be implemented, all starting with the chain: base <- snap1 <- snap2 <- active + These are equivalent: virDomainBlockCommit(dom, disk, NULL, NULL, 0, 0) virDomainBlockCommit(dom, disk, NULL, "active", 0, 0) virDomainBlockCommit(dom, disk, "base", NULL, 0, 0) virDomainBlockCommit(dom, disk, "base", "active", 0, 0) but cannot be implemented for online qemu with round 1 of Jeff's patches; and for offline images, it would require three back-to-back qemu-img invocations unless qemu-img is patched to allow more efficient multi-layer commits; the end result would be 'base' as the active disk with contents from all three other files, where 'snap1' and 'snap2' are invalid right away, and 'active' is invalid once any further changes to 'base' are made. + These are equivalent: virDomainBlockCommit(dom, disk, "snap2", NULL, 0, 0) virDomainBlockCommit(dom, disk, NULL, NULL, 0, _SHALLOW) they cannot be implemented for online qemu, but for offline, it is a matter of 'qemu-img commit active', so that 'snap2' is now the active disk with contents formerly in 'active'. + Similarly: virDomainBlockCommit(dom, disk, "snap2", NULL, 0, _DELETE) for an offline domain will merge 'active' into 'snap2', then delete 'active' to avoid leaving a potentially invalid file around. + This version: virDomainBlockCommit(dom, disk, NULL, "snap2", 0, _SHALLOW) can be implemented online with 'block-commit' passing a base of snap1 and a top of snap2; and can be implemented offline by 'qemu-img commit snap2' followed by 'qemu-img rebase -u -b snap1 active' * include/libvirt/libvirt.h.in (virDomainBlockCommit): New API. * src/libvirt.c (virDomainBlockCommit): Implement it. * src/libvirt_public.syms (LIBVIRT_0.10.2): Export it. * src/driver.h (virDrvDomainBlockCommit): New driver callback. * docs/apibuild.py (CParser.parseSignature): Add exception.
* qemu: drop unused arguments for dump-guest-memoryEric Blake2012-09-175-40/+14
| | | | | | | | | | | | | | | | | Upstream qemu has raised a concern about whether dumping guest memory by reading guest paging tables is a security hole: https://lists.gnu.org/archive/html/qemu-devel/2012-09/msg02607.html While auditing libvirt to see if we would be impacted, I noticed that we had some dead code. It is simpler to nuke the dead code and limit our monitor code to just the subset we make use of. * src/qemu/qemu_monitor.h (QEMU_MONITOR_DUMP): Drop poorly named and mostly-unused enum. * src/qemu/qemu_monitor.c (qemuMonitorDumpToFd): Drop arguments. * src/qemu/qemu_monitor_json.h (qemuMonitorJSONDump): Likewise. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDump): Likewise. * src/qemu/qemu_driver.c (qemuDumpToFd): Update caller.
* build: Fix build failure on non-linux platformOsier Yang2012-09-181-4/+4
|
* conf: avoid freeing network object with undestroyed mutexLaine Stump2012-09-171-6/+5
| | | | | | | | | | | virNetworkAssignDef was allocating a new network object, initing and grabbing its lock, then potentially freeing it without unlocking or destroying the lock. In practice 1) this will probably never happen, and 2) even if it did, the lock implementation used on most (all?) platforms doesn't actually hold any resources for an initialized or held lock, but it still bothered me, so I moved the realloc that could lead to this bad situation earlier in the function, and now the mutex isn't inited or locked until we are assured of complete success.
* conf: separate functions to parse DHCPHostDef and DHCPRangeDefLaine Stump2012-09-171-101/+154
| | | | | | | These two objects were previously always parsed as a part of an IpDef, but we will now need to be able to parse them on their own for virNetworkUpdate(). Split the parsing functions out, with no functional changes.
* remove virDomainCpuSetFormat and virDomainCpuSetParseHu Tao2012-09-173-205/+0
| | | | | | virBitmap is recommanded to store cpuset info, and virBitmapFormat/virBitmapParse can do the format/parse jobs.
* xen: eliminate remaining uses of virDomainCpuSetParseLaine Stump2012-09-172-17/+21
| | | | | | | | | | The final patch in Hu Tao's series to enhance virBitmap actually removes virDomainCpuSetParse and virDomainCpuSetFormat as "no longer used", and the rest of the series hadn't taken care of two uses of virDomainCpuSetParse in the xen code. This patch replaces those with appropriate virBitmap functions. It should be pushed prior to the patch removing virDomainCpuSetParse.
* use virBitmap to store nodeinfo.Hu Tao2012-09-173-25/+26
|
* use virBitmap to store cells' cpumask info.Hu Tao2012-09-173-48/+15
|
* use virBitmap to store cpumask info.Hu Tao2012-09-1710-81/+53
|
* use virBitmap to store numa nodemask info.Hu Tao2012-09-178-107/+65
|
* use virBitmap to store cpu affinity infoHu Tao2012-09-175-131/+84
|
* use virBitmap to store cpupin infoHu Tao2012-09-176-127/+80
|
* New functions for virBitmapHu Tao2012-09-173-1/+449
| | | | | | | In many places we store bitmap info in a chunk of data (pointed to by a char *), and have redundant codes to set/unset bits. This patch extends virBitmap, and convert those codes to use virBitmap in subsequent patches.
* bitmap: new member variable and function renamingHu Tao2012-09-178-24/+20
| | | | | | | Add a new member variable map_len to store map len of bitmap. and rename size to max_bit accordingly. rename virBitmapAlloc to virBitmapNew.
* Build: Fix typos which cause build failureOsier Yang2012-09-171-2/+2
| | | | Pushed under build-breaker rules.
* node_memory: Support get/set memory parameters for driversOsier Yang2012-09-174-0/+9
| | | | Including QEMU, LXC, UML, XEN drivers.
* node_memory: Implement the internal APIsOsier Yang2012-09-173-0/+261
| | | | | | | | | Only implemented for linux platform. * src/nodeinfo.h: (Declare node{Get,Set}MemoryParameters) * src/nodeinfo.c: (Implement node{Get,Set}MemoryParameters) * src/libvirt_private.syms: (Export those two new internal APIs to private symbols)
* node_memory: Wire up the RPC protocolOsier Yang2012-09-174-1/+96
| | | | | | | | | | | | | * 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
* node_memory: Define the APIs to get/set memory parametersOsier Yang2012-09-173-0/+137
| | | | | | | | * include/libvirt/libvirt.h.in: (Add macros for the param fields, declare the APIs). * src/driver.h: (New methods for the driver struct) * src/libvirt.c: (Implement the public APIs) * src/libvirt_public.syms: (Export the public symbols)
* list: Implement listAllSecretsOsier Yang2012-09-172-1/+93
| | | | | | | Simply returns the object list. Supports to filter the secrets by its storage location, and whether it's private or not. src/secret/secret_driver.c: Implement listAllSecrets
* list: Implement RPC calls for virConnectListAllSecretsOsier Yang2012-09-173-1/+88
| | | | | | | | | | | | | | | | | The RPC generator doesn't support returning list of object yet, this patch does the work manually. * daemon/remote.c: Implement the server side handler remoteDispatchConnectListAllSecrets. * src/remote/remote_driver.c: Add remote driver handler remoteConnectListAllSecrets. * src/remote/remote_protocol.x: New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_SECRETS and structs to represent the args and ret for it. * src/remote_protocol-structs: Likewise.
* list: Define new API virConnectListAllSecretsOsier Yang2012-09-173-0/+73
| | | | | | | | | | | | This is to list the secret objects. Supports to filter the secrets by its storage location, and whether it's private or not. include/libvirt/libvirt.h.in: Declare enum virConnectListAllSecretFlags and virConnectListAllSecrets. python/generator.py: Skip auto-generating src/driver.h: (virDrvConnectListAllSecrets) src/libvirt.c: Implement the public API src/libvirt_public.syms: Export the symbol to public
* list: Implement listAllNWFiltersOsier Yang2012-09-171-0/+56
| | | | | | Simply returns the object list. No filtering. src/nwfilter/nwfilter_driver.c: Implement listAllNWFilters
* list: Implement RPC calls for virConnectListAllNWFiltersOsier Yang2012-09-173-1/+87
| | | | | | | | | | | | | | | | | The RPC generator doesn't support returning list of object yet, this patch do the work manually. * daemon/remote.c: Implemente the server side handler remoteDispatchConnectListAllNWFilters. * src/remote/remote_driver.c: Add remote driver handler remoteConnectListAllNWFilters. * src/remote/remote_protocol.x: New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_NWFILTERS and structs to represent the args and ret for it. * src/remote_protocol-structs: Likewise.
* list: Define new API virConnectListAllNWFiltersOsier Yang2012-09-173-0/+56
| | | | | | | | | | | This is to list the network filter objects. No flags are supported include/libvirt/libvirt.h.in: Declare enum virConnectListAllNWFilterFlags and virConnectListAllNWFilters. python/generator.py: Skip auto-generating src/driver.h: (virDrvConnectListAllNWFilters) src/libvirt.c: Implement the public API src/libvirt_public.syms: Export the symbol to public
* list: Use virConnectListAllNodeDevices in virshOsier Yang2012-09-171-0/+1
| | | | | | | | | | | | | | | tools/virsh-nodedev.c: * vshNodeDeviceSorter to sort node devices by name * vshNodeDeviceListFree to free the node device objects list. * vshNodeDeviceListCollect to collect the node device objects, trying to use new API first, fall back to older APIs if it's not supported. * Change option --cap to accept multiple capability types. tools/virsh.pod * Update document for --cap
* list: Implement listAllNodeDevicesOsier Yang2012-09-174-0/+20
| | | | | | | | | | | | | | | | This simply implements listAllNodeDevices using helper virNodeDeviceList src/node_device/node_device_driver.h: * Declare nodeListAllNodeDevices. src/node_device/node_device_driver.c: * Implement nodeListAllNodeDevices. src/node_device/node_device_hal.c: * Hook listAllNodeDevices to nodeListAllNodeDevices. src/node_device/node_device_udev.c * Hook listAllNodeDevices to nodeListAllNodeDevices.
* list: Add helpers for listing node devicesOsier Yang2012-09-173-0/+120
| | | | | | | | | | | | | | | | src/conf/node_device_conf.h: * New macro VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP * Declare virNodeDeviceList src/conf/node_device_conf.c: * New helpers virNodeDeviceCapMatch, virNodeDeviceMatch. virNodeDeviceCapMatch looks up the list of all the caps the device support, to see if the device support the cap type. * Implement virNodeDeviceList src/libvirt_private.syms: * Export virNodeDeviceList * Export virNodeDevCapTypeFromString
* list: Implement RPC calls for virConnectListAllNodeDevicesOsier Yang2012-09-173-1/+88
| | | | | | | | | | | | | | The RPC generator doesn't support returning list of object yet, this patch does the work manually. * daemon/remote.c: Implemente the server side handler remoteDispatchConnectListAllNodeDevices. * src/remote/remote_driver.c: Add remote driver handler remoteConnectListAllNodeDevices. * src/remote/remote_protocol.x: New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_INTERFACES and
* list: Define new API virConnectListAllNodeDevicesOsier Yang2012-09-173-0/+76
| | | | | | | | | | | | This is to list the node device objects, supports to filter the results by capability types. include/libvirt/libvirt.h.in: Declare enum virConnectListAllNodeDeviceFlags and virConnectListAllNodeDevices. python/generator.py: Skip auto-generating src/driver.h: (virDrvConnectListAllNodeDevices) src/libvirt.c: Implement the public API src/libvirt_public.syms: Export the symbol to public
* build: fix missing includeDwight Engen2012-09-141-0/+1
| | | | | virNWFilterSnoopAdjustPoll() uses a struct pollfd but poll.h is never included nwfilter/nwfilter_dhcpsnoop.c:1297: error: 'struct pollfd' declared inside parameter list
* Add missing 'goto error' in QEMU command line buildingDaniel P. Berrange2012-09-141-0/+2
| | | | | If reporting case of a binary not supporting KVM or kQEMU, libvirt forgot to jump to the error branch for cleanup
* Fix initialization of virCommandPtr when creating QEMU argvDaniel P. Berrange2012-09-141-1/+7
| | | | | | | If the qemuBuildCommandLine method raised an error before the virCommandPtr instance was created, the local var would not be initialized, resulting in a possible SEGV in the error cleanup branch. Also add some debugging of the method params
* qemu: fix uninitialized variable in qemuParseCommandLineJán Tomko2012-09-141-2/+1
| | | | Newly added if branch for kvm_pv_eoi did not set the ret variable.