[libvirt] [libvirt-java] [PATCH 00/65]
by Claudio Bley
Hi.
Here are a few patches that piled up in my local branch. Some of them
I already submitted to this list, but there has been no reponse to
them.
Included are a few trivial fixes as well as memory leak fixes and
additions to the public API.
There had been some minor interest in my first version of domain event
support in the Java wrapper[1], which I have reworked almost entirely.
If nobody objects, say, within the next two weeks or so, I'll go ahead
and push the whole series as was suggested to me by Daniel P. Berrange
on this list[2].
I've made sure that all JUnit tests pass after every commit with JNA
versions 3.4.1, 3.4.2, 3.5.0, 3.5.1, 3.5.2 and 4.0.0.
I'd really appreciate your comments or suggestions.
Thanks!
[1]: https://www.redhat.com/archives/libvir-list/2013-January/msg01236.html
[2]: https://www.redhat.com/archives/libvir-list/2014-January/msg01091.html
Claudio Bley (65):
Fix warnings about using raw types
Fix warnings about accessing static methods
Fix typos in Error.java
test: fix typo in testConnection()
test: ensure that exceptions are thrown when expected
Make comments proper javadoc comments for enum constants
Ignore editor backup files
Depend on JNA versions 3.4.1 to 4.0.0
jna: load virt-0 or virt library depending on the platform
Fix wrapping of native size_t data type
Use virFree in order to release memory acquired from libvirt
tests: remove obsolete test driver
Make Device.listCapabilities return only valid array elements
test: ensure the Device.listCapabilities method works
Start refactoring of error handling
Remove processError from Device class
Remove processError from Domain class
Remove processError from DomainSnapshot class
Remove processError from Interface class
Remove processError method from Network class
Remove processError method from NetworkFilter class
Remove processError method from Secret class
Remove processError method from StoragePool class
Remove processError method from StorageVol class
Remove processError method from Stream class
Remove processError method from Connect class
Call processError only when virInitialize signalled an error
Remove ErrorHandler.processError(Libvirt) method
Implement equals and hashCode methods for Connect and Domain
Fix Domain.getSchedulerParameters / getSchedulerType
Fix memleak in Domain.snapshotListNames
Fix memleak in StoragePool.listVolumes
Fix memleak in DomainSnapshot.getXMLDesc
Fix memleak in StorageVol.getPath
Fix memleak in StorageVol.getXMLDesc
jna: Wrap the virEvent(Add,Remove)Timeout libvirt functions
Implement Connect.isAlive
Implement Connect.setKeepAlive
Introduce event loop support
Add constants for enum virDomainEventID
Prepare to define proper domain event callback support
Add constructIncRef factory method to Domain class
events: handle registration for IOError events
events: handle registration for Reboot events
events: handle registration of domain lifecycle events
test: add unit test for domain lifecycle events
events: handle registration for PMWakeup events
events: add support for PMSuspend events
Implement connection close callback support
Implement Connect.getSysinfo
Implement Domain.blockPeek
Implement Domain.memoryPeek
Implement Secret.getUsageType
Implement Domain.isUpdated
Implement Domain.reset
Implement Domain.PMwakeup
Implement Domain.sendKey
Implement interface ByteChannel for Stream class
Implement Domain.screenshot
test: add testDomainScreenshot JUnit test
Add helper for handling bit-flags
Connect: add constructors using java.net.URI params
Replace Connect.getLibVirVersion method with Library.getVersion
Replace static connectionVersion method with getLibVersion
Deprecate Connect.getHypervisorVersion
.gitignore | 2 +
pom.xml.in | 2 +-
src/main/java/org/libvirt/BitFlags.java | 18 +
src/main/java/org/libvirt/Connect.java | 731 +++++++++++++++++---
src/main/java/org/libvirt/Device.java | 57 +-
src/main/java/org/libvirt/Domain.java | 672 +++++++++++-------
src/main/java/org/libvirt/DomainSnapshot.java | 29 +-
src/main/java/org/libvirt/Error.java | 409 +++++++----
src/main/java/org/libvirt/ErrorHandler.java | 54 +-
src/main/java/org/libvirt/Interface.java | 43 +-
src/main/java/org/libvirt/KeycodeSet.java | 46 ++
src/main/java/org/libvirt/Library.java | 134 +++-
src/main/java/org/libvirt/MemoryAddressMode.java | 19 +
src/main/java/org/libvirt/Network.java | 61 +-
src/main/java/org/libvirt/NetworkFilter.java | 43 +-
src/main/java/org/libvirt/Secret.java | 72 +-
src/main/java/org/libvirt/SecretUsageType.java | 23 +
src/main/java/org/libvirt/StoragePool.java | 106 ++-
src/main/java/org/libvirt/StorageVol.java | 68 +-
src/main/java/org/libvirt/Stream.java | 232 +++++--
src/main/java/org/libvirt/SuspendTarget.java | 15 +
src/main/java/org/libvirt/event/CrashedDetail.java | 15 +
src/main/java/org/libvirt/event/DefinedDetail.java | 17 +
src/main/java/org/libvirt/event/DetailInfo.java | 5 +
src/main/java/org/libvirt/event/DomainEvent.java | 71 ++
.../java/org/libvirt/event/DomainEventDetail.java | 7 +
.../java/org/libvirt/event/DomainEventType.java | 60 ++
src/main/java/org/libvirt/event/EventListener.java | 7 +
src/main/java/org/libvirt/event/IOErrorAction.java | 39 ++
.../java/org/libvirt/event/IOErrorListener.java | 21 +
.../java/org/libvirt/event/LifecycleListener.java | 24 +
.../java/org/libvirt/event/PMSuspendListener.java | 17 +
.../java/org/libvirt/event/PMSuspendReason.java | 5 +
.../java/org/libvirt/event/PMSuspendedDetail.java | 15 +
.../java/org/libvirt/event/PMWakeupListener.java | 17 +
.../java/org/libvirt/event/PMWakeupReason.java | 5 +
.../java/org/libvirt/event/RebootListener.java | 15 +
src/main/java/org/libvirt/event/ResumedDetail.java | 20 +
.../java/org/libvirt/event/ShutdownDetail.java | 12 +
src/main/java/org/libvirt/event/StartedDetail.java | 30 +
src/main/java/org/libvirt/event/StoppedDetail.java | 40 ++
.../java/org/libvirt/event/SuspendedDetail.java | 40 ++
.../java/org/libvirt/event/UndefinedDetail.java | 7 +
src/main/java/org/libvirt/jna/Libvirt.java | 121 +++-
src/main/java/org/libvirt/jna/SizeT.java | 19 +
.../java/org/libvirt/jna/SizeTByReference.java | 50 ++
src/main/java/org/libvirt/jna/virConnectAuth.java | 4 +-
.../java/org/libvirt/jna/virConnectCredential.java | 4 +-
.../java/org/libvirt/jna/virDomainBlockInfo.java | 4 +-
.../java/org/libvirt/jna/virDomainBlockStats.java | 4 +-
src/main/java/org/libvirt/jna/virDomainInfo.java | 4 +-
.../org/libvirt/jna/virDomainInterfaceStats.java | 4 +-
.../java/org/libvirt/jna/virDomainJobInfo.java | 4 +-
.../java/org/libvirt/jna/virDomainMemoryStats.java | 4 +-
src/main/java/org/libvirt/jna/virError.java | 4 +-
src/main/java/org/libvirt/jna/virNodeInfo.java | 4 +-
.../java/org/libvirt/jna/virSchedParameter.java | 4 +-
.../java/org/libvirt/jna/virStoragePoolInfo.java | 4 +-
.../java/org/libvirt/jna/virStorageVolInfo.java | 4 +-
src/main/java/org/libvirt/jna/virVcpuInfo.java | 4 +-
src/test/java/org/libvirt/TestJavaBindings.java | 139 +++-
src/test/java/org/libvirt/TestLibvirtGlobals.java | 4 +
src/test/java/test.java | 280 --------
63 files changed, 2807 insertions(+), 1187 deletions(-)
create mode 100644 src/main/java/org/libvirt/BitFlags.java
create mode 100644 src/main/java/org/libvirt/KeycodeSet.java
create mode 100644 src/main/java/org/libvirt/MemoryAddressMode.java
create mode 100644 src/main/java/org/libvirt/SecretUsageType.java
create mode 100644 src/main/java/org/libvirt/SuspendTarget.java
create mode 100644 src/main/java/org/libvirt/event/CrashedDetail.java
create mode 100644 src/main/java/org/libvirt/event/DefinedDetail.java
create mode 100644 src/main/java/org/libvirt/event/DetailInfo.java
create mode 100644 src/main/java/org/libvirt/event/DomainEvent.java
create mode 100644 src/main/java/org/libvirt/event/DomainEventDetail.java
create mode 100644 src/main/java/org/libvirt/event/DomainEventType.java
create mode 100644 src/main/java/org/libvirt/event/EventListener.java
create mode 100644 src/main/java/org/libvirt/event/IOErrorAction.java
create mode 100644 src/main/java/org/libvirt/event/IOErrorListener.java
create mode 100644 src/main/java/org/libvirt/event/LifecycleListener.java
create mode 100644 src/main/java/org/libvirt/event/PMSuspendListener.java
create mode 100644 src/main/java/org/libvirt/event/PMSuspendReason.java
create mode 100644 src/main/java/org/libvirt/event/PMSuspendedDetail.java
create mode 100644 src/main/java/org/libvirt/event/PMWakeupListener.java
create mode 100644 src/main/java/org/libvirt/event/PMWakeupReason.java
create mode 100644 src/main/java/org/libvirt/event/RebootListener.java
create mode 100644 src/main/java/org/libvirt/event/ResumedDetail.java
create mode 100644 src/main/java/org/libvirt/event/ShutdownDetail.java
create mode 100644 src/main/java/org/libvirt/event/StartedDetail.java
create mode 100644 src/main/java/org/libvirt/event/StoppedDetail.java
create mode 100644 src/main/java/org/libvirt/event/SuspendedDetail.java
create mode 100644 src/main/java/org/libvirt/event/UndefinedDetail.java
create mode 100644 src/main/java/org/libvirt/jna/SizeT.java
create mode 100644 src/main/java/org/libvirt/jna/SizeTByReference.java
delete mode 100644 src/test/java/test.java
--
1.7.9.5
10 years, 2 months
[libvirt] [PATCHv2 0/4] Another attempt at improving virsh autocompletion
by Solly Ross
Version 2: Electric Boogaloo
Version 1: https://www.redhat.com/archives/libvir-list/2014-March/msg01898.html
This version of the patch introduces the following new things:
- Tests (a whole bunch of them, in fact)!
- A new `complete` command to run get newline-separated
completion results from the command line
- Support for completing partial quotes
(e.g. `virsh complete "fake-command ab \"i "`)
- Passing the syntax checks (sorry about that)
A brief overview of the patch set follows:
1. Extract parsing logic from the vshCommandParse
so that it can be used elsewhere. The new method
returns states and sets passed in pointers. Calling
methods can interpret these states and deal with them
as needed (completion ignores many, while
vshCommandParse throws errors).
2. Implement (and test!) an improved completion
engine with support for virsh quoting rules,
flags, positional arguments, no duplication,
and more.
3. Add (and test!) a method for retrieve a global
vshControl object should readline be enabled. This
allows for "smart completion" of options like "domain".
4. Extract the domain listing code from virsh-domain-monitor,
and move it to virsh-completer. Implement a domain completer,
which is then used for all the cases of "domain" options
(note that it current does not have any flags specified for
which commands should list active vs inactive domains,
as this commit is mainly to allow people to test out
"smart completion")
Solly Ross (4):
Improve virsh autocompletion (extract parser)
Improve virsh autocompletion (base framework)
Improve virsh autocompletion (global ctl object)
Improve virsh autocompletion (domain completer)
po/POTFILES.in | 1 +
tests/virshtest.c | 268 +++++++++++++
tools/Makefile.am | 3 +-
tools/virsh-completer.c | 355 +++++++++++++++++
tools/virsh-completer.h | 85 +++++
tools/virsh-domain-monitor.c | 287 +-------------
tools/virsh-domain.c | 72 ++++
tools/virsh-snapshot.c | 11 +
tools/virsh.c | 880 +++++++++++++++++++++++++++++++++++++------
tools/virsh.h | 20 +
10 files changed, 1582 insertions(+), 400 deletions(-)
create mode 100644 tools/virsh-completer.c
create mode 100644 tools/virsh-completer.h
--
1.8.3.2
10 years, 2 months
[libvirt] [PATCH V3 0/3] Some improvements for video model
by Wang Rui
From: Zeng Junliang <zengjunliang(a)huawei.com>
http://www.redhat.com/archives/libvir-list/2014-July/msg00644.html
diff to v2:
- hide vram attribute silently instead of reporting an error.
- introduce three new capabilities for vga.vgamem_mb, vmvga.vgamem_mb and qxl.vgamem_mb.
- fix some error reported by building libvirt.
Zeng Junliang (3):
qemu: Hide vram attribute for some useless cases.
qemu: Introduce vgamem attribute for video model
qemu: Add secondary-vga support
docs/formatdomain.html.in | 46 +++---
docs/schemas/domaincommon.rng | 6 +
src/conf/domain_conf.c | 57 +++++++-
src/conf/domain_conf.h | 3 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 17 +++
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_command.c | 162 +++++++++++++++------
src/qemu/qemu_domain.c | 12 ++
tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 3 +
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 3 +
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 3 +
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 3 +
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 3 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 3 +
tests/qemuhelptest.c | 10 +-
...qemuhotplug-console-compat-2+console-virtio.xml | 2 +-
.../qemuxml2argv-console-compat-2.xml | 2 +-
.../qemuxml2argv-controller-order.xml | 2 +-
.../qemuxml2argv-graphics-listen-network.xml | 2 +-
.../qemuxml2argv-graphics-listen-network2.xml | 2 +-
.../qemuxml2argv-graphics-sdl-fullscreen.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2 +-
...emuxml2argv-graphics-spice-agent-file-xfer.args | 5 +-
...qemuxml2argv-graphics-spice-agent-file-xfer.xml | 4 +-
.../qemuxml2argv-graphics-spice-agentmouse.xml | 2 +-
.../qemuxml2argv-graphics-spice-compression.args | 4 +-
.../qemuxml2argv-graphics-spice-compression.xml | 4 +-
.../qemuxml2argv-graphics-spice-listen-network.xml | 4 +-
.../qemuxml2argv-graphics-spice-qxl-vga.args | 4 +-
.../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 +-
.../qemuxml2argv-graphics-spice-sasl.args | 3 +-
.../qemuxml2argv-graphics-spice-sasl.xml | 2 +-
.../qemuxml2argv-graphics-spice-timeout.xml | 2 +-
.../qemuxml2argv-graphics-spice.args | 5 +-
.../qemuxml2argv-graphics-spice.xml | 4 +-
.../qemuxml2argv-graphics-vnc-policy.xml | 2 +-
.../qemuxml2argv-graphics-vnc-sasl.xml | 2 +-
.../qemuxml2argv-graphics-vnc-secondary-vga.args | 7 +
.../qemuxml2argv-graphics-vnc-secondary-vga.xml | 39 +++++
.../qemuxml2argv-graphics-vnc-socket.xml | 2 +-
.../qemuxml2argv-graphics-vnc-std-vga.args | 4 +
.../qemuxml2argv-graphics-vnc-std-vga.xml | 36 +++++
.../qemuxml2argv-graphics-vnc-tls.xml | 2 +-
.../qemuxml2argv-graphics-vnc-vmware-svga.args | 4 +
.../qemuxml2argv-graphics-vnc-vmware-svga.xml | 36 +++++
.../qemuxml2argv-graphics-vnc-websocket.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml | 2 +-
.../qemuxml2argv-net-bandwidth.xml | 2 +-
.../qemuxml2argv-pci-autoadd-addr.xml | 2 +-
.../qemuxml2argv-pci-autoadd-idx.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml | 2 +-
.../qemuxml2argv-pcihole64-q35.args | 3 +-
.../qemuxml2argv-pcihole64-q35.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-q35.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +-
.../qemuxml2argv-serial-spiceport.args | 4 +-
.../qemuxml2argv-serial-spiceport.xml | 2 +-
.../qemuxml2argv-video-device-pciaddr-default.args | 9 +-
.../qemuxml2argv-video-device-pciaddr-default.xml | 6 +-
tests/qemuxml2argvtest.c | 26 +++-
.../qemuxml2xmlout-graphics-listen-network2.xml | 2 +-
.../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +-
.../qemuxml2xmlout-pci-autoadd-addr.xml | 2 +-
.../qemuxml2xmlout-pci-autoadd-idx.xml | 2 +-
tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +-
tests/qemuxml2xmltest.c | 3 +
68 files changed, 494 insertions(+), 121 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-std-vga.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-std-vga.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-vmware-svga.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-vmware-svga.xml
--
1.7.12.4
10 years, 2 months
[libvirt] [PATCH 0/2] esx: Add libcurl based stream driver and implement virDomainScreenshot
by Matthias Bolte
I had the code in these two patches bascially sitting around since 2012,
yes 2012! But I never managed to get the code properly split into patches
and touched up good enough to post it here. This was also hindered by the
fact that I had no ESX test system at hand for the last year or so.
Dawid Zamirski posted some patches [1] to implement virDomainScreenshot
for ESX. So I finally managed to set up some ESX test system again this
weekend and get my old code dusted up. His implementation has two
disadvantages, namely storing the screenshot to a temporary file before
feeding it to a stream and the method of creating the screenshot itself
is availalbe since ESX 4.0 only.
My implementation direcly feeds the screenshot data to a stream and
screenshot creation uses a method available since ESX 2.5.
[1] https://www.redhat.com/archives/libvir-list/2014-March/msg01786.html
10 years, 2 months
[libvirt] [RFC] exclusive vcpu-cpu pinning
by Ján Tomko
Hello developers!
Currently, our default cgroup layout is:
-top level cgroup
\-machine (machine.slice with systemd)
`-vm1.libvirt-qemu (machine-qemu\x2dvm1.scope with systemd)
`-emulator
`-vcpu0
\-vcpu1
\-vm2.libvirt-qemu
`-emulator
`-vcpu0
`-vcpu1
To free some CPUs for exclusive use, either all processes from the top level
cgroup should be moved to another one (which does not seem like a great idea)
or isolcpus= should be specified on the kernel command line.
The cpuset.cpu_exclusive option can be set on a cgroup if
* all the groups up to the top level group have it set
* the cpuset of the current group is a subset of the parent group
and no siblings use any cpus from the current cpuset
This would mean that to keep the existing nested structure, all vcpus and the
emulator thread would need to have an exclusive CPU, e.g:
<vcpu placement='static' cpuset='4-6'>2</vcpu>
<cputune exclusive='yes'>
<vcpupin vcpu='0' cpuset='5'/>
<vcpupin vcpu='1' cpuset='6'/>
<emulatorpin cpuset='4'/>
</cputune>
(The only two issues I found:
1) libvirt would have to mess with systemd's 'machine-scope' behind it's back
(setting cpu_exclusive)
2) creating machines without explicit cpu pinning fails, as libvirt tries to
write all the cpus to the cpuset, even those the other machine uses
exclusively)
I've also thought about just keeping track of the 'exclusived' CPUs in
libvirt. This would not work across drivers. And it could possibly be needed
to solve issue 2).
Do you think any of these options would be useful?
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=996758
Jan
10 years, 3 months
[libvirt] RFC: exposing backing store allocation in domain xml
by Eric Blake
Adam Litke has been asking if I can expose watermark information from
qemu when doing block commit. Qemu still doesn't expose that
information when doing 'virsh blockcopy' (QMP drive-mirror), but DOES
expose it for regular and active 'virsh blockcommit'. The idea is that
when you are writing to more than one file at a time, management needs
to know if the file is nearing a watermark for usage that necessitates
growing the storage volume before hitting an ENOSPC error. In
particular, Adam's use is running qcow2 format on top of block devices,
where it is easy to enlarge the block device.
The current libvirt API virDomainBlockInfo() can only get watermark
information for the active image in a disk chain. It shows three numbers:
capacity: the disk size seen by the guest (can be grown via
virt-resize) - usually larger than the host block device if the guest
has not used the complete disk, but can also be smaller than the host
block device due to overhead of qcow2 and the disk is mostly in use
allocation: the known usage of the host file/block device, should never
be larger than the physical size (other than rounding up to file sector
sizing). For sparse files, this number is smaller than total size based
by the amount of holes in the file. For block devices with qcow2 format,
this number is reported by qemu as the maximum offset in use by the
qcow2 file (without regards to whether earlier offsets are holes that
could be reused). Compare this to what 'du' would report.
physical: the total size of the host file/block device. Compare this to
what 'ls' would report.
Also, the libvirt API virStorageVolGetXMLDesc reports two of those
numbers for a top-level image: <capacity> and <allocation> are listed as
siblings of <target>. But it is not present for a <backingStore>; you
have to use the API twice.
Now that we have a common virStorageSourcePtr type in the C code, we
could do a better job of exposing full information for the entire chain
in a single API call.
I've got a couple ideas of where we can extend existing APIs (and the
extensions do not involve bumping the .so versioning, so it can also be
backported, although it gets MUCH harder to backport without
virStorageSourcePtr).
First, I think the virStorageVolGetXMLDesc should show all three
numbers, by adding a <physical unit='bytes'>...</physical> element
alongside the existing <capacity> and <allocation> elements. Also, I
think it might be nice if we could enhance the API to do a full chain
recursion (probably requires an explicit flag to turn on) where it shows
details on the full backing chain, rather than just partial details on
the immediate backing file; in doing that, the <backingStore> element
would gain recursive <backingStore> (similar to what we recently did in
<domain> XML). In that mode, each layer of <backingStore> would also
report <capacity>, <allocation>, and <physical>. Something like:
# virsh vol-dumpxml --pool default f20.snap2
<volume type='file'>
<name>f20.snap2</name>
<key>/var/lib/libvirt/images/f20.snap2</key>
<source>
</source>
<capacity unit='bytes'>12884901888</capacity>
<allocation unit='bytes'>2503548928</allocation>
<physical unit='bytes'>2503548928</allocation>
<target>
<path>/var/lib/libvirt/images/f20.snap2</path>
<format type='qcow2'/>
<permissions>
<mode>0600</mode>
<owner>0</owner>
<group>0</group>
<label>system_u:object_r:virt_image_t:s0</label>
</permissions>
<timestamps>
<atime>1407295598.583411967</atime>
<mtime>1403064822.622766566</mtime>
<ctime>1404318525.899951254</ctime>
</timestamps>
<compat>1.1</compat>
<features/>
</target>
<backingStore>
<path>/var/lib/libvirt/images/f20.snap1</path>
<capacity unit='bytes'>12884901888</capacity>
<allocation unit='bytes'>2503548928</allocation>
<physical unit='bytes'>2503548928</allocation>
<format type='qcow2'/>
<permissions>
<mode>0600</mode>
<owner>107</owner>
<group>107</group>
<label>system_u:object_r:virt_content_t:s0</label>
</permissions>
<timestamps>
<atime>1407295598.623411816</atime>
<mtime>1402005765.810488875</mtime>
<ctime>1404318523.313955796</ctime>
</timestamps>
<compat>1.1</compat>
<features/>
<backingStore>
<path>/var/lib/libvirt/images/f20.base</path>
<capacity unit='bytes'>10737418240</capacity>
<allocation unit='bytes'>2503548928</allocation>
<physical unit='bytes'>10737418240</allocation>
<format type='raw'/>
<permissions>
<mode>0600</mode>
<owner>107</owner>
<group>107</group>
<label>system_u:object_r:virt_content_t:s0</label>
</permissions>
<timestamps>
<atime>1407295598.623411816</atime>
<mtime>1402005765.810488875</mtime>
<ctime>1404318523.313955796</ctime>
</timestamps>
<backingStore/>
</backingStore>
</backingStore>
</volume>
Also, the current storage volume API is rather hard-coded to assume that
backing elements are in the same storage pool, which is not always true.
It may be time to introduce <backingStore type='file'> or <backingStore
type='network'> to allow better details of cross-pool backing elements,
while leaving plain <backingStore> as a back-compat synonym for
<backingStore type='volume'> for the current hard-coded layout that
assumes the backing element is in the same storage pool.
The other idea I've had is to expand the <domain> XML to expose more
information about backing chains, including to make it expose details
that are redundant with virDomainBlockInfo() for the top level, or maybe
even what virDomainBlockStatsFlags() reports. Here, we have a bit of a
choice - storage volume XML was inconsistent on which attributes were
siblings to <target> (such as <capacity>) vs. children (such as
<timestamps>); it might be nicer to stick all per-file elements at the
same level in <disk> XML (probably as siblings to <source>). On the
other hand, I strongly feel that <compat> is a feature of the <format>,
so it should have been a child rather than a sibling. So, as an example
of what the XML might look like:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'>
<compat>1.1</compat>
<features/>
</driver>
<source file='/tmp/snap2.img'/>
<capacity unit='bytes'>12884901888</capacity>
<allocation unit='bytes'>2503548928</allocation>
<physical unit='bytes'>2503548928</allocation>
<permissions>
<mode>0600</mode>
<owner>107</owner>
<group>107</group>
<label>system_u:object_r:virt_content_t:s0</label>
</permissions>
<timestamps>
<atime>1407295598.623411816</atime>
<mtime>1402005765.810488875</mtime>
<ctime>1404318523.313955796</ctime>
</timestamps>
<backingStore type='file' index='1'>
<format type='qcow2'>
<compat>1.1</compat>
<features/>
</format>
<source file='/tmp/snap1.img'/>
<capacity unit='bytes'>12884901888</capacity>
<allocation unit='bytes'>2503548928</allocation>
<physical unit='bytes'>2503548928</allocation>
<permissions>
<mode>0600</mode>
<owner>0</owner>
<group>0</group>
<label>system_u:object_r:virt_image_t:s0</label>
</permissions>
<timestamps>
<atime>1407295598.583411967</atime>
<mtime>1403064822.622766566</mtime>
<ctime>1404318525.899951254</ctime>
</timestamps>
<backingStore type='file' index='2'>
<format type='raw'/>
<capacity unit='bytes'>10737418240</capacity>
<allocation unit='bytes'>2503548928</allocation>
<physical unit='bytes'>10737418240</allocation>
<source file='/tmp/base.img'/>
<permissions>
<mode>0600</mode>
<owner>107</owner>
<group>107</group>
<label>system_u:object_r:virt_content_t:s0</label>
</permissions>
<timestamps>
<atime>1407295598.623411816</atime>
<mtime>1402005765.810488875</mtime>
<ctime>1404318523.313955796</ctime>
</timestamps>
<backingStore/>
</backingStore>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03'
function='0x0'/>
</disk>
Again, this is a lot of new information, so it may be wise to add a new
flag that must be turned on to request the information. But adding this
information would allow watermark tracking for a blockcommit operation -
when collapsing 'base <- snap1 <- snap2' into 'base <- snap2' by
committing snap1 into base, the <allocation> sublement of the
appropriate <backingStore> level will do live tracking of the qemu
values as more data is being written into base, and thus be usable to
determine if the block device behind base needs to be externally
expanded before hitting an ENOSPC situation.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
10 years, 3 months
[libvirt] [PATCH] libxl: support domainReset
by Jim Fehlig
Currently, libxl_send_trigger() does not implement the LIBXL_TRIGGER_RESET
option, but domainReset can be implemented in the libxl driver by
forcibly destroying the domain and starting it again.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_driver.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 67fd7bc6..08018d4 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -979,6 +979,62 @@ libxlDomainReboot(virDomainPtr dom, unsigned int flags)
}
static int
+libxlDomainReset(virDomainPtr dom, unsigned int flags)
+{
+ libxlDriverPrivatePtr driver = dom->conn->privateData;
+ virDomainObjPtr vm;
+ int ret = -1;
+ libxlDomainObjPrivatePtr priv;
+
+ virCheckFlags(0, -1);
+
+ if (!(vm = libxlDomObjFromDomain(dom)))
+ goto cleanup;
+
+ if (virDomainResetEnsureACL(dom->conn, vm->def) < 0)
+ goto cleanup;
+
+ if (!virDomainObjIsActive(vm)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Domain is not running"));
+ goto cleanup;
+ }
+
+ /*
+ * The semantics of reset can be achieved by forcibly destroying
+ * the domain and starting it again.
+ */
+ priv = vm->privateData;
+ if (libxl_domain_destroy(priv->ctx, vm->def->id, NULL) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to reset domain '%d'"), vm->def->id);
+ goto cleanup;
+ }
+
+ if (!libxlDomainCleanupJob(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to cleanup domain '%d' after reset"),
+ vm->def->id);
+ vm = NULL;
+ goto cleanup;
+ }
+
+ if (libxlDomainStart(driver, vm, false, -1) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to start domain '%d' after reset"),
+ vm->def->id);
+ goto cleanup;
+ }
+
+ ret = 0;
+
+ cleanup:
+ if (vm)
+ virObjectUnlock(vm);
+ return ret;
+}
+
+static int
libxlDomainDestroyFlags(virDomainPtr dom,
unsigned int flags)
{
@@ -4758,6 +4814,7 @@ static virDriver libxlDriver = {
.domainShutdown = libxlDomainShutdown, /* 0.9.0 */
.domainShutdownFlags = libxlDomainShutdownFlags, /* 0.9.10 */
.domainReboot = libxlDomainReboot, /* 0.9.0 */
+ .domainReset = libxlDomainReset, /* 1.2.8 */
.domainDestroy = libxlDomainDestroy, /* 0.9.0 */
.domainDestroyFlags = libxlDomainDestroyFlags, /* 0.9.4 */
.domainGetOSType = libxlDomainGetOSType, /* 0.9.0 */
--
1.8.4.5
10 years, 3 months
[libvirt] [PATCH v3 00/18] Implement virDomainBlockCopy
by Eric Blake
Took me longer than I wanted to get v3 posted. There's lots of
new patches in this version, based on feedback on v2.
Among other things, the bandwidth of virDomainBlockCopy is in
bytes/s, and all the remaining interfaces are updated to use a
flags value to decide whether to use bytes/s instead of the
back-compat MiB/s.
I really want patch 1 in 1.2.8; pasth 2-17 would be nice but
it may be better to delay to later, and I still don't have
virsh updated to cover the changed proposed in patch 18 so that
one should probably wait.
Eric Blake (18):
blockcopy: allow larger buf-size
blockjob: shuffle block rebase code
blockjob: split out block info driver handling
blockjob: split out block info monitor handling
blockjob: hoist bandwidth scaling out of monitor code
blockjob: allow finer bandwidth tuning for query
blockjob: split up virsh blockjob info
blockjob: add new --raw flag to virsh blockjob
blockjob: add new --bytes flag to virsh blockjob
blockcopy: allow block device destination
blockcopy: split out virsh implementation
blockcopy: expose new API in virsh
blockcopy: remote implementation for new API
blockcopy: tweak how rebase calls into copy
blockcopy: add a way to parse disk source
blockcopy: add qemu implementation of new API
blockcopy: add qemu implementation of new tunables
blockjob: allow finer bandwidth tuning for set speed
include/libvirt/libvirt.h.in | 77 +++--
src/conf/domain_conf.c | 107 ++++--
src/conf/domain_conf.h | 4 +
src/libvirt.c | 99 ++++--
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 382 ++++++++++++++++-----
src/qemu/qemu_migration.c | 10 +-
src/qemu/qemu_monitor.c | 108 +++---
src/qemu/qemu_monitor.h | 16 +-
src/qemu/qemu_monitor_json.c | 80 +++--
src/qemu/qemu_monitor_json.h | 9 +-
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 18 +-
src/remote_protocol-structs | 11 +
tests/qemumonitorjsontest.c | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-mirror.xml | 4 +-
tools/virsh-domain.c | 336 ++++++++++++++----
tools/virsh.c | 2 +
tools/virsh.h | 2 +
tools/virsh.pod | 65 ++--
20 files changed, 975 insertions(+), 359 deletions(-)
--
1.9.3
10 years, 3 months
[libvirt] [PATCH v2 0/2] parallels: use parallels SDK instead of prlctl tool
by Dmitry Guryanov
This patchset begins reworking of parallels driver. We have
published Opensource version of parallels SDK (under LGPL license),
so libvirt can link with it.
Dmitry Guryanov (2):
parallels: build with parallels SDK
parallels: login to parallels SDK
configure.ac | 11 +-
po/POTFILES.in | 1 +
src/Makefile.am | 8 +-
src/parallels/parallels_driver.c | 40 ++++++-
src/parallels/parallels_sdk.c | 234 +++++++++++++++++++++++++++++++++++++++
src/parallels/parallels_sdk.h | 30 +++++
src/parallels/parallels_utils.h | 3 +
7 files changed, 318 insertions(+), 9 deletions(-)
create mode 100644 src/parallels/parallels_sdk.c
create mode 100644 src/parallels/parallels_sdk.h
--
1.9.3
10 years, 3 months
[libvirt] Entering freeze for libvirt-1.2.8
by Daniel Veillard
So I tagged 1.2.8-rc1 in git and made tarball and signed rpms
available at the usual place:
ftp://libvirt.org/libvirt/
While we seems to have the new API in place it's also clear that there
is a bunch of patches still waiting, either related to the new APIs
or blocked by lack of review. Please try to prioritize filling up API
implementations, and bug fixes for the reviews but I think we need to be
open about incremental improvements when they are very specific and
allow them in !
I will try to release by Tuesday 2nd Sep, as I will be on the road
next week after that time. However the good point of that monthly cycle
is that if you get the ACKs needed even if that's not in 1.2.8 that will
be in for 1.2.9 next month, in time for KVM Forum :-)
Please give a try to the current version, I'm a limited capacity
to test it this time,
thanks !
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
10 years, 3 months