[libvirt] [PATCH 0/3] atomic snapshots, round 1
by Eric Blake
I figured it's better to post small patch series for incremental
review than to slam the list with a 20 patch series. I'm in the
middle of coding up my RFC for interaction with the new qemu 1.1
'transaction' monitor command, and this is the first step.
[1] https://www.redhat.com/archives/libvir-list/2012-March/msg00578.html
To avoid a merge conflict, this patch [2] needs to be applied first.
[2] https://www.redhat.com/archives/libvir-list/2012-March/msg00744.html
Eric Blake (3):
snapshot: add qemu capability for 'transaction' command
snapshot: add atomic create flag
snapshot: rudimentary qemu support for atomic disk snapshot
include/libvirt/libvirt.h.in | 2 ++
src/libvirt.c | 21 ++++++++++++++-------
src/qemu/qemu_capabilities.c | 1 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_driver.c | 40 +++++++++++++++++++++++++++-------------
src/qemu/qemu_monitor_json.c | 3 +++
tools/virsh.c | 6 ++++++
tools/virsh.pod | 16 ++++++++++++++--
8 files changed, 68 insertions(+), 22 deletions(-)
--
1.7.7.6
12 years, 9 months
[libvirt] [PATCH 00/14] Support reading auth credentials from a config file
by Daniel P. Berrange
When connecting to a remote libvirtd, or hypervisor that requires
authentication we have callbacks which can be used to prompt for
various credentials. This is tedious if you are looking to automate
stuff though. While we could let each application implement a
custom auth callback for fetching credentials from a config file,
it is nicer if we provide this ability directly in libvirt, so that
all apps can benefit from it.
So this series introduces a new config file in which authentication
credentials can be placed. It supports setting multiple sets of
credentials, of varying types in one file. I use the '.ini' config
file syntax, since this makes it easy to reuse the same config file
in virt-viewer & similar apps to store VNC / SPICE credentials.
To find the config file we check for each of
- Path from LIBVIRT_AUTH_FILE env var
- Query param 'authfile=PATH' in the URI params
- /etc/libvirt/auth.conf
- $HOME/.libvirt/auth.conf
if no config file is present, everything should carry on as normal.
If the config is present, then it is consulted to fill in credentials
first. Only if there are still missing credentials, will the auth
callbacks then be invoked.
See the docs in patch 12 of this series for the config file
syntax examples.
This is supported for all drivers that do auth, remote, esx,
xenapi, hyperv and phyp, though I have only tested it with the
remote driver. I would appreciate someone giving it a go with
the other drivers.
The first 7 patches are actually all related to the viruri.[ch]
file, expanding its functionality & adding tests. This is to
make sure the auth config patches can have easy access to the
query params.
The last 7 patches are related to the auth config file support
again including tests
12 years, 9 months
[libvirt] [PATCH] build: fix incorrect enum declaration
by Eric Blake
Recent changes have caused build failures on builds where pdwtags works:
commit a26a196 mistakenly exported a public variable
commits a26a196, 57ddcc2, 487c063 all had copy-paste bugs in
hand-updating the golden API rather than rerunning pdwtags
* include/libvirt/libvirt.h.in (virDomainEventTrayChangeReason):
Make this a typedef, not external storage.
* src/remote_protocol-structs (remote_procedure): Fix spelling.
---
Pushing under the build-breaker rule, as 'make -C src check' failed.
The build is still broken, though, due to a missing qparams.h file
causing 'make -C tests check' to fail.
include/libvirt/libvirt.h.in | 2 +-
src/remote_protocol-structs | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index c702e66..8bb5c57 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -3684,7 +3684,7 @@ typedef void (*virConnectDomainEventDiskChangeCallback)(virConnectPtr conn,
*
* The reason describing why the callback was called
*/
-enum {
+typedef enum {
VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN = 0,
VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE,
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 474e574..9b2414f 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -1654,13 +1654,13 @@ struct remote_domain_event_tray_change_msg {
remote_nonnull_domain dom;
remote_nonnull_string devAlias;
int reason;
-}
+};
struct remote_domain_event_pmwakeup_msg {
remote_nonnull_domain dom;
-}
+};
struct remote_domain_event_pmsuspend_msg {
remote_nonnull_domain dom;
-}
+};
struct remote_domain_managed_save_args {
remote_nonnull_domain dom;
u_int flags;
@@ -2189,7 +2189,7 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_GET_METADATA = 265,
REMOTE_PROC_DOMAIN_BLOCK_REBASE = 266,
REMOTE_PROC_DOMAIN_PM_WAKEUP = 267,
- REMOTE_PROC_DOMAIN_TRAY_CHANGE = 268,
- REMOTE_PROC_DOMAIN_PMWAKEUP = 269,
- REMOTE_PROC_DOMAIN_PMSUSPEND = 270,
+ REMOTE_PROC_DOMAIN_EVENT_TRAY_CHANGE = 268,
+ REMOTE_PROC_DOMAIN_EVENT_PMWAKEUP = 269,
+ REMOTE_PROC_DOMAIN_EVENT_PMSUSPEND = 270,
};
--
1.7.7.6
12 years, 9 months
[libvirt] [PATCH 0/6] atomic snapshots, rounds 4 and 5
by Eric Blake
I was originally going to send this as two rounds, one for
the XML additions of adding mirrors, and one for the flag
addition to virDomainSnapshotDelete for mapping to drive-reopen;
but it turned out that testing is easier if I finish the series.
Note that this is minimally tested at the moment; I'm posting it
to get review started, but I plan on hammering it tomorrow, and
possibly coming up with slight alterations for a v2.
This assumes that rounds 1-3 (ending here) have been applied:
https://www.redhat.com/archives/libvir-list/2012-March/msg00846.html
This should finish out my RFC here:
https://www.redhat.com/archives/libvir-list/2012-March/msg00578.html
but with one major caveat:
https://lists.gnu.org/archive/html/qemu-devel/2012-03/msg01524.html
Upstream qemu has not yet committed the 'drive-mirror' or 'drive-reopen'
monitor commands, which this series (rounds 4-5) depends on. There are
still bugs being worked out under the hood on the qemu side, and there
is a slight possibility that fixing those bugs may change the public
interface. Therefore, part of the review of this series should be to
determine whether we take the risk of applying the patch now, or
waiting for qemu to stabilize a bit further.
I will probably push rounds 1-3 tomorrow, since they have been ACK'd
(well, round 3 is still awaiting review), and since qemu has committed
to the 'transaction' monitor command for qemu 1.1.
For reference, it is likely that RHEL 6.3 will not wait for qemu 1.1,
but will instead provide RHEL-specific monitor commands named
__com.redhat_drive-mirror and __com.redhat_drive-reopen; I have
hopefully structured things well enough that it will be a couple
lines of patching to qemu_monitor_json.c to recognize that alternate
command name.
Eric Blake (6):
snapshot: allow for creation of mirrored snapshots
snapshot: add new snapshot delete flags
snapshot: make it possible to check for mirrored snapshot
snapshot: expose qemu commands for mirrored storage migration
snapshot: implement new snapshot delete flags in qemu
snapshot: enable mirrored snapshots on transient vm
docs/formatsnapshot.html.in | 31 +++
docs/schemas/domainsnapshot.rng | 8 +
include/libvirt/libvirt.h.in | 6 +
src/conf/domain_conf.c | 58 +++++-
src/conf/domain_conf.h | 4 +
src/libvirt.c | 37 +++-
src/libvirt_private.syms | 2 +
src/qemu/qemu_capabilities.c | 3 +
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_driver.c | 242 +++++++++++++++++++-
src/qemu/qemu_monitor.c | 50 ++++
src/qemu/qemu_monitor.h | 14 ++
src/qemu/qemu_monitor_json.c | 70 ++++++-
src/qemu/qemu_monitor_json.h | 21 ++-
.../disk_snapshot_mirror.xml | 13 +
.../disk_snapshot_mirror.xml | 49 ++++
tests/domainsnapshotxml2xmltest.c | 4 +-
tools/virsh.c | 13 +
tools/virsh.pod | 21 ++-
19 files changed, 622 insertions(+), 26 deletions(-)
create mode 100644 tests/domainsnapshotxml2xmlin/disk_snapshot_mirror.xml
create mode 100644 tests/domainsnapshotxml2xmlout/disk_snapshot_mirror.xml
--
1.7.7.6
12 years, 9 months
[libvirt] [PATCH 0/11 v2] Add supports for three new QMP events
by Osier Yang
v1 ~ v2:
* Two more patches, [5/11] to prohibit tray='open' for
block type disk. And [9/11] to introduce a new domain
state 'pmsuspended'
* Definition (including name) for DEVICE_TRAY_MOVED event
is changed into:
typedef void
(*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn,
virDomainPtr dom,
const char *devAlias,
int reason,
void *opaque);
* Definition for both SUSPEND and WAKEUP event are changed,
one more parameter 'int reason' for future extension.
* While SUSPEND event is emitted, the running domain will be
transfered into the new domain state "pmsuspended", instead
of "paused". And while WAKEUP is emitted, it will transfer
the domain state to running only if the domain state is
"pmsuspended".
This patch series adds support for 3 new QMP events: WAKEUP,
SUSPEND, and DEVICE_TRAY_MOVED, and related changes on domain's
conf and status.
[1/11]
Add support for tray moved event
[2/11] ~ [6/11]:
New attribute "tray" is added to disk target, it indicates
the tray status of removable disk, i.e. CDROM and Floppy disks,
its value could be either of "open" or "closed", defaults to
"closed", and a removable disk with tray == "open" won't have
the source when domain is started. The value of "tray" will
be updated while tray moved event is emitted from guest.
tray status 'open' is prohibited for block type disk.
Prior to these patches, if the user ejected the medium of
removable disk from guest side, and then do migration or
save/restoring, the guest will still starts the medium source
,and thus the medium will still exists in guest, which is
strange. These patches fix it.
[7/11] + [11/11]:
Add support for wakeup event, and update the domain status
to running if the domain is in pmsuspended state, while the wakeup
event is emitted.
[9/11]
Introduce new domain state "pmsuspended", which indicates the
domain has been suspended by guest power management, e.g, entered
into s3 state.
[8/11] + [10/11]:
Add support for suspend event, and update the domain status
to pmsuspended if the domain was running, while the suspend event
is emitted.
Osier Yang(11)
Add support for event tray moved of removable disks
docs: Add documentation for new attribute tray of disk target
conf: Parse and for the tray attribute
qemu: Do not start with source for removable disks if tray is open
qemu: Prohibit setting tray status as open for block type disk
qemu: Update tray status while tray moved event is emitted
Add support for the wakeup event
Add support for the suspend event
New domain state pmsuspended
qemu: Update domain state to pmsuspended while suspend event occurs
qemu: Update domain status to running while wakeup event is emitted
daemon/remote.c | 79 ++++++++++
docs/formatdomain.html.in | 13 ++-
docs/schemas/domaincommon.rng | 8 +
examples/domain-events/events-c/event-test.c | 66 +++++++++-
examples/domain-events/events-python/event-test.py | 12 ++
include/libvirt/libvirt.h.in | 98 ++++++++++++-
python/libvirt-override-virConnect.py | 27 ++++
python/libvirt-override.c | 150 ++++++++++++++++++++
src/conf/domain_conf.c | 71 ++++++++--
src/conf/domain_conf.h | 9 ++
src/conf/domain_event.c | 115 +++++++++++++++
src/conf/domain_event.h | 10 ++
src/libvirt_private.syms | 6 +
src/qemu/qemu_command.c | 31 ++++-
src/qemu/qemu_monitor.c | 33 +++++
src/qemu/qemu_monitor.h | 16 ++-
src/qemu/qemu_monitor_json.c | 45 ++++++
src/qemu/qemu_process.c | 121 ++++++++++++++++
src/remote/remote_driver.c | 95 ++++++++++++
src/remote/remote_protocol.x | 19 +++-
src/remote_protocol-structs | 14 ++
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml | 2 +-
.../qemuxml2argv-boot-complex-bootindex.xml | 6 +-
.../qemuxml2argvdata/qemuxml2argv-boot-complex.xml | 6 +-
.../qemuxml2argvdata/qemuxml2argv-boot-floppy.xml | 2 +-
...uxml2argv-boot-menu-disable-drive-bootindex.xml | 2 +-
.../qemuxml2argv-boot-menu-disable-drive.xml | 2 +-
.../qemuxml2argv-boot-menu-disable.xml | 2 +-
.../qemuxml2argv-boot-menu-enable.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-boot-multi.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml | 4 +-
tests/qemuxml2argvdata/qemuxml2argv-bootloader.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-aio.xml | 2 +-
.../qemuxml2argv-disk-cdrom-empty.xml | 2 +-
...qemuxml2argv-disk-cdrom-tray-no-device-cap.args | 4 +
.../qemuxml2argv-disk-cdrom-tray-no-device-cap.xml | 32 ++++
.../qemuxml2argv-disk-cdrom-tray.args | 10 ++
.../qemuxml2argv-disk-cdrom-tray.xml | 43 ++++++
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml | 2 +-
.../qemuxml2argv-disk-copy_on_read.xml | 2 +-
.../qemuxml2argv-disk-drive-boot-cdrom.xml | 2 +-
.../qemuxml2argv-disk-drive-boot-disk.xml | 2 +-
.../qemuxml2argv-disk-drive-cache-directsync.xml | 2 +-
.../qemuxml2argv-disk-drive-cache-unsafe.xml | 2 +-
.../qemuxml2argv-disk-drive-cache-v1-none.xml | 2 +-
.../qemuxml2argv-disk-drive-cache-v1-wb.xml | 2 +-
.../qemuxml2argv-disk-drive-cache-v1-wt.xml | 2 +-
.../qemuxml2argv-disk-drive-cache-v2-none.xml | 2 +-
.../qemuxml2argv-disk-drive-cache-v2-wb.xml | 2 +-
.../qemuxml2argv-disk-drive-cache-v2-wt.xml | 2 +-
...muxml2argv-disk-drive-error-policy-enospace.xml | 2 +-
.../qemuxml2argv-disk-drive-error-policy-stop.xml | 2 +-
...rgv-disk-drive-error-policy-wreport-rignore.xml | 2 +-
.../qemuxml2argv-disk-drive-fmt-qcow.xml | 2 +-
.../qemuxml2argv-disk-drive-no-boot.xml | 4 +-
.../qemuxml2argv-disk-drive-readonly-disk.xml | 2 +-
.../qemuxml2argv-disk-drive-readonly-no-device.xml | 2 +-
.../qemuxml2argv-disk-drive-shared.xml | 2 +-
...emuxml2argv-disk-floppy-tray-no-device-cap.args | 4 +
...qemuxml2argv-disk-floppy-tray-no-device-cap.xml | 37 +++++
.../qemuxml2argv-disk-floppy-tray.args | 10 ++
.../qemuxml2argv-disk-floppy-tray.xml | 37 +++++
.../qemuxml2argvdata/qemuxml2argv-disk-floppy.xml | 4 +-
.../qemuxml2argv-disk-ioeventfd.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-order.xml | 2 +-
.../qemuxml2argv-disk-snapshot.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-virtio.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml | 2 +-
.../qemuxml2argv-floppy-drive-fat.xml | 2 +-
.../qemuxml2argv-graphics-spice-timeout.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-lease.xml | 2 +-
.../qemuxml2argv-net-bandwidth.xml | 2 +-
tests/qemuxml2argvtest.c | 6 +
.../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +-
tests/vmx2xmldata/vmx2xml-cdrom-ide-device.xml | 2 +-
tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml | 2 +-
tests/vmx2xmldata/vmx2xml-cdrom-scsi-device.xml | 2 +-
tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml | 2 +-
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml | 8 +-
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml | 4 +-
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.xml | 2 +-
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-6.xml | 2 +-
tests/vmx2xmldata/vmx2xml-floppy-device.xml | 2 +-
tests/vmx2xmldata/vmx2xml-floppy-file.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ws-in-the-wild-1.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ws-in-the-wild-2.xml | 2 +-
tools/virsh.c | 12 ++
tools/virsh.pod | 7 +-
89 files changed, 1277 insertions(+), 99 deletions(-)
Osier
12 years, 9 months
[libvirt] [PATCH v3 0/3] Sysinfo improvements for PowerPC & x86
by Prerna
This series of patches implements the following:
Patch 1/2 : Implement sysinfo for PowerPC. OnPowerPC, sysinfo is
obtained by reading /proc/cpuinfo since dmidecode is not available.
Patch 2/2 : Based on Eric's suggestion
(http://www.redhat.com/archives/libvir-list/2012-February/msg00509.html)
Allow x86 to read host system's processor information from
/proc/cpuinfo in the event dmidecode is not available.
Changelog :
-----------
v1->v2 :
* Rebased and cleanups done.
v2->v3:
* Patch 1/2 : rebased.
* Patch 2/2 : As reported by Daniel, it was found that 'dmidecode'
lists socket (and not core-level) information under the <processor>
XML tag. The /proc/cpuinfo fallback is also accordingly modified to
display a listing of the available sockets under the '<processor>'
XML tag under sysinfo.
(http://www.spinics.net/linux/fedora/libvir/msg53922.html)
Thanks,
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
12 years, 9 months
[libvirt] clarify freecell documentation v2
by Dave Allan
Modified per Eric's feedback: removed incorrect virsh help change,
removed unnecessary examples in the manpage. I also fixed two
instances in which I referred to nodes instead of cells.
Dave
12 years, 9 months
[libvirt] [PATCH] libvirt:docs: fix typo
by Zhou Peng
---
docs/formatdomain.html.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 4edada3..3a504a1 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2903,8 +2903,8 @@ qemu-kvm -net nic,model=? /dev/null
0.9.3</span>.
</p>
<p>
- Mouse mode is set by the <code>mouse<code/> element,
- setting it's <code>mode<code/> attribute to one of
+ Mouse mode is set by the <code>mouse</code> element,
+ setting it's <code>mode</code> attribute to one of
<code>server</code> or <code>client</code> ,
<span class="since">since 0.9.11</span>. If no mode is
specified, the qemu default will be used (client mode).
--
1.7.7.6
12 years, 9 months
Re: [libvirt] [libvirt PATCHv6 1/1] add DHCP snooping
by David Stevens
Stefan Berger/Watson/IBM wrote on 03/22/2012 05:33:41 PM:
>
> Ok.
> An idea may be that the threat has to 'find' its snoop request in a
> global list every time it processes a packet. Once it cannot find it
> anymore, it dies. Removing the request from the global list would be
> the way to terminate the threat. Also, it would have to hold a look
> to the snoop request while it does anything else than waiting for
> packets in the pcap library.
Actually, that's exactly what I was going to do -- a hash list
of valid threads and exit if it isn't in the list; then still remove
the req's and free them as the current code does, which means they
won't interfere with each other, but the cancel code can be separated,
in the same place, but synchronous with no signal; Thread management
independent of req management.
+_DLS
12 years, 9 months
Re: [libvirt] [libvirt PATCHv6 1/1] add DHCP snooping
by Stefan Berger
David Stevens/Beaverton/IBM wrote on 03/22/2012 08:10:44 PM:
> From: David Stevens/Beaverton/IBM
> To: Stefan Berger/Watson/IBM
> Cc: Eric Blake <eblake(a)redhat.com>, libvir-list(a)redhat.com
> Date: 03/22/2012 08:10 PM
> Subject: Re: [libvirt] [libvirt PATCHv6 1/1] add DHCP snooping
>
> Stefan Berger/Watson/IBM wrote on 03/22/2012 05:00:45 PM:
>
> > Maybe we should go with the previous code from a while ago which was
> > setting a flag for the thread to die. It caused other work-arounds
> > to become necessary but at least we don't have to deal with possibly
> > async. deaths of threads holding locks.
>
> Yes, I have in mind a way to do this now that should keep the
> simplicity and still not use signals. I'll try this out and
> repost.
>
Ok.
An idea may be that the threat has to 'find' its snoop request in a global
list every time it processes a packet. Once it cannot find it anymore, it
dies. Removing the request from the global list would be the way to
terminate the threat. Also, it would have to hold a look to the snoop
request while it does anything else than waiting for packets in the pcap
library.
Stefan
12 years, 9 months