Re: [libvirt] [PATCH] qemu: Report error if qemu monitor command not found for BlockJob

2011-08-24 Thread Osier Yang
于 2011年08月23日 22:31, Adam Litke 写道: On 08/22/2011 10:04 PM, Osier Yang wrote: Hi, Adam I likes the idea to wrap the checking as a function seperately, but the function won't work well if the command is help info, though we don't have a use of help info yet. My point is since the function

Re: [libvirt] [PATCH] qemu: Allow graceful domain destroy

2011-08-24 Thread Jiri Denemark
On Tue, Aug 23, 2011 at 14:31:29 +0100, Daniel P. Berrange wrote: On Tue, Aug 23, 2011 at 02:36:02PM +0200, Michal Privoznik wrote: On 22.08.2011 20:31, Daniel P. Berrange wrote: We need to make this more controllable by apps, by making it possible to send just the SIGTERM and not the

Re: [libvirt] RFC: managing pci passthrough usage of sriov VFs via a new network forward type

2011-08-24 Thread Laine Stump
On 08/23/2011 06:50 AM, Daniel P. Berrange wrote: On Mon, Aug 22, 2011 at 05:17:25AM -0400, Laine Stump wrote: For some reason beyond my comprehension, the designers of SRIOV ethernet cards decided that the virtual functions (VF) of the card (each VF corresponds to an ethernet device, e.g.

Re: [libvirt] [PATCH] esx: Use $(PYTHON) instead of the shebang to run the generator

2011-08-24 Thread Matthias Bolte
2011/8/23 Eric Blake ebl...@redhat.com: On 08/23/2011 03:42 PM, Matthias Bolte wrote: ---  src/Makefile.am |    5 +++--  1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 8fe7120..5ba189c 100644 --- a/src/Makefile.am +++

[libvirt] [PATCH] util: only fchown newly created files in virFileOpenAs

2011-08-24 Thread Laine Stump
virFileOpenAs takes desired uid:gid as arguments, and not only uses them for a fork/setuid/setgid when retrying failed open operations, but additionally always forces the opened file to be owned by the given uid:gid. One example of the problems this causes is that, when restoring a domain from a

Re: [libvirt] [RFC] NUMA topology specification

2011-08-24 Thread Bharata B Rao
On Tue, Aug 23, 2011 at 7:43 PM, Daniel P. Berrange berra...@redhat.com wrote: On Fri, Aug 19, 2011 at 12:05:43PM +0530, Bharata B Rao wrote: Hi, qemu supports specification of NUMA topology on command line using -numa option. -numa node[,mem=size][,cpus=cpu[-cpu]][,nodeid=node] I see

[libvirt] [PATCH v2] remote: Refuse connecting to remote socket

2011-08-24 Thread Michal Privoznik
If users wants to connect to remote unix socket, e.g. 'qemu+unix://remote/system' currently the remote part is ignored, ending up connecting to localhost. Connecting to remote socket is not supported and user should have used TLS/TCP/SSH instead. --- src/remote/remote_driver.c | 13

Re: [libvirt] [PATCH] qemu: Allow graceful domain destroy

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:53:49AM +0200, Jiri Denemark wrote: On Tue, Aug 23, 2011 at 14:31:29 +0100, Daniel P. Berrange wrote: On Tue, Aug 23, 2011 at 02:36:02PM +0200, Michal Privoznik wrote: On 22.08.2011 20:31, Daniel P. Berrange wrote: We need to make this more controllable by

Re: [libvirt] RFC: managing pci passthrough usage of sriov VFs via a new network forward type

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 04:16:33AM -0400, Laine Stump wrote: On 08/23/2011 06:50 AM, Daniel P. Berrange wrote: Although I realize that many people are predisposed to not like the idea of PCI passthrough of ethernet devices (including me), it seems that it's going to be used, so we may as well

Re: [libvirt] Libvirt 0.9.4rc2 + qemu 0.15 VNC/TLS not working

2011-08-24 Thread Daniel P. Berrange
On Tue, Aug 23, 2011 at 08:50:35PM +0200, Radek Hladik wrote: Dne 23.8.2011 14:36, Radek Hladik napsal(a): I am thinking whether there is not a problem with monitor setting something after the machine starts. Libvirt does the same with password, so maybe it does something with TLS I tried

[libvirt] [PATCH v3] virsh: Increase device-detach intelligence

2011-08-24 Thread Michal Privoznik
From: Michal Prívozník mpriv...@redhat.com Up to now users have to give a full XML description on input when device-detaching. If they omitted something it lead to unclear error messages (like generated MAC wasn't found, etc.). With this patch users can specify only those information which

Re: [libvirt] XML files

2011-08-24 Thread Richard W.M. Jones
On Wed, Aug 24, 2011 at 04:02:45PM +1200, Derek wrote: Unfortunately the changes I make for smbios and sysinfo (as below) while editing don't appear to be accepted when saving with 'virsh edit'. After saving I receive Domain HMC XML configuration edited. but the XML file remains unmodified.

Re: [libvirt] [PATCH] virsh: add list --managed-save

2011-08-24 Thread Daniel P. Berrange
On Thu, Aug 18, 2011 at 06:05:28PM -0600, Eric Blake wrote: Knowing whether 'virsh start' will resume a saved image or do a fresh boot is useful enough to expose via 'virsh list'. * tools/virsh.c (cmdList): add --managed-save flag * tools/virsh.pod (list): Document it. Based on a suggestion

Re: [libvirt] [PATCH] libvirt: log all flags parameters

2011-08-24 Thread Daniel P. Berrange
On Tue, Aug 16, 2011 at 02:27:23PM -0600, Eric Blake wrote: I was testing a virsh patch, and wanted to see if I had passed the flags I thought. But with LIBVIRT_DEBUG in the environment, I just saw: 14:24:52.359: 15022: debug : virDomainSnapshotNum:15586 : dom=0xc9c180, (VM:

[libvirt] [PATCH] daemon: Move TLS initialization to virInitialize

2011-08-24 Thread Michal Privoznik
My previous patch 74c75671331d284e1f777f9692b72e9737520bf0 introduced a regression by removing TLS initialization from client. --- daemon/libvirtd.c |1 - src/libvirt.c |3 +++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index

Re: [libvirt] [PATCHv2 02/26] snapshot: better event when reverting qemu to paused snapshot

2011-08-24 Thread Daniel P. Berrange
On Mon, Aug 15, 2011 at 05:33:13PM -0600, Eric Blake wrote: When reverting a running domain to a paused snapshot, the event that fires should mention that the domain is suspended. * include/libvirt/libvirt.h.in (VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT): New sub-event. *

Re: [libvirt] Notes from the KVM Forum relevant to libvirt

2011-08-24 Thread Stefan Hajnoczi
On Tue, Aug 23, 2011 at 4:31 PM, Daniel P. Berrange berra...@redhat.com wrote: On Tue, Aug 23, 2011 at 04:24:46PM +0100, Stefan Hajnoczi wrote: On Tue, Aug 23, 2011 at 12:15 PM, Daniel P. Berrange berra...@redhat.com wrote: I was at the KVM Forum / LinuxCon last week and there were many

Re: [libvirt] [PATCHv2 02/26] snapshot: better event when reverting qemu to paused snapshot

2011-08-24 Thread Eric Blake
On 08/24/2011 08:21 AM, Daniel P. Berrange wrote: +++ b/src/qemu/qemu_driver.c @@ -8804,14 +8804,16 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, QEMU_ASYNC_JOB_NONE); if (rc 0) goto endjob; +

Re: [libvirt] [PATCHv2 03/26] snapshot: improve reverting to qemu paused snapshots

2011-08-24 Thread Daniel P. Berrange
On Mon, Aug 15, 2011 at 05:33:14PM -0600, Eric Blake wrote: If you take a checkpoint snapshot of a running domain, then pause qemu, then restore the snapshot, the result should be a running domain, but the code was leaving things paused. Furthermore, if you take a checkpoint of a paused

Re: [libvirt] [PATCH 43/26] snapshot: use SELinux and lock manager with external snapshots

2011-08-24 Thread Eric Blake
On 08/23/2011 05:25 PM, Eric Blake wrote: 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

Re: [libvirt] [PATCH] virsh: add list --managed-save

2011-08-24 Thread Eric Blake
On 08/24/2011 07:57 AM, Daniel P. Berrange wrote: On Thu, Aug 18, 2011 at 06:05:28PM -0600, Eric Blake wrote: Knowing whether 'virsh start' will resume a saved image or do a fresh boot is useful enough to expose via 'virsh list'. * tools/virsh.c (cmdList): add --managed-save flag *

Re: [libvirt] [PATCH] libvirt: log all flags parameters

2011-08-24 Thread Eric Blake
On 08/24/2011 08:13 AM, Daniel P. Berrange wrote: On Tue, Aug 16, 2011 at 02:27:23PM -0600, Eric Blake wrote: I was testing a virsh patch, and wanted to see if I had passed the flags I thought. But with LIBVIRT_DEBUG in the environment, I just saw: 14:24:52.359: 15022: debug :

Re: [libvirt] Notes from the KVM Forum relevant to libvirt

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 03:20:57PM +0100, Stefan Hajnoczi wrote: On Tue, Aug 23, 2011 at 4:31 PM, Daniel P. Berrange berra...@redhat.com wrote: On Tue, Aug 23, 2011 at 04:24:46PM +0100, Stefan Hajnoczi wrote: On Tue, Aug 23, 2011 at 12:15 PM, Daniel P. Berrange berra...@redhat.com wrote:

Re: [libvirt] [PATCH] daemon: Move TLS initialization to virInitialize

2011-08-24 Thread Eric Blake
On 08/24/2011 08:19 AM, Michal Privoznik wrote: My previous patch 74c75671331d284e1f777f9692b72e9737520bf0 introduced a regression by removing TLS initialization from client. --- daemon/libvirtd.c |1 - src/libvirt.c |3 +++ 2 files changed, 3 insertions(+), 1 deletions(-) diff

Re: [libvirt] RFC: managing pci passthrough usage of sriov VFs via a new network forward type

2011-08-24 Thread Laine Stump
On 08/24/2011 05:48 AM, Daniel P. Berrange wrote: Having transient hostdevs does not really work nicely, because we want all PCI devices in the guest to be persistently in the XML, so we can ensure the guest PCI address does not get changed each time the guest is run. Ah, well that clinches

Re: [libvirt] [PATCH] daemon: Move TLS initialization to virInitialize

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 08:45:37AM -0600, Eric Blake wrote: On 08/24/2011 08:19 AM, Michal Privoznik wrote: My previous patch 74c75671331d284e1f777f9692b72e9737520bf0 introduced a regression by removing TLS initialization from client. --- daemon/libvirtd.c |1 - src/libvirt.c |

Re: [libvirt] [PATCH] daemon: Move TLS initialization to virInitialize

2011-08-24 Thread Eric Blake
On 08/24/2011 08:58 AM, Daniel P. Berrange wrote: Either we need a virDeinitialize which does the virNetTLSDeinit, and libvirtd calls virDeinitialize; or you can just drop all calls to virNetTLSDeinit. deinitialize is really a waste of time, or even wrong. Some other libraries libvirt links to

Re: [libvirt] [PATCHv2 02/26] snapshot: better event when reverting qemu to paused snapshot

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 08:23:55AM -0600, Eric Blake wrote: On 08/24/2011 08:21 AM, Daniel P. Berrange wrote: +++ b/src/qemu/qemu_driver.c @@ -8804,14 +8804,16 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, QEMU_ASYNC_JOB_NONE);

Re: [libvirt] [PATCH] daemon: Move TLS initialization to virInitialize

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:05:48AM -0600, Eric Blake wrote: On 08/24/2011 08:58 AM, Daniel P. Berrange wrote: Either we need a virDeinitialize which does the virNetTLSDeinit, and libvirtd calls virDeinitialize; or you can just drop all calls to virNetTLSDeinit. deinitialize is really a

[libvirt] [PATCH v2] daemon: Move TLS initialization to virInitialize

2011-08-24 Thread Michal Privoznik
My previous patch 74c75671331d284e1f777f9692b72e9737520bf0 introduced a regression by removing TLS initialization from client. --- diff to v1: -remove virNetTLSDeinit() daemon/libvirtd.c |2 -- src/libvirt.c |3 +++ src/rpc/virnettlscontext.c |8

[libvirt] [PATCHv3 06/43] snapshot: track current snapshot across restarts

2011-08-24 Thread Eric Blake
Audit all changes to the qemu vm-current_snapshot, and make them update the saved xml file for both the previous and the new snapshot, so that there is always at most one snapshot with active1/active in the xml, and that snapshot is used as the current snapshot even across libvirtd restarts. *

[libvirt] [PATCHv3 09/43] snapshot: simplify acting on just children

2011-08-24 Thread Eric Blake
Similar to the last patch in isolating the filtering from the client actions, so that clients don't have to reinvent the filtering. * src/conf/domain_conf.h (virDomainSnapshotForEachChild): New prototype. * src/libvirt_private.syms (domain_conf.h): Export it. * src/conf/domain_conf.c

[libvirt] [PATCHv3 01/43] snapshot: better event when reverting qemu to paused snapshot

2011-08-24 Thread Eric Blake
When reverting a running domain to a paused snapshot, the event that fires should mention that the domain is suspended. * include/libvirt/libvirt.h.in (VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT): New sub-event. * src/qemu/qemu_driver.c (qemuDomainRevertToSnapshot): Use it. ---

[libvirt] [PATCHv3 03/43] snapshot: properly revert qemu to offline snapshots

2011-08-24 Thread Eric Blake
qemuDomainSnapshotRevertInactive has the same FIXMEs as qemuDomainSnapshotCreateInactive, so algorithmic fixes to properly handle partial loop iterations should be applied later to both functions, but we're not making the situation any worse in this patch. * src/qemu/qemu_driver.c

[libvirt] [PATCHv3 05/43] snapshot: only pass snapshot to qemu command line when reverting

2011-08-24 Thread Eric Blake
Changing the current vm, and writing that change to the file system, all before a new qemu starts, is risky; it's hard to roll back if starting the new qemu fails for some reason. Instead of abusing vm-current_snapshot and making the command line generator decide whether the current snapshot

[libvirt] [PATCHv3 04/43] snapshot: don't leak resources on qemu snapshot failure

2011-08-24 Thread Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=727709 mentions that if qemu fails to create the snapshot (such as what happens on Fedora 15 qemu, which has qmp but where savevm is only in hmp, and where libvirt is old enough to not try the hmp fallback), then 'virsh snapshot-list dom' will show a

[libvirt] [PATCHv3 08/43] snapshot: avoid crash when deleting qemu snapshots

2011-08-24 Thread Eric Blake
This one's nasty. Ever since we fixed virHashForEach to prevent nested hash iterations for safety reasons, virDomainSnapshotDelete with VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN has been broken for qemu: it deletes children, while leaving grandchildren intact but pointing to a no-longer-present parent.

[libvirt] [PATCHv3 00/43] cleaned up snapshot series

2011-08-24 Thread Eric Blake
As promised, here is my v3, which includes all the self-replies I was scattering throughout v2: https://www.redhat.com/archives/libvir-list/2011-August/msg00620.html Also available here: git fetch git://repo.or.cz/libvirt/ericb.git snapshot or browse online at:

[libvirt] [PATCHv3 07/43] snapshot: allow deletion of just snapshot metadata

2011-08-24 Thread Eric Blake
A future patch will make it impossible to remove a domain if it would leave behind any libvirt-tracked metadata about snapshots, since stale metadata interferes with a new domain by the same name. But requiring snaphot contents to be deleted before removing a domain is harsh; with qemu, qemu-img

[libvirt] [PATCHv3 11/43] snapshot: identify which snapshots have metadata

2011-08-24 Thread Eric Blake
To make it easier to know when undefine will fail because of existing snapshot metadata, we need to know how many snapshots have metadata. Also, it is handy to filter the list of snapshots to just those that have no parents; document that flag now, but implement it in later patches. *

[libvirt] [PATCHv3 13/43] snapshot: prevent stranding snapshot data on domain destruction

2011-08-24 Thread Eric Blake
Just as leaving managed save metadata behind can cause problems when creating a new domain that happens to collide with the name of the just-deleted domain, the same is true of leaving any snapshot metadata behind. For safety sake, extend the semantic change of commit b26a9fa9 to also cover

[libvirt] [PATCHv3 16/43] snapshot: support new undefine flags in qemu

2011-08-24 Thread Eric Blake
A nice benefit of deleting all snapshots at undefine time is that you don't have to do any reparenting or subtree identification - since everything goes, this is an O(n) process, whereas using multiple virDomainSnapshotDelete calls would be O(n^2) or worse. * src/qemu/qemu_driver.c

[libvirt] [PATCHv3 02/43] snapshot: improve reverting to qemu paused snapshots

2011-08-24 Thread Eric Blake
If you take a checkpoint snapshot of a running domain, then pause qemu, then restore the snapshot, the result should be a running domain, but the code was leaving things paused. Furthermore, if you take a checkpoint of a paused domain, then run, then restore, there was a brief but

[libvirt] [PATCHv3 10/43] snapshot: let qemu discard only snapshot metadata

2011-08-24 Thread Eric Blake
Adding this was trivial compared to the previous patch for fixing qemu snapshot deletion in the first place. * src/qemu/qemu_driver.c (qemuDomainSnapshotDiscard): Add parameter. (qemuDomainSnapshotDiscardDescendant, qemuDomainSnapshotDelete): Update callers. --- src/qemu/qemu_driver.c | 78

[libvirt] [PATCHv3 14/43] snapshot: refactor some qemu code

2011-08-24 Thread Eric Blake
Prepare for code sharing. No semantic change. * src/qemu/qemu_driver.c (qemuFindQemuImgBinary) (qemuDomainSnapshotWriteMetadata) (qemuDomainSnapshotDiscard): Float up. (qemuDomainSnapshotDiscardDescendant): Likewise, and rename... (qemuDomainSnapshotDiscardAll): ...for generic use.

[libvirt] [PATCHv3 24/43] snapshot: additions to domain xml for disks

2011-08-24 Thread Eric Blake
As discussed here: https://www.redhat.com/archives/libvir-list/2011-August/msg00361.html https://www.redhat.com/archives/libvir-list/2011-August/msg00552.html Adds snapshot attribute and transient sub-element: devices disk type=... snapshot='no|internal|external' ... transient/ /disk

[libvirt] [PATCHv3 18/43] snapshot: prevent migration from stranding snapshot data

2011-08-24 Thread Eric Blake
Migration is another case of stranding metadata. And since snapshot metadata is arbitrarily large, there's no way to shoehorn it into the migration cookie of migration v3. A future patch will make it possible to manually recreate the snapshot metadata on the destination. But even that is

[libvirt] [PATCHv3 27/43] snapshot: introduce new deletion flag

2011-08-24 Thread Eric Blake
Reverting to a state prior to an external snapshot risks corrupting any other branches in the snapshot hierarchy that were using the snapshot as a read-only backing file. So disk snapshot code will default to preventing reverting to a snapshot that has any children, meaning that deleting just the

[libvirt] [PATCHv3 21/43] snapshot: correctly escape generated xml

2011-08-24 Thread Eric Blake
Commit 69278878 fixed one direction of arbitrarily-named snapshots, but not the round trip path. While auditing domain_conf, I found a couple other instances that weren't escaping arbitrary strings. * src/conf/domain_conf.c (virDomainFSDefFormat) (virDomainGraphicsListenDefFormat,

[libvirt] [PATCHv3 15/43] snapshot: cache qemu-img location

2011-08-24 Thread Eric Blake
As more clients start to want to know this information, doing a PATH stat walk and malloc for every client adds up. * src/qemu/qemu_conf.h (qemud_driver): Add member. * src/qemu/qemu_driver.c (qemudShutdown): Cleanup. (qemuFindQemuImgBinary): Add an argument, and cache result.

[libvirt] [PATCHv3 12/43] snapshot: identify qemu snapshot roots

2011-08-24 Thread Eric Blake
Filtering for roots is pretty easy to do. * src/conf/domain_conf.h (virDomainSnapshotObjListGetNames) (virDomainSnapshotObjListNum): Update prototype. * src/conf/domain_conf.c (virDomainSnapshotObjListCopyNames) (virDomainSnapshotObjListGetNames, virDomainSnapshotObjListCount)

[libvirt] [PATCHv3 30/43] snapshot: refactor virsh snapshot creation

2011-08-24 Thread Eric Blake
The next patch will make snapshot creation more complex, so it's better to avoid repetition of the complexity. * tools/virsh.c (vshSnapshotCreate): New helper function. (cmdSnapshotCreate, cmdSnapshotCreateAs): Use it. --- tools/virsh.c | 119

[libvirt] [PATCHv3 22/43] snapshot: update rng to support full domain in xml

2011-08-24 Thread Eric Blake
* docs/schemas/domain.rng: Move guts... * docs/schemas/domaincommon.rng: ...to new file. * docs/schemas/domainsnapshot.rng: Allow new xml. * docs/schemas/Makefile.am (schema_DATA): Distribute new file. * tests/domainsnapshotxml2xmlout/full_domain.xml: New test. --- I've compressed this email by

[libvirt] [PATCHv3 19/43] snapshot: refactor domain xml output

2011-08-24 Thread Eric Blake
Minor semantic change - allow domain xml to be generated in place within a larger buffer, rather than having to go through a temporary string. * src/conf/domain_conf.c (virDomainDefFormatInternal): Add parameter. (virDomainDefFormat, virDomainObjFormat): Update callers. ---

[libvirt] [PATCHv3 17/43] snapshot: teach virsh about new undefine flags

2011-08-24 Thread Eric Blake
Similar to 'undefine --managed-save' (commit 83e849c1), we must assume that the old API is unsafe, and emulate it ourselves. Additionally, we have the wrinkle that while virDomainUndefineFlags and managed save cleanup were introduced in 0.9.4, it wasn't until 0.9.5 that snapshots block undefine of

[libvirt] [PATCHv3 29/43] snapshot: allow halting after snapshot

2011-08-24 Thread Eric Blake
Since a snapshot is fully recoverable, it is useful to have a snapshot as a means of hibernating a guest, then reverting to the snapshot to wake the guest up. This mode of usage is similar to 'virsh save/virsh restore', except that virsh save uses an external file while virsh snapshot keeps the

[libvirt] [PATCHv3 31/43] snapshot: expose halt-after-creation in virsh

2011-08-24 Thread Eric Blake
Easy enough to emulate even with older servers. * tools/virsh.c (cmdSnapshotCreate, cmdSnapshotCreateAs): Add --halt flag. (vshSnapshotCreate): Emulate halt when flag is unsupported. * tools/virsh.pod (snapshot-create, snapshot-create-as): Document it. --- tools/virsh.c | 49

[libvirt] [PATCHv3 20/43] snapshot: allow full domain xml in snapshot

2011-08-24 Thread Eric Blake
Just like VM saved state images (virsh save), snapshots MUST track the inactive domain xml to detect any ABI incompatibilities. The indentation is not perfect, but functionality comes before form. Later patches will actually supply a full domain; for now, this wires up the storage to support

[libvirt] [PATCHv3 38/43] snapshot: reject unimplemented disk snapshot features

2011-08-24 Thread Eric Blake
My RFC for snapshot support [1] proposes several rules for when it is safe to delete or revert to an external snapshot, predicated on the existence of new API flags. These will be incrementally added in future patches, but until then, blindly mishandling a disk snapshot risks corrupting internal

[libvirt] [PATCHv3 26/43] snapshot: reflect recent options in virsh

2011-08-24 Thread Eric Blake
New flag bits are worth exposing via virsh. Additionally, even though I recently added 'virsh snapshot-parent', doing it one snapshot at a time is painful, so make it possible to expand the snapshot-list table at once. In the case of snapshot-list --roots, it's possible to emulate this even when

[libvirt] [PATCHv3 33/43] snapshot: support extra state in snapshots

2011-08-24 Thread Eric Blake
In order to distinguish disk snapshots from system checkpoints, a new state value that is only valid for snapshots is helpful. * include/libvirt/libvirt.h.in (VIR_DOMAIN_LAST): New placeholder. * src/conf/domain_conf.h (virDomainSnapshotState): New enum mapping. (VIR_DOMAIN_DISK_SNAPSHOT): New

[libvirt] [PATCHv3 39/43] snapshot: make it possible to audit external snapshot

2011-08-24 Thread Eric Blake
Snapshots alter the set of disk image files opened by qemu, so they must be audited. But they don't involve a full disk definition structure, just the new filename. Make the next patch easier by refactoring the audit routines to just operate on file name. * src/conf/domain_audit.h

[libvirt] [PATCHv3 23/43] snapshot: store qemu domain details in xml

2011-08-24 Thread Eric Blake
When reverting to a snapshot, the inactive domain configuration has to be rolled back to what it was at the time of the snapshot. Additionally, if the VM is active and the snapshot was active, this now adds a failure if the two configurations are ABI incompatible, rather than risking qemu

[libvirt] [PATCHv3 25/43] snapshot: reject transient disks where code is not ready

2011-08-24 Thread Eric Blake
The previous patch introduced new config, but if a hypervisor does not support that new config, someone can write XML that does not behave as documented. This prevents some of those cases by explicitly rejecting transient disks for several hypervisors. Disk snapshots will require a new flag to

[libvirt] [PATCHv3 40/43] snapshot: wire up disk-only flag to snapshot-create

2011-08-24 Thread Eric Blake
I still need a good solution for snapshot-create-as to list multiple disk options. But this patch is sufficient to test the creation of disk snapshots using only default disks for snapshot-create-as, and snapshot-create provides full access to the snapshot process. * tools/virsh.c

[libvirt] [PATCHv3 35/43] snapshot: also support disks by path

2011-08-24 Thread Eric Blake
I got confused when 'virsh domblkinfo dom disk' required the path to a disk (which can be ambiguous, since a single file can back multiple disks), rather than the unambiguous target device name that I was using in disk snapshots. So, in true developer fashion, I went for the best of both worlds -

[libvirt] [PATCHv3 34/43] snapshot: add disks to snapshot xml

2011-08-24 Thread Eric Blake
Adds an optional element to domainsnapshot, which will be used to give user control over external snapshot filenames on input, and specify generated filenames on output. domainsnapshot ... disks disk name='vda' snapshot='no'/ disk name='vdb' snapshot='internal'/ disk name='vdc'

[libvirt] [PATCHv3 36/43] snapshot: add virsh domblklist command

2011-08-24 Thread Eric Blake
This adds a convenience function to virsh that parses out block information from the domain xml, making it much easier to see what strings can be used in all other contexts that demand a specific block name, especially when given the previous patch that allows using either target or unique source

[libvirt] [PATCHv3 41/43] snapshot: wire up live qemu disk snapshots

2011-08-24 Thread 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

[libvirt] [PATCHv3 28/43] snapshot: expose new delete flag in virsh

2011-08-24 Thread Eric Blake
It would technically be possible to have virsh compute the list of descendants of a given snapshot, then delete those one at a time. But it's complex, and not worth writing for a first cut at implementing the new flags. * tools/virsh.c (cmdSnapshotDelete): Add --children-only, --metadata. *

[libvirt] [PATCHv3 32/43] snapshot: wire up new qemu monitor command

2011-08-24 Thread Eric Blake
No one uses this yet, but it will be important once virDomainSnapshotCreateXML learns a VIR_DOMAIN_SNAPSHOT_DISK_ONLY flag, and the xml allows passing in the new file names. * src/qemu/qemu_monitor.h (qemuMonitorDiskSnapshot): New prototype. * src/qemu/qemu_monitor_text.h

[libvirt] [PATCHv3 42/43] snapshot: refactor qemu file opening

2011-08-24 Thread Eric Blake
In a SELinux or root-squashing NFS environment, libvirt has to go through some hoops to create a new file that qemu can then open() by name. Snapshots are a case where we want to guarantee an empty file that qemu can open, so refactor some existing code to make it easier to reuse in the next

[libvirt] [PATCHv3 37/43] snapshot: add flag for requesting disk snapshot

2011-08-24 Thread Eric Blake
Prior to this patch, domainsnapshot/disks was ignored. This changes it to be an error unless an explicit disk snapshot is requested (a future patch may relax things if it turns out to be useful to have a disks specification alongside a system checkpoint). * include/libvirt/libvirt.h.in

Re: [libvirt] Python stream callback removal

2011-08-24 Thread Guannan Ren
On 08/18/2011 05:55 AM, Dave Allan wrote: On Tue, Aug 09, 2011 at 10:28:26PM -0400, Dave Allan wrote: On Tue, Aug 09, 2011 at 10:59:02AM +0100, Daniel P. Berrange wrote: On Mon, Aug 08, 2011 at 06:04:50PM -0400, Dave Allan wrote: I'm trying to write an example serial console implementation in

Re: [libvirt] [PATCH] util: only fchown newly created files in virFileOpenAs

2011-08-24 Thread Eric Blake
On 08/24/2011 03:01 AM, Laine Stump wrote: virFileOpenAs takes desired uid:gid as arguments, and not only uses them for a fork/setuid/setgid when retrying failed open operations, but additionally always forces the opened file to be owned by the given uid:gid. One example of the problems this

Re: [libvirt] [PATCH v2] remote: Refuse connecting to remote socket

2011-08-24 Thread Eric Blake
On 08/24/2011 03:41 AM, Michal Privoznik wrote: If users wants to connect to remote unix socket, e.g. 'qemu+unix://remote/system' currently theremote part is ignored, ending up connecting to localhost. Connecting to remote socket is not supported and user should have used TLS/TCP/SSH instead.

Re: [libvirt] [PATCH v2] daemon: Move TLS initialization to virInitialize

2011-08-24 Thread Eric Blake
On 08/24/2011 09:18 AM, Michal Privoznik wrote: My previous patch 74c75671331d284e1f777f9692b72e9737520bf0 introduced a regression by removing TLS initialization from client. --- diff to v1: -remove virNetTLSDeinit() daemon/libvirtd.c |2 -- src/libvirt.c |3 +++

Re: [libvirt] [PATCHv3 02/43] snapshot: improve reverting to qemu paused snapshots

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:22:19AM -0600, Eric Blake wrote: If you take a checkpoint snapshot of a running domain, then pause qemu, then restore the snapshot, the result should be a running domain, but the code was leaving things paused. Furthermore, if you take a checkpoint of a paused

Re: [libvirt] [PATCHv3 03/43] snapshot: properly revert qemu to offline snapshots

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:22:20AM -0600, Eric Blake wrote: qemuDomainSnapshotRevertInactive has the same FIXMEs as qemuDomainSnapshotCreateInactive, so algorithmic fixes to properly handle partial loop iterations should be applied later to both functions, but we're not making the situation

Re: [libvirt] [PATCHv3 04/43] snapshot: don't leak resources on qemu snapshot failure

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:22:21AM -0600, Eric Blake wrote: https://bugzilla.redhat.com/show_bug.cgi?id=727709 mentions that if qemu fails to create the snapshot (such as what happens on Fedora 15 qemu, which has qmp but where savevm is only in hmp, and where libvirt is old enough to not try

Re: [libvirt] [PATCHv3 05/43] snapshot: only pass snapshot to qemu command line when reverting

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:22:22AM -0600, Eric Blake wrote: Changing the current vm, and writing that change to the file system, all before a new qemu starts, is risky; it's hard to roll back if starting the new qemu fails for some reason. Instead of abusing vm-current_snapshot and making the

Re: [libvirt] [PATCHv3 01/43] snapshot: better event when reverting qemu to paused snapshot

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:22:18AM -0600, Eric Blake wrote: When reverting a running domain to a paused snapshot, the event that fires should mention that the domain is suspended. * include/libvirt/libvirt.h.in (VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT): New sub-event. *

Re: [libvirt] [PATCHv3 03/43] snapshot: properly revert qemu to offline snapshots

2011-08-24 Thread Eric Blake
On 08/24/2011 10:10 AM, Daniel P. Berrange wrote: On Wed, Aug 24, 2011 at 09:22:20AM -0600, Eric Blake wrote: +{ +const char *qemuimgarg[] = { NULL, snapshot, -a, NULL, NULL, NULL }; +for (i = 0; i vm-def-ndisks; i++) { + +qemuimgarg[4] = vm-def-disks[i]-src; + +

Re: [libvirt] [PATCHv3 06/43] snapshot: track current snapshot across restarts

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:22:23AM -0600, Eric Blake wrote: Audit all changes to the qemu vm-current_snapshot, and make them update the saved xml file for both the previous and the new snapshot, so that there is always at most one snapshot with active1/active in the xml, and that snapshot is

Re: [libvirt] [PATCHv3 07/43] snapshot: allow deletion of just snapshot metadata

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:22:24AM -0600, Eric Blake wrote: A future patch will make it impossible to remove a domain if it would leave behind any libvirt-tracked metadata about snapshots, since stale metadata interferes with a new domain by the same name. But requiring snaphot contents to be

Re: [libvirt] [PATCH 1/3] pci: Fix callers of pciDeviceListSteal() when there's more than one device

2011-08-24 Thread Eric Blake
On 08/24/2011 09:30 AM, Shradha Shah wrote: long subject line; I've shortened it to fit in more typical commit length: pci: fix pciDeviceListSteal on multiple devices pciDeviceListSteal(pcidevs, dev) removes dev from pcidevs reducing the length of pcidevs, so moving onto what was the next dev

Re: [libvirt] [PATCHv3 08/43] snapshot: avoid crash when deleting qemu snapshots

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:22:25AM -0600, Eric Blake wrote: This one's nasty. Ever since we fixed virHashForEach to prevent nested hash iterations for safety reasons, virDomainSnapshotDelete with VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN has been broken for qemu: it deletes children, while leaving

Re: [libvirt] [PATCHv3 16/43] snapshot: support new undefine flags in qemu

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:22:33AM -0600, Eric Blake wrote: A nice benefit of deleting all snapshots at undefine time is that you don't have to do any reparenting or subtree identification - since everything goes, this is an O(n) process, whereas using multiple virDomainSnapshotDelete calls

Re: [libvirt] [PATCHv3 13/43] snapshot: prevent stranding snapshot data on domain destruction

2011-08-24 Thread Daniel P. Berrange
On Wed, Aug 24, 2011 at 09:22:30AM -0600, Eric Blake wrote: Just as leaving managed save metadata behind can cause problems when creating a new domain that happens to collide with the name of the just-deleted domain, the same is true of leaving any snapshot metadata behind. For safety sake,

Re: [libvirt] [PATCH 2/3] qemu: When reserving all functions on a slot don't reserve function 0 on the next slot.

2011-08-24 Thread Eric Blake
On 08/24/2011 09:31 AM, Shradha Shah wrote: Again a long subject; I changed to: qemu: fix off-by-one in pci slot reservation Signed-off-by: Steve Hodgsonshodg...@solarflare.com --- src/qemu/qemu_command.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [libvirt] [PATCHv3 13/43] snapshot: prevent stranding snapshot data on domain destruction

2011-08-24 Thread Eric Blake
On 08/24/2011 10:49 AM, Daniel P. Berrange wrote: On Wed, Aug 24, 2011 at 09:22:30AM -0600, Eric Blake wrote: Just as leaving managed save metadata behind can cause problems when creating a new domain that happens to collide with the name of the just-deleted domain, the same is true of leaving

Re: [libvirt] [PATCHv3 08/43] snapshot: avoid crash when deleting qemu snapshots

2011-08-24 Thread Eric Blake
On 08/24/2011 10:38 AM, Daniel P. Berrange wrote: On Wed, Aug 24, 2011 at 09:22:25AM -0600, Eric Blake wrote: This one's nasty. Ever since we fixed virHashForEach to prevent nested hash iterations for safety reasons, virDomainSnapshotDelete with VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN has been

Re: [libvirt] [PATCHv3 08/43] snapshot: avoid crash when deleting qemu snapshots

2011-08-24 Thread Eric Blake
On 08/24/2011 12:34 PM, Eric Blake wrote: On 08/24/2011 10:38 AM, Daniel P. Berrange wrote: On Wed, Aug 24, 2011 at 09:22:25AM -0600, Eric Blake wrote: This one's nasty. Ever since we fixed virHashForEach to prevent nested hash iterations for safety reasons, virDomainSnapshotDelete with

Re: [libvirt] [PATCH 1/3] daemon: Create priority workers pool

2011-08-24 Thread Daniel P. Berrange
On Tue, Aug 23, 2011 at 05:53:35PM +0200, Michal Privoznik wrote: On 23.08.2011 14:23, Daniel P. Berrange wrote: On Tue, Aug 16, 2011 at 06:39:10PM +0200, Michal Privoznik wrote: diff --git a/src/util/threadpool.c b/src/util/threadpool.c index 8217591..ad2d249 100644 ---

[libvirt] Automated builds of libvirt

2011-08-24 Thread Daniel P. Berrange
You may have seen references to the libvirt automated builder with various patches sent to the list. Previously this was running on one of my own private machines, but I've now got it in a dedicated virtual machine, and have it rsyncing its results to a publically visible site:

Re: [libvirt] [PATCH 7/8] test: Cleanup improper VIR_ERR_NO_SUPPORT use

2011-08-24 Thread Daniel P. Berrange
On Tue, Aug 23, 2011 at 05:39:44PM +0800, Osier Yang wrote: --- src/test/test_driver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index b3e24b4..3dfe305 100644 --- a/src/test/test_driver.c +++

Re: [libvirt] [PATCH 8/8] xen: Cleanup improper VIR_ERR_NO_SUPPORT use

2011-08-24 Thread Daniel P. Berrange
On Tue, Aug 23, 2011 at 05:39:45PM +0800, Osier Yang wrote: --- src/xen/xen_hypervisor.c |4 ++-- src/xen/xend_internal.c | 26 +- src/xen/xm_internal.c|3 ++- src/xenxs/xen_sxpr.c |4 ++-- 4 files changed, 19 insertions(+), 18 deletions(-)

Re: [libvirt] [PATCH 6/8] storage: Cleanup improper VIR_ERR_NO_SUPPORT use

2011-08-24 Thread Daniel P. Berrange
On Tue, Aug 23, 2011 at 05:39:43PM +0800, Osier Yang wrote: --- src/storage/storage_backend.c | 12 ++-- src/storage/storage_backend_disk.c|2 +- src/storage/storage_backend_fs.c |2 +- src/storage/storage_backend_logical.c |2 +- 4 files changed, 9

Re: [libvirt] [PATCH 5/8] remote: Cleanup improper VIR_ERR_NO_SUPPORT use

2011-08-24 Thread Daniel P. Berrange
On Tue, Aug 23, 2011 at 05:39:42PM +0800, Osier Yang wrote: --- src/remote/remote_driver.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index e5bfa4b..28f333b 100644 --- a/src/remote/remote_driver.c

Re: [libvirt] [PATCH 4/8] qemu: Cleanup improper VIR_ERR_NO_SUPPORT use

2011-08-24 Thread Daniel P. Berrange
On Tue, Aug 23, 2011 at 05:39:41PM +0800, Osier Yang wrote: * src/qemu/qemu_command.c: s/VIR_ERR_NO_SUPPORT/VIR_ERR_CONFIG_UNSUPPORTED/ * src/qemu/qemu_driver.c: s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_INVALID/ * src/qemu/qemu_process.c: s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_INVALID/ ---

  1   2   >