- 21 10月, 2011 2 次提交
-
-
由 Eric Blake 提交于
The improvements to virBuffer, along with a paradigm shift to pass the original buffer through rather than creating a second buffer, allow us to shave off quite a few lines of code. * src/util/sysinfo.h (virSysinfoFormat): Alter signature. * src/util/sysinfo.c (virSysinfoFormat, virSysinfoBIOSFormat) (virSysinfoSystemFormat, virSysinfoProcessorFormat) (virSysinfoMemoryFormat): Change indentation parameter. * src/conf/domain_conf.c (virDomainSysinfoDefFormat): Adjust caller. * src/qemu/qemu_driver.c (qemuGetSysinfo): Likewise.
-
由 tangchen 提交于
There is a little difference between the output of domxml-to-native and the actual commandline. No matter qemu is in control or readline mode, domxml-to-native always converts it to readline mode. That is because the parameter "monitor_json" for qemuBuildCommandLine() is always set to false in qemuDomainXMLToNative(). Signed-off-by: Ntangchen <tangchen@cn.fujitsu.com>
-
- 19 10月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Noticed when testing new libvirt against old qemu that lacked the snapshot_blkdev HMP command. Libvirt was mistakenly treating the command as successful, and re-writing the domain XML to use the just-created 0-byte file, rendering the domain broken on restart. * src/qemu/qemu_monitor_text.c (qemuMonitorTextDiskSnapshot): Notice another possible error message. * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateSingleDiskActive): Don't keep 0-byte file on failure.
-
- 15 10月, 2011 1 次提交
-
-
由 Jiri Denemark 提交于
Explicitly disallow conflicts between domain name from dxml and dname.
-
- 14 10月, 2011 1 次提交
-
-
由 Jiri Denemark 提交于
Otherwise we can end up with a dangling job that can only be cleared by restarting libvirtd.
-
- 13 10月, 2011 3 次提交
-
-
由 Michal Privoznik 提交于
As this is needed. Although some functions check for domain being active before obtaining job, we need to check it after, because obtaining job unlocks domain object, during which a state of domain can be changed.
-
由 Michal Privoznik 提交于
This patch extends qemudDomainCoreDump so it supports new VIR_DUMP_RESET flag. If this flag is set, domain is reset on successful dump. However, this is needed to be done after we start CPUs.
-
由 Eric Blake 提交于
With the recent refactoring of qemu snapshot relationships, it is now trivial to filter on leaves. * src/conf/domain_conf.c (virDomainSnapshotObjListCount) (virDomainSnapshotObjListCopyNames): Handle new flag. * src/qemu/qemu_driver.c (qemuDomainSnapshotListNames) (qemuDomainSnapshotNum, qemuDomainSnapshotListChildrenNames) (qemuDomainSnapshotNumChildren): Pass new flag through.
-
- 12 10月, 2011 2 次提交
-
-
由 Eric Blake 提交于
The previous optimizations lead to some follow-on cleanups. * src/conf/domain_conf.c (virDomainSnapshotForEachChild) (virDomainSnapshotForEachDescendant): Drop dead parameter. (virDomainSnapshotActOnDescendant) (virDomainSnapshotObjListNumFrom) (virDomainSnapshotObjListGetNamesFrom): Update callers. * src/qemu/qemu_driver.c (qemuDomainSnapshotNumChildren) (qemuDomainSnapshotListChildrenNames, qemuDomainSnapshotDelete): Likewise. * src/conf/domain_conf.h: Update prototypes.
-
由 Eric Blake 提交于
Maintain the parent/child relationships of all qemu snapshots. * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Populate relationships after loading. (qemuDomainSnapshotCreateXML): Set relations on creation; tweak redefinition to reuse existing object. (qemuDomainSnapshotReparentChildren, qemuDomainSnapshotDelete): Clear relations on delete.
-
- 11 10月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Not too hard to wire up. The trickiest part is realizing that listing children of a snapshot cannot use SNAPSHOT_LIST_ROOTS, and that we overloaded that bit to also mean SNAPSHOT_LIST_DESCENDANTS; we use that bit to decide which iteration to use, but don't want the existing counting/listing functions to see that bit. * src/conf/domain_conf.h (virDomainSnapshotObjListNumFrom) (virDomainSnapshotObjListGetNamesFrom): New prototypes. * src/conf/domain_conf.c (virDomainSnapshotObjListNumFrom) (virDomainSnapshotObjListGetNamesFrom): New functions. * src/libvirt_private.syms (domain_conf.h): Export them. * src/qemu/qemu_driver.c (qemuDomainSnapshotNumChildren) (qemuDomainSnapshotListChildrenNames): New functions.
-
- 09 10月, 2011 1 次提交
-
-
由 Michal Privoznik 提交于
If parsing qemu command line fails (e.g. because of non-existing process number supplied), we jump to cleanup label where we free pidfile. Therefore it needs to be initialized. Otherwise we free random pointer.
-
- 06 10月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Implements the documentation for snapshot revert vs. force. Part of the patch tightens existing behavior (previously, reverting to an old snapshot without <domain> was blindly attempted, now it requires force), while part of it relaxes behavior (previously, it was not possible to revert an active domain to an ABI-incompatible active snapshot, now force allows this transition). * src/qemu/qemu_driver.c (qemuDomainRevertToSnapshot): Check for risky situations, and allow force to get past them.
-
- 05 10月, 2011 1 次提交
-
-
由 Jiri Denemark 提交于
Qemu driver tries to update balloon data in virDomainGetInfo and if it can't do so because there is another monitor job running, it just reports what's known in domain def. However, if there was no job running but getting the data from qemu fails, we would fail the whole API. This doesn't make sense. Let's make the failure nonfatal.
-
- 30 9月, 2011 1 次提交
-
-
由 Michal Privoznik 提交于
Currently, qemuDomainGetXMLDesc and qemudDomainGetInfo check for outstanding synchronous job before (eventual) monitor entering. However, there can be already async job set, e.g. migration.
-
- 29 9月, 2011 2 次提交
-
-
由 Xu He Jie 提交于
Signed-off-by: NXu He Jie <xuhj@linux.vnet.ibm.com>
-
由 Michal Privoznik 提交于
If the daemon is restarted so we reconnect to monitor, cdrom media can be ejected. In that case we don't want to show it in domain xml, or require it on migration destination. To check for disk status use 'info block' monitor command.
-
- 28 9月, 2011 2 次提交
-
-
由 Eric Blake 提交于
First hypervisor implementation of the new API. Allows 'virsh snapshot-list --tree' to be more efficient. * src/qemu/qemu_driver.c (qemuDomainSnapshotGetParent): New function.
-
由 Jiri Denemark 提交于
Thus, when libvirtd is restarted, it will know if a domain is supposed to be killed or reset when it shuts down.
-
- 22 9月, 2011 3 次提交
-
-
由 Eric Blake 提交于
Commit 282fe1f0 documented that transient domains will auto-delete any snapshot metadata when the last reference to the domain is removed, and that management apps are in charge of grabbing any snapshot metadata prior to that point. However, this was not actually implemented for qemu until now. * src/qemu/qemu_driver.c (qemudDomainCreate) (qemuDomainDestroyFlags, qemuDomainSaveInternal) (qemudDomainCoreDump, qemuDomainRestoreFlags, qemudDomainDefine) (qemuDomainUndefineFlags, qemuDomainMigrateConfirm3) (qemuDomainRevertToSnapshot): Clean up snapshot metadata. * src/qemu/qemu_migration.c (qemuMigrationPrepareAny) (qemuMigrationPerformJob, qemuMigrationPerformPhase) (qemuMigrationFinish): Likewise. * src/qemu/qemu_process.c (qemuProcessHandleMonitorEOF) (qemuProcessReconnect, qemuProcessReconnectHelper) (qemuProcessAutoDestroyDom): Likewise.
-
由 Eric Blake 提交于
This patch is mostly code motion - moving some functions out of qemu_driver and into qemu_domain so they can be reused by multiple qemu_* files (since qemu_driver.h must not grow). It also adds a new helper function, qemuDomainRemoveInactive, which will be used in the next patch. * src/qemu/qemu_domain.h (qemuFindQemuImgBinary) (qemuDomainSnapshotWriteMetadata, qemuDomainSnapshotForEachQcow2) (qemuDomainSnapshotDiscard, qemuDomainSnapshotDiscardAll) (qemuDomainRemoveInactive): New prototypes. (struct qemu_snap_remove): New struct. * src/qemu/qemu_domain.c (qemuDomainRemoveInactive) (qemuDomainSnapshotDiscardAllMetadata): New functions. (qemuFindQemuImgBinary, qemuDomainSnapshotWriteMetadata) (qemuDomainSnapshotForEachQcow2, qemuDomainSnapshotDiscard) (qemuDomainSnapshotDiscardAll): Move here... * src/qemu/qemu_driver.c (qemuFindQemuImgBinary) (qemuDomainSnapshotWriteMetadata, qemuDomainSnapshotForEachQcow2) (qemuDomainSnapshotDiscard, qemuDomainSnapshotDiscardAll): ...from here. (qemuDomainUndefineFlags): Update caller. * src/conf/domain_conf.c (virDomainRemoveInactive): Doc fixes.
-
由 Eric Blake 提交于
Commit 19f8c980 introduced VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA, with the intent that omitting the flag makes undefine fail, and including the flag deletes metadata. But it used the wrong logic. Also, hoist the transient domain sooner, so that we don't accidentally remove metadata of a transient domain. * src/qemu/qemu_driver.c (qemuDomainUndefineFlags): Check correct flag value.
-
- 21 9月, 2011 1 次提交
-
-
由 Jiri Denemark 提交于
The commit that prevents disk corruption on domain shutdown (96fc4784) causes regression with QEMU 0.14.* and 0.15.* because of a regression bug in QEMU that was fixed only recently in QEMU git. The affected versions of QEMU do not quit on SIGTERM if started with -no-shutdown, which we use to implement fake reboot. Since -no-shutdown tells QEMU not to quit automatically on guest shutdown, domains started using the affected QEMU cannot be shutdown properly and stay in a paused state. This patch disables fake reboot feature on such QEMU by not using -no-shutdown, which makes shutdown work as expected. However, virDomainReboot will not work in this case and it will report "Requested operation is not valid: Reboot is not supported with this QEMU binary".
-
- 20 9月, 2011 1 次提交
-
-
由 Peter Krempa 提交于
Virsh man page lists driver types to be used with attach-device command, but does not specify that those are usable only with the XEN Hypervisor. This patch adds statement, that those options specified are applicable only on the Xen hypervisor and adds option usable with qemu emulator. This patch also changes type of error returned by QEMU driver if the user specifies incompatible driver type from VIR_ERR_INTERNAL_ERROR to VIR_ERR_CONFIG_UNSUPPORTED.
-
- 17 9月, 2011 2 次提交
-
-
由 Eric Blake 提交于
For all types of disks other than qcow2, we were requesting that SELinux labeling visit the new file as if it were qcow2, which means labeling would try to find the backing files of an empty file. And for a pre-existing qcow2 disk, we were passing NULL, which meant that labelling tried to probe the file type (and if probing is disabled, per the default qemu.conf, this made snapshots fail). What we really want is to make SELinux labeling visit the new file as raw; it will later be converted to qcow2 if qemu successfully made the snapshot. * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateSingleDiskActive): Force SELinux labeling to avoid probe of new file.
-
由 Eric Blake 提交于
For external snapshots to be useful on persistent domains, we must alter the persistent definition alongside the running definition. Thanks to the possibility of disk hotplug as well as of edits that only affect the persistent xml, we can't assume that vm->def and vm->newDef have the same disk at the same index, so we can only update the persistent copy if the device destination matches up. * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive) (qemuDomainSnapshotCreateSingleDiskActive): Also affect newDef, if present.
-
- 16 9月, 2011 2 次提交
-
-
由 Jiri Denemark 提交于
Ever since we introduced fake reboot, we call qemuProcessKill as a reaction to SHUTDOWN event. Unfortunately, qemu doesn't guarantee it flushed all internal buffers before sending SHUTDOWN, in which case killing the process forcibly may result in (virtual) disk corruption. By sending just SIGTERM without SIGKILL we give qemu time to to flush all buffers and exit. Once qemu exits, we will see an EOF on monitor connection and tear down the domain. In case qemu ignores SIGTERM or just hangs there, the process stays running but that's not any different from a possible hang anytime during the shutdown process so I think it's just fine. Also qemu (since 0.14 until it's fixed) has a bug in SIGTERM processing which causes it not to exit but instead send new SHUTDOWN event and keep waiting. I think the best we can do is to ignore duplicate SHUTDOWN events to avoid a SHUTDOWN-SIGTERM loop and leave the domain in paused state.
-
由 Peter Krempa 提交于
/usr/lib/stdlib.h in Mac OS X and probably also in BSD's exports this symbol :(
-
- 15 9月, 2011 3 次提交
-
-
由 Jim Fehlig 提交于
Pushing under build-breaker rule.
-
由 Jim Fehlig 提交于
Now that migration speed is stored in qemuDomainObjPrivate structure, save the new value when invoking qemuDomainMigrateSetMaxSpeed(). Allow setting migration speed on inactive domain too.
-
由 Jim Fehlig 提交于
-
- 13 9月, 2011 1 次提交
-
-
由 Guannan Ren 提交于
Regression introduced in commit 3881a470, due to an improper rebase of a cleanup written beforehand but only applied after a rebased of a refactoring that created a new function in commit 25fb3ef1. Also avoids passing NULL to printf %s. * src/qemu/qemu_driver.c: In qemuDomainSnapshotForEachQcow2() it free up the memory of qemu_driver->qemuImgBinary in the cleanup tag which leads to the garbage value of qemuImgBinary in qemu_driver struct and libvirtd crash when running "virsh snapshot-create" command a second time. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 08 9月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Regression introduced in commit 89b6284f, due to an incorrect conversion to the new means of converting disk names back to the correct object. * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Avoid NULL deref.
-
- 06 9月, 2011 5 次提交
-
-
由 Peter Krempa 提交于
This patch enables modifying network device configuration using the virUpdateDeviceFlags API method. Matching of devices is accomplished using MAC addresses. While updating live configuration of a running domain, the user is allowed only to change link state of the interface. Additional modifications may be added later. For now the code checks for unsupported changes and thereafter changes the link state, if applicable. When updating persistent configuration of guest's network interface the whole configuration (except for the MAC address) may be modified and is stored for the next startup. * src/qemu/qemu_driver.c - Add dispatching of virUpdateDevice for network devices update (live/config) * src/qemu/qemu_hotplug.c - add setting of initial link state on live device addition - add function to change network device configuration. By now it supports only changing of link state * src/qemu/qemu_hotplug.h - Headers to above functions * src/qemu/qemu_process.c - set link states before virtual machine start. Qemu does not support setting of this on the command line.
-
由 Osier Yang 提交于
-
由 Osier Yang 提交于
The mainly changes are: 1) Update qemuMonitorGetBlockStatsInfo and it's children (Text/JSON) functions to return the value of new latency fields. 2) Add new function qemuMonitorGetBlockStatsParamsNumber, which is to count how many parameters the underlying QEMU supports. 3) Update virDomainBlockStats in src/qemu/qemu_driver.c to be compatible with the changes by 1).
-
由 Michal Privoznik 提交于
If libvirt daemon gets restarted and there is (at least) one unresponsive qemu, the startup procedure hangs up. This patch creates one thread per vm in which we try to reconnect to monitor. Therefore, blocking in one thread will not affect other APIs.
-
由 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.
-
- 05 9月, 2011 2 次提交
-
-
由 Eric Blake 提交于
With this, it is now possible to create external snapshots even when SELinux is enforcing, and to protect the new file with a lock manager. * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateSingleDiskActive): Create and register new file with proper permissions and locks. (qemuDomainSnapshotCreateDiskActive): Update caller.
-
由 Eric Blake 提交于
Lots of earlier patches led up to this point - the qemu snapshot_blkdev monitor command can now be controlled by libvirt! Well, insofar as SELinux doesn't prevent qemu from open(O_CREAT) on the files. There's still some followup work before things work with SELinux enforcing, but this patch is big enough to post now. There's still room for other improvements, too (for example, taking a disk snapshot of an inactive domain, by using qemu-img for both internal and external snapshots; wiring up delete and revert control, including additional flags from my RFC; supporting active QED disk snapshots; supporting per-storage-volume snapshots such as LVM or btrfs snapshots; etc.). But this patch is the one that proves the new XML works! * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Wire in active disk snapshots. (qemuDomainSnapshotDiskPrepare) (qemuDomainSnapshotCreateDiskActive) (qemuDomainSnapshotCreateSingleDiskActive): New functions.
-