[libvirt] [PATCH] [libvirt-test-API] fix indent issue in ksiso.sh.
by Qing Lin
we use 4 spaces for the indention in Shell codes.
fix the uncompliance in ksiso.sh.
Signed-off-by: Qing Lin<qinglbj(a)linux.vnet.ibm.com>
---
utils/ksiso.sh | 51 +++++++++++++++++++++++++++------------------------
1 files changed, 27 insertions(+), 24 deletions(-)
diff --git a/utils/ksiso.sh b/utils/ksiso.sh
index a431658..111be6b 100755
--- a/utils/ksiso.sh
+++ b/utils/ksiso.sh
@@ -26,37 +26,40 @@ umount $boot_iso_dir
vlmid=`isoinfo -d -i $boot_iso |grep 'Volume id:'`
vlmid=${vlmid#"Volume id: "}
if [ -n "`echo $vlmid|grep ppc`" ];then
- echo "- edit yaboot.conf and add kickstart entry"
- WORKING_ISO="${custom_iso_dir}/etc/yaboot.conf"
- # change timeout and add kickstart entry
- TIMEOUT_LINE=`cat $WORKING_ISO | grep timeout | head -1`
- APPEND_LINE=`cat $WORKING_ISO | grep append | head -1`
- cat $WORKING_ISO | sed "s#${TIMEOUT_LINE}#timeout=5#" | sed "s#${APPEND_LINE}#append= \"root=live:CDLABEL=$vlmid ks=cdrom:/$kscfg \"#"> isocfgtmp
- mv -f isocfgtmp $WORKING_ISO
- cd $custom_iso_dir
- mkisofs -R -V "$vlmid" -sysid PPC -chrp-boot -U -prep-boot ppc/chrp/yaboot -hfs-bless ppc/mac -no-desktop -allow-multidot -volset 4 -volset-size 1 -volset-seqno 1 -hfs-volid 4 -o $cwd/$custom_iso .
+ echo "- copy kickstart to custom work directory"
+ cp $kscfg $custom_iso_dir
+
+ echo "- edit yaboot.conf and add kickstart entry"
+ WORKING_ISO="${custom_iso_dir}/etc/yaboot.conf"
+ # change timeout and add kickstart entry
+ TIMEOUT_LINE=`cat $WORKING_ISO | grep timeout | head -1`
+ APPEND_LINE=`cat $WORKING_ISO | grep append | head -1`
+ cat $WORKING_ISO | sed "s#${TIMEOUT_LINE}#timeout=5#" | sed "s#${APPEND_LINE}#append= \"root=live:CDLABEL=$vlmid ks=cdrom:/$kscfg \"#"> isocfgtmp
+ mv -f isocfgtmp $WORKING_ISO
+ cd $custom_iso_dir
+ mkisofs -R -V "$vlmid" -sysid PPC -chrp-boot -U -prep-boot ppc/chrp/yaboot -hfs-bless ppc/mac -no-desktop -allow-multidot -volset 4 -volset-size 1 -volset-seqno 1 -hfs-volid 4 -o $cwd/$custom_iso .
else
- echo "- copy kickstart to custom work directory"
- cp $kscfg $custom_iso_dir
+ echo "- copy kickstart to custom work directory"
+ cp $kscfg $custom_iso_dir
- echo "- edit isolinux.cfg and add kickstart entry"
- WORKING_ISO="${custom_iso_dir}/isolinux/isolinux.cfg"
+ echo "- edit isolinux.cfg and add kickstart entry"
+ WORKING_ISO="${custom_iso_dir}/isolinux/isolinux.cfg"
- echo "label custom_ks
- kernel vmlinuz $kernel_args
- append initrd=initrd.img ks=cdrom:/$kscfg ramdisk_size=20000">> $WORKING_ISO
+ echo "label custom_ks
+ kernel vmlinuz $kernel_args
+ append initrd=initrd.img ks=cdrom:/$kscfg ramdisk_size=20000">> $WORKING_ISO
- # change default boot target and timeout
- DEFAULT_LINE=`cat $WORKING_ISO | grep default | head -1`
- TIMEOUT_LINE=`cat $WORKING_ISO | grep timeout | head -1`
+ # change default boot target and timeout
+ DEFAULT_LINE=`cat $WORKING_ISO | grep default | head -1`
+ TIMEOUT_LINE=`cat $WORKING_ISO | grep timeout | head -1`
- cat $WORKING_ISO | sed "s/${DEFAULT_LINE}/default custom_ks/" | sed "s/${TIMEOUT_LINE}/timeout 5/"> isocfgtmp
+ cat $WORKING_ISO | sed "s/${DEFAULT_LINE}/default custom_ks/" | sed "s/${TIMEOUT_LINE}/timeout 5/"> isocfgtmp
- mv -f isocfgtmp $WORKING_ISO
+ mv -f isocfgtmp $WORKING_ISO
- # cd to custom_iso_dir, otherwise mkisofs seems to bomb...
- cd $custom_iso_dir
- mkisofs -R -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -o $cwd/$custom_iso .
+ # cd to custom_iso_dir, otherwise mkisofs seems to bomb...
+ cd $custom_iso_dir
+ mkisofs -R -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -o $cwd/$custom_iso .
fi
EXITVAL=$?
if [ $EXITVAL -ne '0' ] ; then
--
1.7.4.1
12 years, 6 months
[libvirt] [PATCH 00/10] Support hypervisor-threads-pin in vcpupin.
by tangchen
Hi~
Users can use vcpupin command to bind a vcpu thread to a specific physical cpu.
But besides vcpu threads, there are alse some other threads created by qemu
(known as hypervisor threads) that could not be explicitly bound to physical cpus.
This 10 patches implemented hypervisor threads binding, in two ways:
1) Use sched_setaffinity() function;
2) In cpuset cgroup.
A new xml element is introduced, and vcpupin command is improved, see below.
1. Introduce new xml elements:
<cputune>
......
<hypervisorpin cpuset='1'/>
</cputune>
2. Improve vcpupin command to support hypervisor threads binding.
For example, vm1 has the following configuration:
<cputune>
<vcpupin vcpu='1' cpuset='1'/>
<vcpupin vcpu='0' cpuset='0'/>
<hypervisorpin cpuset='1'/>
</cputune>
1) query all threads pining
# vcpupin vm1
VCPU: CPU Affinity
----------------------------------
0: 0
1: 1
Hypervisor: CPU Affinity
----------------------------------
*: 1
2) query hypervisor threads pining only
# vcpupin vm1 --hypervisor
Hypervisor: CPU Affinity
----------------------------------
*: 1
3) change hypervisor threads pining
# vcpupin vm1 --hypervisor 0-1
# vcpupin vm1 --hypervisor
Hypervisor: CPU Affinity
----------------------------------
*: 0-1
# taskset -p 397
pid 397's current affinity mask: 3
Note: If users want to pin a vcpu thread to pcpu, --vcpu option could no longer be omitted.
Tang Chen (10):
Enable cpuset cgroup and synchronous vcpupin info to cgroup.
Support hypervisorpin xml parse
Add qemuSetupCgroupHypervisorPin and synchronize hypervisorpin info
to cgroup.
Add qemuProcessSetHypervisorAffinites and set hypervisor threads
affinities
Introduce virDomainHypervisorPinAdd and virDomainHypervisorPinDel
functions
Introduce qemudDomainPinHypervisorFlags and
qemudDomainGetHypervisorPinInfo in qemu driver.
Introduce remoteDomainPinHypervisorFlags and
remoteDomainGetHypervisorPinInfo functions in remote driver.
Introduce remoteDispatchDomainPinHypervisorFlags and
remoteDispatchDomainGetHypervisorPinInfo functions.
Introduce virDomainPinHypervisorFlags and
virDomainGetHypervisorPinInfo functions.
Improve vcpupin to support hypervisorpin dynically.
daemon/remote.c | 103 +++++++++
docs/schemas/domaincommon.rng | 7 +
include/libvirt/libvirt.h.in | 9 +
src/conf/domain_conf.c | 172 ++++++++++++++-
src/conf/domain_conf.h | 7 +
src/driver.h | 13 +-
src/libvirt.c | 147 +++++++++++++
src/libvirt_private.syms | 2 +
src/libvirt_public.syms | 2 +
src/qemu/qemu_cgroup.c | 88 ++++++++
src/qemu/qemu_cgroup.h | 3 +
src/qemu/qemu_driver.c | 266 ++++++++++++++++++++++-
src/qemu/qemu_process.c | 54 +++++
src/remote/remote_driver.c | 102 +++++++++
src/remote/remote_protocol.x | 24 ++-
src/remote_protocol-structs | 24 ++
src/util/cgroup.c | 35 +++-
src/util/cgroup.h | 3 +
tests/qemuxml2argvdata/qemuxml2argv-cputune.xml | 1 +
tests/vcpupin | 6 +-
tools/virsh.c | 145 ++++++++----
tools/virsh.pod | 16 +-
22 files changed, 1158 insertions(+), 71 deletions(-)
--
1.7.3.1
--
Best Regards,
Tang chen
12 years, 6 months
[libvirt] [PATCH 0/5 v2] numad: Auto-set memory policy with numad's advisory nodeset
by Osier Yang
1/5 allows to pre-set the memory policy of domain process with
advisory nodeset from numad, by introducing a new XML tag
"placement" for <numatune>, its value defaults to either
<vcpu> placement, or static if 'nodeset' is specified. If
<vcpu> placement is 'auto', and no <numatune> is specified,
a default <numatune> (placement='auto' mode='strict') will be
added implicitly.
And thus one can use either of the two ways to full drive
numad (pre-set both CPU affinity and memory policy).
1) <vcpu> placement is 'auto', and no <numatune>
<vcpu placement='auto'>10</vcpu>
2) <vcpu> placement is 'auto', no placement is specified for
<numatune>
<vcpu placement='auto'>10</vcpu>
<numatune>
<memory mode='interleave'/>
</numatune>
See 1/5's commit message for more details.
2/5 copies <numatune> 'placement' to 'vcpu' if no 'cpuset' is
specified. With it, one can also fully drive numad with:
<vcpu>6</vcpu>
<numatune>
<memory placement='auto'/>
</numatune>
3/5 changes the XML parsing/formating codes, so that it always dumps
'placement' for <vcpu>.
v1 - v2:
* Changes on <numatune> parsing so that the <numatune> "placement"
could default to <vcpu> "placement".
* Add member 'default' for enum virDomainNumatuneMemPlacementMode.
* Output "placement" for <numatune> even it's static.
* Copy <numatune> 'placement' to <vcpu> if 'cpuset' is not specified.
* Always dumps <vcpu> placement.
* Update docs/formatdomain.html.in
* Correct the changes on docs/schemas/domaincommon.rng
* New tests for the combinations of <vcpu> and <numatune>.
* Change on spec file is splitted off.
v1 has a different title:
https://www.redhat.com/archives/libvir-list/2012-May/msg00371.html
Osier Yang (5):
numad: Set memory policy according to the advisory nodeset from numad
numad: Copy 'placement' of <numatune> to <vcpu> if its placement is
not specified
numad: Always output 'placement' of <vcpu>
numad: Divide cur_balloon by 1024 before passing it to numad
numad: Add buildRequires of numactl-devel
docs/formatdomain.html.in | 39 ++++--
docs/schemas/domaincommon.rng | 36 ++++--
libvirt.spec.in | 4 +
src/conf/domain_conf.c | 145 ++++++++++++++------
src/conf/domain_conf.h | 13 ++-
src/libvirt_private.syms | 2 +
src/qemu/qemu_process.c | 87 +++++++-----
tests/cpuset | 4 +-
tests/define-dev-segfault | 2 +-
tests/lxcxml2xmldata/lxc-systemd.xml | 2 +-
tests/openvzutilstest.c | 2 +-
.../qemuxml2argv-balloon-device-auto.xml | 2 +-
.../qemuxml2argv-balloon-device.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-bios.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml | 2 +-
.../qemuxml2argv-blkiotune-device.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-blkiotune.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml | 2 +-
.../qemuxml2argv-boot-complex-bootindex.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-boot-complex.xml | 2 +-
.../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 +-
.../qemuxml2argvdata/qemuxml2argv-boot-network.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-boot-order.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-bootloader.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-clock-france.xml | 2 +-
.../qemuxml2argv-clock-localtime.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml | 2 +-
.../qemuxml2argv-clock-variable.xml | 2 +-
.../qemuxml2argv-console-compat-auto.xml | 2 +-
.../qemuxml2argv-console-compat-chardev.xml | 2 +-
.../qemuxml2argv-console-compat.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml | 2 +-
.../qemuxml2argv-cpu-exact2-nofallback.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-fallback.xml | 2 +-
.../qemuxml2argv-cpu-host-kvmclock.xml | 2 +-
.../qemuxml2argv-cpu-host-model-fallback.xml | 2 +-
.../qemuxml2argv-cpu-host-model-nofallback.xml | 2 +-
.../qemuxml2argv-cpu-host-model.xml | 2 +-
.../qemuxml2argv-cpu-host-passthrough.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-kvmclock.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml | 2 +-
.../qemuxml2argv-cpu-nofallback.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.xml | 2 +-
.../qemuxml2argv-cpu-qemu-host-passthrough.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml | 2 +-
.../qemuxml2argv-cpu-topology1.xml | 2 +-
.../qemuxml2argv-cpu-topology2.xml | 2 +-
.../qemuxml2argv-cpu-topology3.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-cputune.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-aio.xml | 2 +-
.../qemuxml2argv-disk-cdrom-empty.xml | 2 +-
.../qemuxml2argv-disk-cdrom-tray-no-device-cap.xml | 2 +-
.../qemuxml2argv-disk-cdrom-tray.xml | 2 +-
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-fat.xml | 2 +-
.../qemuxml2argv-disk-drive-fmt-qcow.xml | 2 +-
.../qemuxml2argv-disk-drive-network-nbd.xml | 2 +-
.../qemuxml2argv-disk-drive-network-rbd-auth.xml | 2 +-
...emuxml2argv-disk-drive-network-rbd-ceph-env.xml | 2 +-
.../qemuxml2argv-disk-drive-network-rbd.xml | 2 +-
.../qemuxml2argv-disk-drive-network-sheepdog.xml | 2 +-
.../qemuxml2argv-disk-drive-no-boot.xml | 2 +-
.../qemuxml2argv-disk-drive-readonly-disk.xml | 2 +-
.../qemuxml2argv-disk-drive-readonly-no-device.xml | 2 +-
.../qemuxml2argv-disk-drive-shared.xml | 2 +-
...qemuxml2argv-disk-floppy-tray-no-device-cap.xml | 2 +-
.../qemuxml2argv-disk-floppy-tray.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-floppy.xml | 2 +-
.../qemuxml2argv-disk-ide-drive-split.xml | 2 +-
.../qemuxml2argv-disk-ioeventfd.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-mirror.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-order.xml | 2 +-
.../qemuxml2argv-disk-sata-device.xml | 2 +-
.../qemuxml2argv-disk-scsi-device-auto.xml | 2 +-
.../qemuxml2argv-disk-scsi-device.xml | 2 +-
.../qemuxml2argv-disk-scsi-disk-split.xml | 2 +-
.../qemuxml2argv-disk-scsi-lun-passthrough.xml | 2 +-
.../qemuxml2argv-disk-scsi-virtio-scsi.xml | 2 +-
.../qemuxml2argv-disk-scsi-vscsi.xml | 2 +-
.../qemuxml2argv-disk-snapshot.xml | 2 +-
.../qemuxml2argv-disk-transient.xml | 2 +-
.../qemuxml2argv-disk-usb-device.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-usb.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-virtio.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-xenvbd.xml | 2 +-
.../qemuxml2argv-encrypted-disk.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml | 2 +-
.../qemuxml2argv-floppy-drive-fat.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-fs9p.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 +-
.../qemuxml2argv-graphics-spice-agentmouse.xml | 2 +-
.../qemuxml2argv-graphics-spice-compression.xml | 2 +-
.../qemuxml2argv-graphics-spice-qxl-vga.xml | 2 +-
.../qemuxml2argv-graphics-spice-timeout.xml | 2 +-
.../qemuxml2argv-graphics-spice.xml | 2 +-
.../qemuxml2argv-graphics-vnc-sasl.xml | 2 +-
.../qemuxml2argv-graphics-vnc-socket.xml | 2 +-
.../qemuxml2argv-graphics-vnc-tls.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml | 2 +-
.../qemuxml2argv-hostdev-pci-address-device.xml | 2 +-
.../qemuxml2argv-hostdev-pci-address.xml | 2 +-
.../qemuxml2argv-hostdev-usb-address-device.xml | 2 +-
.../qemuxml2argv-hostdev-usb-address.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml | 2 +-
.../qemuxml2argv-input-usbmouse-addr.xml | 2 +-
.../qemuxml2argv-input-usbmouse.xml | 2 +-
.../qemuxml2argv-input-usbtablet.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-lease.xml | 2 +-
.../qemuxml2argv-machine-aliases1.xml | 2 +-
.../qemuxml2argv-machine-aliases2.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-memtune.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-migrate.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml | 2 +-
.../qemuxml2argv-misc-no-reboot.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-monitor-json.xml | 2 +-
.../qemuxml2argv-multifunction-pci-device.xml | 2 +-
.../qemuxml2argv-net-bandwidth.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-net-client.xml | 2 +-
.../qemuxml2argv-net-eth-ifname.xml | 2 +-
.../qemuxml2argv-net-eth-names.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-net-eth.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-net-hostdev.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-net-mcast.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-net-server.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-net-user.xml | 2 +-
.../qemuxml2argv-net-virtio-device.xml | 2 +-
.../qemuxml2argv-net-virtio-netdev.xml | 2 +-
.../qemuxml2argv-net-virtio-network-portgroup.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-no-shutdown.xml | 2 +-
.../qemuxml2argv-nographics-vga.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-nographics.xml | 2 +-
...qemuxml2argv-numad-auto-memory-vcpu-cpuset.args | 4 +
.../qemuxml2argv-numad-auto-memory-vcpu-cpuset.xml | 31 ++++
...d-auto-memory-vcpu-no-cpuset-and-placement.args | 4 +
...ad-auto-memory-vcpu-no-cpuset-and-placement.xml | 31 ++++
.../qemuxml2argv-numad-auto-vcpu-no-numatune.xml | 29 ++++
...muxml2argv-numad-auto-vcpu-static-numatune.args | 4 +
...emuxml2argv-numad-auto-vcpu-static-numatune.xml | 31 ++++
...qemuxml2argv-numad-static-memory-auto-vcpu.args | 4 +
.../qemuxml2argv-numad-static-memory-auto-vcpu.xml | 31 ++++
.../qemuxml2argv-numad-static-vcpu-no-numatune.xml | 29 ++++
tests/qemuxml2argvdata/qemuxml2argv-numad.args | 4 +
tests/qemuxml2argvdata/qemuxml2argv-numad.xml | 31 ++++
.../qemuxml2argv-numatune-memory.xml | 2 +-
.../qemuxml2argv-parallel-tcp-chardev.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml | 2 +-
.../qemuxml2argv-pseries-basic.xml | 2 +-
.../qemuxml2argv-pseries-vio-address-clash.xml | 2 +-
.../qemuxml2argv-pseries-vio-user-assigned.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-pseries-vio.xml | 2 +-
.../qemuxml2argv-qemu-ns-no-env.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-qemu-ns.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-restore-v1.xml | 2 +-
.../qemuxml2argv-restore-v2-fd.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-restore-v2.xml | 2 +-
.../qemuxml2argv-serial-dev-chardev.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml | 2 +-
.../qemuxml2argv-serial-file-chardev.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-serial-file.xml | 2 +-
.../qemuxml2argv-serial-many-chardev.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-serial-many.xml | 2 +-
.../qemuxml2argv-serial-pty-chardev.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml | 2 +-
.../qemuxml2argv-serial-target-port-auto.xml | 2 +-
.../qemuxml2argv-serial-tcp-chardev.xml | 2 +-
.../qemuxml2argv-serial-tcp-telnet-chardev.xml | 2 +-
.../qemuxml2argv-serial-tcp-telnet.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml | 2 +-
.../qemuxml2argv-serial-udp-chardev.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml | 2 +-
.../qemuxml2argv-serial-unix-chardev.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-serial-unix.xml | 2 +-
.../qemuxml2argv-serial-vc-chardev.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml | 2 +-
.../qemuxml2argv-smartcard-controller.xml | 2 +-
.../qemuxml2argv-smartcard-host-certificates.xml | 2 +-
.../qemuxml2argv-smartcard-host.xml | 2 +-
...qemuxml2argv-smartcard-passthrough-spicevmc.xml | 2 +-
.../qemuxml2argv-smartcard-passthrough-tcp.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-smbios.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-smp.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-sound-device.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-sound.xml | 2 +-
.../qemuxml2argv-usb-controller.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-usb-hub.xml | 2 +-
.../qemuxml2argv-usb-ich9-companion.xml | 2 +-
.../qemuxml2argv-usb-ich9-ehci-addr.xml | 2 +-
.../qemuxml2argv-usb-piix3-controller.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-usb-ports.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-usb-redir.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-virtio-lun.xml | 2 +-
.../qemuxml2argv-watchdog-device.xml | 2 +-
.../qemuxml2argv-watchdog-dump.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-watchdog.xml | 2 +-
tests/qemuxml2argvtest.c | 5 +
.../qemuxml2xmlout-balloon-device-auto.xml | 2 +-
.../qemuxml2xmlout-console-compat-auto.xml | 2 +-
.../qemuxml2xmlout-disk-cdrom-empty.xml | 2 +-
.../qemuxml2xmlout-disk-mirror.xml | 2 +-
.../qemuxml2xmlout-disk-scsi-device-auto.xml | 2 +-
.../qemuxml2xmlout-graphics-listen-network2.xml | 2 +-
.../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +-
.../qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml | 2 +-
...emuxml2xmlout-numad-auto-memory-vcpu-cpuset.xml | 32 +++++
...ad-auto-memory-vcpu-no-cpuset-and-placement.xml | 32 +++++
.../qemuxml2xmlout-numad-auto-vcpu-no-numatune.xml | 32 +++++
...emuxml2xmlout-numad-static-vcpu-no-numatune.xml | 29 ++++
.../qemuxml2xmlout-serial-target-port-auto.xml | 2 +-
tests/qemuxml2xmltest.c | 4 +
tests/sexpr2xmldata/sexpr2xml-boot-grub.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-bridge-ipaddr.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-curmem.xml | 2 +-
.../sexpr2xml-disk-block-shareable.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-disk-block.xml | 2 +-
.../sexpr2xml-disk-drv-blktap-qcow.xml | 2 +-
.../sexpr2xml-disk-drv-blktap-raw.xml | 2 +-
.../sexpr2xml-disk-drv-blktap2-raw.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-disk-file.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml | 2 +-
.../sexpr2xml-fv-serial-dev-2-ports.xml | 2 +-
.../sexpr2xml-fv-serial-dev-2nd-port.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml | 2 +-
.../sexpr2xml-fv-serial-tcp-telnet.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-sound.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-utc.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-v2.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-net-bridged.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-net-e1000.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-net-routed.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-pci-devs.xml | 2 +-
.../sexpr2xml-pv-bootloader-cmdline.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-pv-bootloader.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-pv-localtime.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-pv-vcpus.xml | 2 +-
.../sexpr2xml-pv-vfb-new-vncdisplay.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml | 2 +-
.../sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-pv.xml | 2 +-
tests/vmx2xmldata/vmx2xml-annotation.xml | 2 +-
tests/vmx2xmldata/vmx2xml-case-insensitive-1.xml | 2 +-
tests/vmx2xmldata/vmx2xml-case-insensitive-2.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-1.xml | 2 +-
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml | 2 +-
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml | 2 +-
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml | 2 +-
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-5.xml | 2 +-
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-6.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ethernet-bridged.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ethernet-custom.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ethernet-generated.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ethernet-nat.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ethernet-other.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ethernet-static.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml | 2 +-
tests/vmx2xmldata/vmx2xml-floppy-device.xml | 2 +-
tests/vmx2xmldata/vmx2xml-floppy-file.xml | 2 +-
tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 2 +-
tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-1.xml | 2 +-
tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-2.xml | 2 +-
tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-3.xml | 2 +-
tests/vmx2xmldata/vmx2xml-gsx-in-the-wild-4.xml | 2 +-
tests/vmx2xmldata/vmx2xml-harddisk-ide-file.xml | 2 +-
tests/vmx2xmldata/vmx2xml-harddisk-scsi-file.xml | 2 +-
tests/vmx2xmldata/vmx2xml-minimal-64bit.xml | 2 +-
tests/vmx2xmldata/vmx2xml-minimal.xml | 2 +-
tests/vmx2xmldata/vmx2xml-parallel-device.xml | 2 +-
tests/vmx2xmldata/vmx2xml-parallel-file.xml | 2 +-
tests/vmx2xmldata/vmx2xml-scsi-driver.xml | 2 +-
tests/vmx2xmldata/vmx2xml-scsi-writethrough.xml | 2 +-
tests/vmx2xmldata/vmx2xml-serial-device.xml | 2 +-
tests/vmx2xmldata/vmx2xml-serial-file.xml | 2 +-
.../vmx2xmldata/vmx2xml-serial-network-client.xml | 2 +-
.../vmx2xmldata/vmx2xml-serial-network-server.xml | 2 +-
tests/vmx2xmldata/vmx2xml-serial-pipe.xml | 2 +-
tests/vmx2xmldata/vmx2xml-smbios.xml | 2 +-
tests/vmx2xmldata/vmx2xml-svga.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ws-in-the-wild-1.xml | 2 +-
tests/vmx2xmldata/vmx2xml-ws-in-the-wild-2.xml | 2 +-
tests/xmconfigdata/sexpr2xml-pv-bootloader.xml | 2 +-
tests/xmconfigdata/test-escape-paths.xml | 2 +-
tests/xmconfigdata/test-fullvirt-force-hpet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-force-nohpet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-localtime.xml | 2 +-
tests/xmconfigdata/test-fullvirt-net-ioemu.xml | 2 +-
tests/xmconfigdata/test-fullvirt-net-netfront.xml | 2 +-
tests/xmconfigdata/test-fullvirt-new-cdrom.xml | 2 +-
tests/xmconfigdata/test-fullvirt-old-cdrom.xml | 2 +-
tests/xmconfigdata/test-fullvirt-parallel-tcp.xml | 2 +-
.../test-fullvirt-serial-dev-2-ports.xml | 2 +-
.../test-fullvirt-serial-dev-2nd-port.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-file.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-null.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-pipe.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-pty.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-stdio.xml | 2 +-
.../test-fullvirt-serial-tcp-telnet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-tcp.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-udp.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-unix.xml | 2 +-
tests/xmconfigdata/test-fullvirt-sound.xml | 2 +-
tests/xmconfigdata/test-fullvirt-usbmouse.xml | 2 +-
.../test-fullvirt-usbtablet-no-bus.xml | 2 +-
tests/xmconfigdata/test-fullvirt-usbtablet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-utc.xml | 2 +-
tests/xmconfigdata/test-no-source-cdrom.xml | 2 +-
tests/xmconfigdata/test-paravirt-net-e1000.xml | 2 +-
tests/xmconfigdata/test-paravirt-net-vifname.xml | 2 +-
.../test-paravirt-new-pvfb-vncdisplay.xml | 2 +-
tests/xmconfigdata/test-paravirt-new-pvfb.xml | 2 +-
.../test-paravirt-old-pvfb-vncdisplay.xml | 2 +-
tests/xmconfigdata/test-paravirt-old-pvfb.xml | 2 +-
tests/xmconfigdata/test-paravirt-vcpu.xml | 2 +-
tests/xmconfigdata/test-pci-devs.xml | 2 +-
373 files changed, 941 insertions(+), 450 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-cpuset.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-cpuset.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-no-cpuset-and-placement.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad-auto-memory-vcpu-no-cpuset-and-placement.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad-auto-vcpu-no-numatune.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad-auto-vcpu-static-numatune.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad-auto-vcpu-static-numatune.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad-static-memory-auto-vcpu.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad-static-memory-auto-vcpu.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad-static-vcpu-no-numatune.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numad.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-memory-vcpu-cpuset.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-memory-vcpu-no-cpuset-and-placement.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-auto-vcpu-no-numatune.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-numad-static-vcpu-no-numatune.xml
--
1.7.7.3
12 years, 6 months
[libvirt] [PATCHv2] snapshot: allow block devices past cgroup
by Eric Blake
It turns out that when cgroups are enabled, the use of a block device
for a snapshot target was failing with EPERM due to libvirt failing
to add the block device to the cgroup whitelist. See also
https://bugzilla.redhat.com/show_bug.cgi?id=810200
* src/qemu/qemu_driver.c
(qemuDomainSnapshotCreateSingleDiskActive)
(qemuDomainSnapshotUndoSingleDiskActive): Account for cgroup.
(qemuDomainSnapshotCreateDiskActive): Update caller.
---
v2: fix resource leak on error path
See interdiff below the actual patch...
src/qemu/qemu_driver.c | 26 ++++++++++++++++++++++++--
1 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2bec617..92535b9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9895,6 +9895,7 @@ cleanup:
static int
qemuDomainSnapshotCreateSingleDiskActive(struct qemud_driver *driver,
virDomainObjPtr vm,
+ virCgroupPtr cgroup,
virDomainSnapshotDiskDefPtr snap,
virDomainDiskDefPtr disk,
virDomainDiskDefPtr persistDisk,
@@ -9948,8 +9949,15 @@ qemuDomainSnapshotCreateSingleDiskActive(struct qemud_driver *driver,
if (virDomainLockDiskAttach(driver->lockManager, vm, disk) < 0)
goto cleanup;
+ if (cgroup && qemuSetupDiskCgroup(driver, vm, cgroup, disk) < 0) {
+ if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0)
+ VIR_WARN("Unable to release lock on %s", source);
+ goto cleanup;
+ }
if (virSecurityManagerSetImageLabel(driver->securityManager, vm->def,
disk) < 0) {
+ if (cgroup && qemuTeardownDiskCgroup(driver, vm, cgroup, disk) < 0)
+ VIR_WARN("Failed to teardown cgroup for disk path %s", source);
if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0)
VIR_WARN("Unable to release lock on %s", source);
goto cleanup;
@@ -10009,6 +10017,7 @@ cleanup:
static void
qemuDomainSnapshotUndoSingleDiskActive(struct qemud_driver *driver,
virDomainObjPtr vm,
+ virCgroupPtr cgroup,
virDomainDiskDefPtr origdisk,
virDomainDiskDefPtr disk,
virDomainDiskDefPtr persistDisk,
@@ -10033,6 +10042,8 @@ qemuDomainSnapshotUndoSingleDiskActive(struct qemud_driver *driver,
if (virSecurityManagerRestoreImageLabel(driver->securityManager,
vm->def, disk) < 0)
VIR_WARN("Unable to restore security label on %s", disk->src);
+ if (cgroup && qemuTeardownDiskCgroup(driver, vm, cgroup, disk) < 0)
+ VIR_WARN("Failed to teardown cgroup for disk path %s", disk->src);
if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0)
VIR_WARN("Unable to release lock on %s", disk->src);
if (need_unlink && stat(disk->src, &st) == 0 &&
@@ -10084,6 +10095,7 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
int thaw = 0; /* 1 if freeze succeeded, -1 if freeze failed */
bool atomic = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC) != 0;
bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
+ virCgroupPtr cgroup = NULL;
if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
return -1;
@@ -10094,6 +10106,14 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
goto endjob;
}
+ if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES) &&
+ virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0)) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to find cgroup for %s"),
+ vm->def->name);
+ goto endjob;
+ }
+
/* If quiesce was requested, then issue a freeze command, and a
* counterpart thaw command, no matter what. The command will
* fail if the guest is paused or the guest agent is not
@@ -10156,7 +10176,7 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
}
}
- ret = qemuDomainSnapshotCreateSingleDiskActive(driver, vm,
+ ret = qemuDomainSnapshotCreateSingleDiskActive(driver, vm, cgroup,
&snap->def->disks[i],
vm->def->disks[i],
persistDisk, actions,
@@ -10184,7 +10204,7 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
persistDisk = vm->newDef->disks[indx];
}
- qemuDomainSnapshotUndoSingleDiskActive(driver, vm,
+ qemuDomainSnapshotUndoSingleDiskActive(driver, vm, cgroup,
snap->def->dom->disks[i],
vm->def->disks[i],
persistDisk,
@@ -10214,6 +10234,8 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
}
cleanup:
+ if (cgroup)
+ virCgroupFree(&cgroup);
if (resume && virDomainObjIsActive(vm)) {
if (qemuProcessStartCPUs(driver, vm, conn,
VIR_DOMAIN_RUNNING_UNPAUSED,
--
1.7.7.6
Interdiff from v1:
diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
index 92535b9..c9e047e 100644
--- i/src/qemu/qemu_driver.c
+++ w/src/qemu/qemu_driver.c
@@ -10113,6 +10113,7 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
vm->def->name);
goto endjob;
}
+ /* 'cgroup' is still NULL if cgroups are disabled. */
/* If quiesce was requested, then issue a freeze command, and a
* counterpart thaw command, no matter what. The command will
@@ -10234,8 +10235,6 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
}
cleanup:
- if (cgroup)
- virCgroupFree(&cgroup);
if (resume && virDomainObjIsActive(vm)) {
if (qemuProcessStartCPUs(driver, vm, conn,
VIR_DOMAIN_RUNNING_UNPAUSED,
@@ -10256,6 +10255,8 @@ cleanup:
}
endjob:
+ if (cgroup)
+ virCgroupFree(&cgroup);
if (vm && thaw != 0 &&
qemuDomainSnapshotFSThaw(driver, vm, thaw > 0) < 0) {
/* helper reported the error, if it was needed */
12 years, 6 months
[libvirt] [PATCH 1/2] domain_conf: add "usbredir" to list of valid spice channels
by Alon Levy
Add "usbredir" channel to list of recognized spice channels.
RHBZ: 819498
Signed-off-by: Alon Levy <alevy(a)redhat.com>
---
src/conf/domain_conf.c | 3 ++-
src/conf/domain_conf.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3fce7e5..10b023e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -428,7 +428,8 @@ VIR_ENUM_IMPL(virDomainGraphicsSpiceChannelName,
"cursor",
"playback",
"record",
- "smartcard");
+ "smartcard",
+ "usbredir");
VIR_ENUM_IMPL(virDomainGraphicsSpiceChannelMode,
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_LAST,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 5aa8fc1..6581fea 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1097,6 +1097,7 @@ enum virDomainGraphicsSpiceChannelName {
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_PLAYBACK,
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_RECORD,
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_SMARTCARD,
+ VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_USBREDIR,
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST
};
--
1.7.10.1
12 years, 6 months
[libvirt] [PATCH] snapshot: allow block devices past cgroup
by Eric Blake
It turns out that when cgroups are enabled, the use of a block device
for a snapshot target was failing with EPERM due to libvirt failing
to add the block device to the cgroup whitelist. See also
https://bugzilla.redhat.com/show_bug.cgi?id=810200
* src/qemu/qemu_driver.c
(qemuDomainSnapshotCreateSingleDiskActive)
(qemuDomainSnapshotUndoSingleDiskActive): Account for cgroup.
(qemuDomainSnapshotCreateDiskActive): Update caller.
---
I still need to properly test this, but based on how disk hotplug
works, I think this should solve the problem at hand.
My recent patch series for virDomainBlockRebase needs the same
treatment; I'll do that as a separate patch.
This still does not address the fact that block pull should be
revoking rights to a backing file that is no longer in use; that
will require more infrastructure for libvirt properly tracking an
entire backing chain.
src/qemu/qemu_driver.c | 26 ++++++++++++++++++++++++--
1 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2bec617..92535b9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9895,6 +9895,7 @@ cleanup:
static int
qemuDomainSnapshotCreateSingleDiskActive(struct qemud_driver *driver,
virDomainObjPtr vm,
+ virCgroupPtr cgroup,
virDomainSnapshotDiskDefPtr snap,
virDomainDiskDefPtr disk,
virDomainDiskDefPtr persistDisk,
@@ -9948,8 +9949,15 @@ qemuDomainSnapshotCreateSingleDiskActive(struct qemud_driver *driver,
if (virDomainLockDiskAttach(driver->lockManager, vm, disk) < 0)
goto cleanup;
+ if (cgroup && qemuSetupDiskCgroup(driver, vm, cgroup, disk) < 0) {
+ if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0)
+ VIR_WARN("Unable to release lock on %s", source);
+ goto cleanup;
+ }
if (virSecurityManagerSetImageLabel(driver->securityManager, vm->def,
disk) < 0) {
+ if (cgroup && qemuTeardownDiskCgroup(driver, vm, cgroup, disk) < 0)
+ VIR_WARN("Failed to teardown cgroup for disk path %s", source);
if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0)
VIR_WARN("Unable to release lock on %s", source);
goto cleanup;
@@ -10009,6 +10017,7 @@ cleanup:
static void
qemuDomainSnapshotUndoSingleDiskActive(struct qemud_driver *driver,
virDomainObjPtr vm,
+ virCgroupPtr cgroup,
virDomainDiskDefPtr origdisk,
virDomainDiskDefPtr disk,
virDomainDiskDefPtr persistDisk,
@@ -10033,6 +10042,8 @@ qemuDomainSnapshotUndoSingleDiskActive(struct qemud_driver *driver,
if (virSecurityManagerRestoreImageLabel(driver->securityManager,
vm->def, disk) < 0)
VIR_WARN("Unable to restore security label on %s", disk->src);
+ if (cgroup && qemuTeardownDiskCgroup(driver, vm, cgroup, disk) < 0)
+ VIR_WARN("Failed to teardown cgroup for disk path %s", disk->src);
if (virDomainLockDiskDetach(driver->lockManager, vm, disk) < 0)
VIR_WARN("Unable to release lock on %s", disk->src);
if (need_unlink && stat(disk->src, &st) == 0 &&
@@ -10084,6 +10095,7 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
int thaw = 0; /* 1 if freeze succeeded, -1 if freeze failed */
bool atomic = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC) != 0;
bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0;
+ virCgroupPtr cgroup = NULL;
if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
return -1;
@@ -10094,6 +10106,14 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
goto endjob;
}
+ if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES) &&
+ virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0)) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to find cgroup for %s"),
+ vm->def->name);
+ goto endjob;
+ }
+
/* If quiesce was requested, then issue a freeze command, and a
* counterpart thaw command, no matter what. The command will
* fail if the guest is paused or the guest agent is not
@@ -10156,7 +10176,7 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
}
}
- ret = qemuDomainSnapshotCreateSingleDiskActive(driver, vm,
+ ret = qemuDomainSnapshotCreateSingleDiskActive(driver, vm, cgroup,
&snap->def->disks[i],
vm->def->disks[i],
persistDisk, actions,
@@ -10184,7 +10204,7 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
persistDisk = vm->newDef->disks[indx];
}
- qemuDomainSnapshotUndoSingleDiskActive(driver, vm,
+ qemuDomainSnapshotUndoSingleDiskActive(driver, vm, cgroup,
snap->def->dom->disks[i],
vm->def->disks[i],
persistDisk,
@@ -10214,6 +10234,8 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn,
}
cleanup:
+ if (cgroup)
+ virCgroupFree(&cgroup);
if (resume && virDomainObjIsActive(vm)) {
if (qemuProcessStartCPUs(driver, vm, conn,
VIR_DOMAIN_RUNNING_UNPAUSED,
--
1.7.7.6
12 years, 6 months
[libvirt] [PATCH] tests: add some self-documentation to tests
by Eric Blake
Alon Levy mentioned on IRC that he tried './qemuxml2argvtest --help'
to figure out how to find which test was failing, but it didn't help.
The information is in HACKING, but it doesn't help to make the tests
also provide their own help.
* tests/testutils.c (virtTestMain): Mention debug trick.
---
tests/testutils.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tests/testutils.c b/tests/testutils.c
index 4e8484f..b1ba94f 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -577,7 +577,7 @@ int virtTestMain(int argc,
progname += 2;
if (argc > 1) {
fprintf(stderr, "Usage: %s\n", argv[0]);
+ fputs("Use VIR_TEST_DEBUG=1 in environment for a verbose run\n", stderr);
return EXIT_FAILURE;
}
fprintf(stderr, "TEST: %s\n", progname);
--
1.7.7.6
12 years, 6 months
[libvirt] [PATCH libvirt 1/3] build: do not build shunloadtest if pthread missing
by Marc-André Lureau
Fixes build on Windows systems
---
configure.ac | 2 ++
tests/Makefile.am | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 89fe818..347c48c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -154,6 +154,8 @@ AC_CHECK_FUNC([clock_gettime],[
LIBS=$old_libs
AC_SUBST(RT_LIBS)
+AM_CONDITIONAL([HAVE_PTHREAD], [test x"$HAVE_PTHREAD_H" = x"1"])
+
dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/un.h \
sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c4d550f..3d9235c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -98,7 +98,7 @@ test_programs = virshtest sockettest \
nodeinfotest virbuftest \
commandtest seclabeltest \
virhashtest virnetmessagetest virnetsockettest \
- utiltest virnettlscontexttest shunloadtest \
+ utiltest virnettlscontexttest \
virtimetest viruritest virkeyfiletest \
virauthconfigtest
@@ -106,6 +106,10 @@ test_programs = virshtest sockettest \
ssh_SOURCES = ssh.c
ssh_LDADD = $(COVERAGE_LDFLAGS)
+if HAVE_PTHREAD
+test_programs += shunloadtest
+endif
+
if WITH_XEN
test_programs += xml2sexprtest sexpr2xmltest \
xmconfigtest xencapstest statstest reconnect
@@ -527,10 +531,12 @@ libshunload_la_SOURCES = shunloadhelper.c
libshunload_la_LIBADD = ../src/libvirt.la
libshunload_la_LDFLAGS = -module -avoid-version -rpath /evil/libtool/hack/to/force/shared/lib/creation
+if HAVE_PTHREAD
shunloadtest_SOURCES = \
shunloadtest.c
shunloadtest_LDADD = -lpthread
shunloadtest_DEPENDENCIES = libshunload.la
+endif
if WITH_CIL
CILOPTFLAGS =
--
1.7.10
12 years, 6 months
[libvirt] [PATCH] [libvirt-test-API] Add "machine" option to supprot choose machine type in more architectures
by Lin Qing
1.With machine option,user can specify macine type to emulate.
For example : define in xml file , machine='pc' or machine='pseries'.
2.Fix some indent issue in ksiso.sh.
Signed-off-by: Qing Lin<qinglbj(a)linux.vnet.ibm.com>
---
cases/consumption_cpu_topology.conf | 2 +
cases/consumption_domain_nfs_start.conf | 2 +
cases/consumption_eventhandler.conf | 2 +
cases/consumption_libvirtd.conf | 2 +
cases/consumption_ownership_test.conf | 2 +
cases/domain_linux_net_inst.conf | 2 +
cases/linux_domain.conf | 6 ++
cases/snapshot.conf | 2 +
cases/windows_domain.conf | 4 ++
global.cfg | 2 +
repos/domain/create.py | 2 +-
repos/domain/define.py | 2 +-
repos/domain/install_linux_cdrom.py | 2 +-
repos/domain/install_linux_net.py | 2 +-
repos/domain/install_windows_cdrom.py | 2 +-
repos/domain/xmls/kvm_guest_define.xml | 2 +-
.../domain/xmls/kvm_linux_guest_install_cdrom.xml | 2 +-
repos/domain/xmls/kvm_linux_guest_install_net.xml | 2 +-
.../xmls/kvm_windows_guest_install_cdrom.xml | 2 +-
.../multiple_thread_block_on_domain_create.py | 2 +-
repos/regression/xmls/domain.xml | 2 +-
utils/ksiso.sh | 51 ++++++++++---------
22 files changed, 64 insertions(+), 35 deletions(-)
diff --git a/cases/consumption_cpu_topology.conf b/cases/consumption_cpu_topology.conf
index c02ef2a..3849808 100644
--- a/cases/consumption_cpu_topology.conf
+++ b/cases/consumption_cpu_topology.conf
@@ -5,6 +5,8 @@ domain:install_linux_cdrom
$defaultos
guestarch
$defaultarch
+ guestmachine
+ $defaultmachine
vcpu
$defaultvcpu
memory
diff --git a/cases/consumption_domain_nfs_start.conf b/cases/consumption_domain_nfs_start.conf
index 13b2449..3d70764 100644
--- a/cases/consumption_domain_nfs_start.conf
+++ b/cases/consumption_domain_nfs_start.conf
@@ -5,6 +5,8 @@ domain:install_linux_cdrom
$defaultos
guestarch
$defaultarch
+ guestmachine
+ $defaultmachine
vcpu
$defaultvcpu
memory
diff --git a/cases/consumption_eventhandler.conf b/cases/consumption_eventhandler.conf
index 07bee07..6843dc9 100644
--- a/cases/consumption_eventhandler.conf
+++ b/cases/consumption_eventhandler.conf
@@ -5,6 +5,8 @@ domain:install_linux_cdrom
$defaultos
guestarch
$defaultarch
+ guestmachine
+ $defaultmachine
vcpu
$defaultvcpu
memory
diff --git a/cases/consumption_libvirtd.conf b/cases/consumption_libvirtd.conf
index b0dfff9..6012e99 100644
--- a/cases/consumption_libvirtd.conf
+++ b/cases/consumption_libvirtd.conf
@@ -5,6 +5,8 @@ domain:install_linux_cdrom
$defaultos
guestarch
$defaultarch
+ guestmachine
+ $defaultmachine
vcpu
$defaultvcpu
memory
diff --git a/cases/consumption_ownership_test.conf b/cases/consumption_ownership_test.conf
index a906b39..ead4002 100644
--- a/cases/consumption_ownership_test.conf
+++ b/cases/consumption_ownership_test.conf
@@ -5,6 +5,8 @@ domain:install_linux_cdrom
$defaultos
guestarch
$defaultarch
+ guestmachine
+ $defaultmachine
vcpu
$defaultvcpu
memory
diff --git a/cases/domain_linux_net_inst.conf b/cases/domain_linux_net_inst.conf
index 7c97818..e2fb55c 100644
--- a/cases/domain_linux_net_inst.conf
+++ b/cases/domain_linux_net_inst.conf
@@ -5,6 +5,8 @@ domain:install_linux_net
$defaultos
guestarch
$defaultarch
+ guestmachine
+ $defaultmachine
netmethod
http
vcpu
diff --git a/cases/linux_domain.conf b/cases/linux_domain.conf
index e7d6bac..5296212 100644
--- a/cases/linux_domain.conf
+++ b/cases/linux_domain.conf
@@ -5,6 +5,8 @@ domain:install_linux_cdrom
$defaultos
guestarch
$defaultarch
+ guestmachine
+ $defaultmachine
vcpu
$defaultvcpu
memory
@@ -45,6 +47,10 @@ domain:undefine
domain:define
guestname
$defaultname
+ guestarch
+ $defaultarch
+ guestmachine
+ $defaultmachine
diskpath
/var/lib/libvirt/images/libvirt-test-api
vcpu
diff --git a/cases/snapshot.conf b/cases/snapshot.conf
index 4aac68b..d957310 100644
--- a/cases/snapshot.conf
+++ b/cases/snapshot.conf
@@ -5,6 +5,8 @@ domain:install_linux_cdrom
$defaultos
guestarch
$defaultarch
+ guestmachine
+ $defaultmachine
vcpu
$defaultvcpu
memory
diff --git a/cases/windows_domain.conf b/cases/windows_domain.conf
index 68396a0..e89cdd6 100644
--- a/cases/windows_domain.conf
+++ b/cases/windows_domain.conf
@@ -33,6 +33,10 @@ domain:undefine
domain:define
guestname
$defaultname
+ guestarch
+ $defaultarch
+ guestmachine
+ $defaultmachine
virt_type
$defaulthv
diff --git a/global.cfg b/global.cfg
index 9e28614..d4d78b9 100644
--- a/global.cfg
+++ b/global.cfg
@@ -130,6 +130,8 @@ defaultname = libvirt_test_api
defaultos = rhel6u2
# default architecture to use for installing a new guest
defaultarch = x86_64
+# default machine type to use for installing a new guest
+defaultmachine = pc
# default the number of vcpu to use for defining or installing a guest
defaultvcpu = 1
# default the memory size(kilobytes) to use for defining or installing a guest
diff --git a/repos/domain/create.py b/repos/domain/create.py
index cfe0efd..b181066 100644
--- a/repos/domain/create.py
+++ b/repos/domain/create.py
@@ -15,7 +15,7 @@ from utils import utils
NONE = 0
START_PAUSED = 1
-required_params = ('guestname', 'diskpath',)
+required_params = ('guestname', 'guestarch', 'guestmachine', 'diskpath',)
optional_params = {'memory': 1048576,
'vcpu': 1,
'hddriver' : 'virtio',
diff --git a/repos/domain/define.py b/repos/domain/define.py
index 42dea86..8018d80 100644
--- a/repos/domain/define.py
+++ b/repos/domain/define.py
@@ -13,7 +13,7 @@ from libvirt import libvirtError
from src import sharedmod
from utils import utils
-required_params = ('guestname', 'diskpath',)
+required_params = ('guestname', 'guestarch', 'guestmachine', 'diskpath',)
optional_params = {'memory': 1048576,
'vcpu': 1,
'hddriver' : 'virtio',
diff --git a/repos/domain/install_linux_cdrom.py b/repos/domain/install_linux_cdrom.py
index 9bbd6da..9c02eb2 100644
--- a/repos/domain/install_linux_cdrom.py
+++ b/repos/domain/install_linux_cdrom.py
@@ -16,7 +16,7 @@ from src import sharedmod
from src import env_parser
from utils import utils
-required_params = ('guestname', 'guestos', 'guestarch',)
+required_params = ('guestname', 'guestos', 'guestarch', 'guestmachine',)
optional_params = {
'memory': 1048576,
'vcpu': 1,
diff --git a/repos/domain/install_linux_net.py b/repos/domain/install_linux_net.py
index d976ce1..33fc60c 100644
--- a/repos/domain/install_linux_net.py
+++ b/repos/domain/install_linux_net.py
@@ -16,7 +16,7 @@ from src import sharedmod
from src import env_parser
from utils import utils
-required_params = ('guestname', 'guestos', 'guestarch',)
+required_params = ('guestname', 'guestos', 'guestarch', 'guestmachine',)
optional_params = {'memory': 1048576,
'vcpu': 1,
'disksize' : 10,
diff --git a/repos/domain/install_windows_cdrom.py b/repos/domain/install_windows_cdrom.py
index 3104bcd..ba0a503 100644
--- a/repos/domain/install_windows_cdrom.py
+++ b/repos/domain/install_windows_cdrom.py
@@ -24,7 +24,7 @@ VM_UNDEFINE = "virsh undefine %s"
FLOOPY_IMG = "/tmp/floppy.img"
HOME_PATH = os.getcwd()
-required_params = ('guestname', 'guestos', 'guestarch',)
+required_params = ('guestname', 'guestos', 'guestarch', 'guestmachine',)
optional_params = {'memory': 1048576,
'vcpu': 1,
'disksize' : 20,
diff --git a/repos/domain/xmls/kvm_guest_define.xml b/repos/domain/xmls/kvm_guest_define.xml
index 385ec66..ae533c2 100644
--- a/repos/domain/xmls/kvm_guest_define.xml
+++ b/repos/domain/xmls/kvm_guest_define.xml
@@ -5,7 +5,7 @@
<currentMemory unit='KiB'>MEMORY</currentMemory>
<vcpu>VCPU</vcpu>
<os>
-<type arch='x86_64' machine='pc-0.14'>hvm</type>
+<type arch="GUESTARCH" machine="GUESTMACHINE">hvm</type>
<boot dev='hd'/>
</os>
<features>
diff --git a/repos/domain/xmls/kvm_linux_guest_install_cdrom.xml b/repos/domain/xmls/kvm_linux_guest_install_cdrom.xml
index 84aed75..cb59e76 100644
--- a/repos/domain/xmls/kvm_linux_guest_install_cdrom.xml
+++ b/repos/domain/xmls/kvm_linux_guest_install_cdrom.xml
@@ -4,7 +4,7 @@
<memory>MEMORY</memory>
<vcpu>VCPU</vcpu>
<os>
-<type>hvm</type>
+<type machine="GUESTMACHINE">hvm</type>
<boot dev="cdrom"/>
</os>
<features>
diff --git a/repos/domain/xmls/kvm_linux_guest_install_net.xml b/repos/domain/xmls/kvm_linux_guest_install_net.xml
index 7d5cb45..c4a7de7 100644
--- a/repos/domain/xmls/kvm_linux_guest_install_net.xml
+++ b/repos/domain/xmls/kvm_linux_guest_install_net.xml
@@ -3,7 +3,7 @@
<memory>MEMORY</memory>
<vcpu>VCPU</vcpu>
<os>
-<type>hvm</type>
+<type machine="GUESTMACHINE">hvm</type>
<kernel>KERNEL</kernel>
<initrd>INITRD</initrd>
<cmdline>ks=KS</cmdline>
diff --git a/repos/domain/xmls/kvm_windows_guest_install_cdrom.xml b/repos/domain/xmls/kvm_windows_guest_install_cdrom.xml
index 759a386..62bd002 100644
--- a/repos/domain/xmls/kvm_windows_guest_install_cdrom.xml
+++ b/repos/domain/xmls/kvm_windows_guest_install_cdrom.xml
@@ -4,7 +4,7 @@
<memory>MEMORY</memory>
<vcpu>VCPU</vcpu>
<os>
-<type>hvm</type>
+<type machine="GUESTMACHINE">hvm</type>
<boot dev="cdrom"/>
</os>
<features>
diff --git a/repos/regression/multiple_thread_block_on_domain_create.py b/repos/regression/multiple_thread_block_on_domain_create.py
index 571621f..b19951f 100644
--- a/repos/regression/multiple_thread_block_on_domain_create.py
+++ b/repos/regression/multiple_thread_block_on_domain_create.py
@@ -17,7 +17,7 @@ from src import sharedmod
from utils import utils
from src import env_parser
-required_params = ('guestos', 'guestarch', 'guestnum', 'uri')
+required_params = ('guestos', 'guestarch', 'guestmachine', 'guestnum', 'uri')
optional_params = {'xml' : 'xmls/domain.xml',
}
diff --git a/repos/regression/xmls/domain.xml b/repos/regression/xmls/domain.xml
index 407f086..e70492d 100644
--- a/repos/regression/xmls/domain.xml
+++ b/repos/regression/xmls/domain.xml
@@ -3,7 +3,7 @@
<memory>1048576</memory>
<vcpu>1</vcpu>
<os>
-<type>hvm</type>
+<type machine="GUESTMACHINE">hvm</type>
<kernel>/var/lib/libvirt/boot/vmlinuz</kernel>
<initrd>/var/lib/libvirt/boot/initrd.img</initrd>
<cmdline>KS</cmdline>
diff --git a/utils/ksiso.sh b/utils/ksiso.sh
index a431658..8cb3540 100755
--- a/utils/ksiso.sh
+++ b/utils/ksiso.sh
@@ -26,37 +26,40 @@ umount $boot_iso_dir
vlmid=`isoinfo -d -i $boot_iso |grep 'Volume id:'`
vlmid=${vlmid#"Volume id: "}
if [ -n "`echo $vlmid|grep ppc`" ];then
- echo "- edit yaboot.conf and add kickstart entry"
- WORKING_ISO="${custom_iso_dir}/etc/yaboot.conf"
- # change timeout and add kickstart entry
- TIMEOUT_LINE=`cat $WORKING_ISO | grep timeout | head -1`
- APPEND_LINE=`cat $WORKING_ISO | grep append | head -1`
- cat $WORKING_ISO | sed "s#${TIMEOUT_LINE}#timeout=5#" | sed "s#${APPEND_LINE}#append= \"root=live:CDLABEL=$vlmid ks=cdrom:/$kscfg \"#"> isocfgtmp
- mv -f isocfgtmp $WORKING_ISO
- cd $custom_iso_dir
- mkisofs -R -V "$vlmid" -sysid PPC -chrp-boot -U -prep-boot ppc/chrp/yaboot -hfs-bless ppc/mac -no-desktop -allow-multidot -volset 4 -volset-size 1 -volset-seqno 1 -hfs-volid 4 -o $cwd/$custom_iso .
+ echo "- copy kickstart to custom work directory"
+ cp $kscfg $custom_iso_dir
+
+ echo "- edit yaboot.conf and add kickstart entry"
+ WORKING_ISO="${custom_iso_dir}/etc/yaboot.conf"
+ # change timeout and add kickstart entry
+ TIMEOUT_LINE=`cat $WORKING_ISO | grep timeout | head -1`
+ APPEND_LINE=`cat $WORKING_ISO | grep append | head -1`
+ cat $WORKING_ISO | sed "s#${TIMEOUT_LINE}#timeout=5#" | sed "s#${APPEND_LINE}#append= \"root=live:CDLABEL=$vlmid ks=cdrom:/$kscfg \"#"> isocfgtmp
+ mv -f isocfgtmp $WORKING_ISO
+ cd $custom_iso_dir
+ mkisofs -R -V "$vlmid" -sysid PPC -chrp-boot -U -prep-boot ppc/chrp/yaboot -hfs-bless ppc/mac -no-desktop -allow-multidot -volset 4 -volset-size 1 -volset-seqno 1 -hfs-volid 4 -o $cwd/$custom_iso .
else
- echo "- copy kickstart to custom work directory"
- cp $kscfg $custom_iso_dir
+ echo "- copy kickstart to custom work directory"
+ cp $kscfg $custom_iso_dir
- echo "- edit isolinux.cfg and add kickstart entry"
- WORKING_ISO="${custom_iso_dir}/isolinux/isolinux.cfg"
+ echo "- edit isolinux.cfg and add kickstart entry"
+ WORKING_ISO="${custom_iso_dir}/isolinux/isolinux.cfg"
- echo "label custom_ks
- kernel vmlinuz $kernel_args
- append initrd=initrd.img ks=cdrom:/$kscfg ramdisk_size=20000">> $WORKING_ISO
+ echo "label custom_ks
+ kernel vmlinuz $kernel_args
+ append initrd=initrd.img ks=cdrom:/$kscfg ramdisk_size=20000">> $WORKING_ISO
- # change default boot target and timeout
- DEFAULT_LINE=`cat $WORKING_ISO | grep default | head -1`
- TIMEOUT_LINE=`cat $WORKING_ISO | grep timeout | head -1`
+ # change default boot target and timeout
+ DEFAULT_LINE=`cat $WORKING_ISO | grep default | head -1`
+ TIMEOUT_LINE=`cat $WORKING_ISO | grep timeout | head -1`
- cat $WORKING_ISO | sed "s/${DEFAULT_LINE}/default custom_ks/" | sed "s/${TIMEOUT_LINE}/timeout 5/"> isocfgtmp
+ cat $WORKING_ISO | sed "s/${DEFAULT_LINE}/default custom_ks/" | sed "s/${TIMEOUT_LINE}/timeout 5/"> isocfgtmp
- mv -f isocfgtmp $WORKING_ISO
+ mv -f isocfgtmp $WORKING_ISO
- # cd to custom_iso_dir, otherwise mkisofs seems to bomb...
- cd $custom_iso_dir
- mkisofs -R -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -o $cwd/$custom_iso .
+ # cd to custom_iso_dir, otherwise mkisofs seems to bomb...
+ cd $custom_iso_dir
+ mkisofs -R -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -o $cwd/$custom_iso .
fi
EXITVAL=$?
if [ $EXITVAL -ne '0' ] ; then
-- 1.7.4.1
12 years, 6 months
[libvirt] [Patch] Libvirt - Fix locking for readonly devices
by David Weber
Hi,
I'm currently working on getting sanlock into Debian/Ubuntu.
While testing, I noticed that I wasn't able to add a readonly
or shared device: "internal error unsupported
configuration: Readonly leases are not supported".
After looking into the source, it seems to be the following
situation:
- Libvirt passes every device to the sanlock plugin, even if
it is readonly
- The sanlock plugin rejects to add a lease for the readonly
device, returning an error so the machine starts to fail
The attached patch rejects passing readonly and shared devices
to the lock-plugin so they shouldn't be a problem anymore.
Would this be an appropriated way to fix this problem? (I'm
neither experienced in libvirt nor C)
What seems odd to me is that Fedora either doesn't hit this
or nobody has ever reported it.
I'm not member of this list so please CC me.
Thanks!
Cheers,
David
-----------------------------------------
diff --git a/src/locking/domain_lock.c b/src/locking/domain_lock.c
index de1937c..45617e6 100644
--- a/src/locking/domain_lock.c
+++ b/src/locking/domain_lock.c
@@ -79,9 +79,9 @@ static int virDomainLockManagerAddDisk(virLockManagerPtr lock,
return 0;
if (disk->readonly)
- diskFlags |= VIR_LOCK_MANAGER_RESOURCE_READONLY;
+ return 0;
if (disk->shared)
- diskFlags |= VIR_LOCK_MANAGER_RESOURCE_SHARED;
+ return 0;
VIR_DEBUG("Add disk %s", disk->src);
if (virLockManagerAddResource(lock,
12 years, 6 months