[libvirt] [PATCH] cpu_map.xml: Expose svm flag for nested kvm on AMD CPU model
by Lin Ma
QEMU commit 75d373e disables svm by default since PC machine 2.2.
So with PC machine version > 2.1, When a user wants to expose the
svm flag to a guest, says:
......
<feature policy='require' name='svm'/>
......
The svm flag wont be passed to qemu command line, This patch fixes it.
Signed-off-by: Lin Ma <lma(a)suse.com>
---
src/cpu/cpu_map.xml | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
index 0b6d424..8f96843 100644
--- a/src/cpu/cpu_map.xml
+++ b/src/cpu/cpu_map.xml
@@ -686,7 +686,6 @@
<feature name='sep'/>
<feature name='sse'/>
<feature name='sse2'/>
- <feature name='svm'/>
<feature name='syscall'/>
<feature name='tsc'/>
</model>
@@ -1195,7 +1194,6 @@
<feature name='sep'/>
<feature name='sse'/>
<feature name='sse2'/>
- <feature name='svm'/>
<feature name='syscall'/>
<feature name='tsc'/>
</model>
@@ -1257,7 +1255,6 @@
<feature name='sep'/>
<feature name='sse'/>
<feature name='sse2'/>
- <feature name='svm'/>
<feature name='syscall'/>
<feature name='tsc'/>
</model>
@@ -1295,7 +1292,6 @@
<feature name='sse'/>
<feature name='sse2'/>
<feature name='sse4a'/>
- <feature name='svm'/>
<feature name='syscall'/>
<feature name='tsc'/>
</model>
@@ -1341,7 +1337,6 @@
<feature name='sse4.2'/>
<feature name='sse4a'/>
<feature name='ssse3'/>
- <feature name='svm'/>
<feature name='syscall'/>
<feature name='tsc'/>
<feature name='xop'/>
@@ -1391,7 +1386,6 @@
<feature name='sse4.2'/>
<feature name='sse4a'/>
<feature name='ssse3'/>
- <feature name='svm'/>
<feature name='syscall'/>
<feature name='tbm'/>
<feature name='tsc'/>
--
2.1.4
8 years, 11 months
[libvirt] [PATCH 00/16] Xen: remove xend config version
by Jim Fehlig
Hi All,
Ian Campbell recently attempted [1] to fix and issue around MAX_VIRT_VPUS
on ARM that required adding a new XEND_CONFIG_VERSION. After some
discussion [2] we decided to drop support for all of the old xend config
versions and go with the version supported in Xen 4.0, since the xl syntax
was originally based on (and intended to be compatible with) xm circa that
point in time.
This series removes all traces of xend config version from the codebase,
essentially removing support for Xen 3.x. Hopefully I succeeding in making
the rather large series reviewable. The series is also available on the
remove-xend-config-version branch of my libvirt github clone [2].
[1] https://www.redhat.com/archives/libvir-list/2015-November/msg01153.html
[2] https://www.redhat.com/archives/libvir-list/2015-December/msg00148.html
[3] https://github.com/jfehlig/libvirt/tree/remove-xend-config-version
Jim Fehlig (16):
Xen: tests: remove old xm config tests
Xen: tests: remove net-ioemu xm config test
Xen: tests: remove old sexpr2xml tests
Xen: tests: remove old xml2sexpr tests
Xen: tests: use latest XEND_CONFIG_VERSION in xm/xl tests
Xen: xenconfig: remove XEND_CONFIG_VERSION in common code
Xen: xenconfig: remove use of XEND_CONFIG_VERSION in xen_xm
Xen: xenconfig: remove xendConfigVersion from public functions
Xen: tests: use latest XEND_CONFIG_VERSION in sexpr2xml tests
Xen: xenconfig: remove disks from '(image)' sexpr
Xen: tests: use latest XEND_CONFIG_VERSION in xml2sexpr tests
Xen: xenconfig: remove use of XEND_CONFIG_VERSION in xen_sxpr
Xen: xen_driver: remove use of XEND_CONFIG_VERSION
Xen: xend: remove use of XEND_CONFIG_VERSION
Xen: xenconfig: remove xendConfigVersion from public sexpr functions
Xen: remove xendConfigVersion from driver private struct
src/libxl/libxl_driver.c | 9 +-
src/xen/xen_driver.c | 296 ++++-----------
src/xen/xen_driver.h | 2 -
src/xen/xend_internal.c | 224 ++---------
src/xen/xm_internal.c | 9 +-
src/xenconfig/xen_common.c | 211 ++++-------
src/xenconfig/xen_common.h | 7 +-
src/xenconfig/xen_sxpr.c | 411 ++++++---------------
src/xenconfig/xen_sxpr.h | 21 +-
src/xenconfig/xen_xl.c | 9 +-
src/xenconfig/xen_xl.h | 7 +-
src/xenconfig/xen_xm.c | 57 +--
src/xenconfig/xen_xm.h | 5 +-
src/xenconfig/xenxs_private.h | 8 -
tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml | 2 +-
.../sexpr2xmldata/sexpr2xml-fv-empty-kernel.sexpr | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.sexpr | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml | 4 +-
.../sexpr2xmldata/sexpr2xml-fv-force-nohpet.sexpr | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv-localtime.sexpr | 3 +-
tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.sexpr | 9 -
tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml | 48 ---
.../sexpr2xmldata/sexpr2xml-fv-net-netfront.sexpr | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml | 4 +-
.../sexpr2xmldata/sexpr2xml-fv-parallel-tcp.sexpr | 3 +-
tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml | 4 +-
.../sexpr2xml-fv-serial-dev-2-ports.sexpr | 5 +-
.../sexpr2xml-fv-serial-dev-2-ports.xml | 4 +-
.../sexpr2xml-fv-serial-dev-2nd-port.sexpr | 4 +-
.../sexpr2xml-fv-serial-dev-2nd-port.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-file.sexpr | 7 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-null.sexpr | 3 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.sexpr | 7 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.sexpr | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml | 4 +-
.../sexpr2xmldata/sexpr2xml-fv-serial-stdio.sexpr | 3 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml | 4 +-
.../sexpr2xml-fv-serial-tcp-telnet.sexpr | 3 +-
.../sexpr2xml-fv-serial-tcp-telnet.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.sexpr | 3 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.sexpr | 3 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.sexpr | 3 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-sound-all.sexpr | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-sound.sexpr | 3 +-
tests/sexpr2xmldata/sexpr2xml-fv-sound.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.sexpr | 3 +-
tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.sexpr | 3 +-
tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-utc.sexpr | 2 +
tests/sexpr2xmldata/sexpr2xml-fv-utc.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-v2.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-fv.sexpr | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.sexpr | 9 -
tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml | 34 --
tests/sexpr2xmltest.c | 130 ++++---
.../test-fullvirt-direct-kernel-boot.cfg | 3 +-
.../test-fullvirt-direct-kernel-boot.xml | 2 +-
tests/xlconfigdata/test-fullvirt-multiusb.cfg | 3 +-
tests/xlconfigdata/test-fullvirt-multiusb.xml | 2 +-
tests/xlconfigdata/test-new-disk.cfg | 3 +-
tests/xlconfigdata/test-new-disk.xml | 2 +-
tests/xlconfigdata/test-spice-features.cfg | 3 +-
tests/xlconfigdata/test-spice-features.xml | 2 +-
tests/xlconfigdata/test-spice.cfg | 3 +-
tests/xlconfigdata/test-spice.xml | 2 +-
tests/xlconfigtest.c | 29 +-
tests/xmconfigdata/test-escape-paths.cfg | 5 +-
tests/xmconfigdata/test-escape-paths.xml | 2 +-
.../xmconfigdata/test-fullvirt-default-feature.cfg | 5 +-
.../xmconfigdata/test-fullvirt-default-feature.xml | 2 +-
tests/xmconfigdata/test-fullvirt-force-hpet.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-force-hpet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-force-nohpet.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-force-nohpet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-localtime.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-localtime.xml | 2 +-
tests/xmconfigdata/test-fullvirt-net-ioemu.cfg | 25 --
tests/xmconfigdata/test-fullvirt-net-ioemu.xml | 49 ---
tests/xmconfigdata/test-fullvirt-net-netfront.cfg | 3 +
tests/xmconfigdata/test-fullvirt-net-netfront.xml | 2 +-
tests/xmconfigdata/test-fullvirt-new-cdrom.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-new-cdrom.xml | 2 +-
tests/xmconfigdata/test-fullvirt-old-cdrom.cfg | 26 --
tests/xmconfigdata/test-fullvirt-old-cdrom.xml | 49 ---
tests/xmconfigdata/test-fullvirt-parallel-tcp.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-parallel-tcp.xml | 2 +-
.../test-fullvirt-serial-dev-2-ports.cfg | 5 +-
.../test-fullvirt-serial-dev-2-ports.xml | 2 +-
.../test-fullvirt-serial-dev-2nd-port.cfg | 5 +-
.../test-fullvirt-serial-dev-2nd-port.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-file.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-serial-file.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-null.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-serial-null.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-pipe.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-serial-pipe.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-pty.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-serial-pty.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-stdio.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-serial-stdio.xml | 2 +-
.../test-fullvirt-serial-tcp-telnet.cfg | 5 +-
.../test-fullvirt-serial-tcp-telnet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-tcp.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-serial-tcp.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-udp.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-serial-udp.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-unix.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-serial-unix.xml | 2 +-
tests/xmconfigdata/test-fullvirt-sound.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-sound.xml | 2 +-
tests/xmconfigdata/test-fullvirt-usbmouse.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-usbmouse.xml | 2 +-
tests/xmconfigdata/test-fullvirt-usbtablet.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-usbtablet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-utc.cfg | 5 +-
tests/xmconfigdata/test-fullvirt-utc.xml | 2 +-
tests/xmconfigdata/test-no-source-cdrom.cfg | 5 +-
tests/xmconfigdata/test-no-source-cdrom.xml | 2 +-
.../test-paravirt-old-pvfb-vncdisplay.cfg | 18 -
.../test-paravirt-old-pvfb-vncdisplay.xml | 36 --
tests/xmconfigdata/test-paravirt-old-pvfb.cfg | 17 -
tests/xmconfigdata/test-paravirt-old-pvfb.xml | 36 --
tests/xmconfigdata/test-pci-devs.cfg | 5 +-
tests/xmconfigdata/test-pci-devs.xml | 2 +-
tests/xmconfigtest.c | 94 +++--
tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr | 4 +-
tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-curmem.sexpr | 2 +-
.../xml2sexpr-disk-block-shareable.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-disk-block.sexpr | 2 +-
.../xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr | 2 +-
.../xml2sexpr-disk-drv-blktap-qcow.sexpr | 2 +-
.../xml2sexpr-disk-drv-blktap-raw.sexpr | 2 +-
.../xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr | 2 +-
.../xml2sexpr-disk-drv-blktap2-raw.sexpr | 2 +-
.../xml2sexprdata/xml2sexpr-disk-drv-blktap2.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-disk-file.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-escape.sexpr | 6 +-
tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr | 10 +-
.../xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr | 5 +-
tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr | 9 -
tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.xml | 31 --
.../xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr | 5 +-
.../xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr | 10 +-
.../xml2sexpr-fv-serial-dev-2-ports.sexpr | 13 +-
.../xml2sexpr-fv-serial-dev-2nd-port.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr | 13 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr | 13 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr | 10 +-
.../xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr | 10 +-
.../xml2sexpr-fv-serial-tcp-telnet.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr | 4 +-
tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr | 4 +-
tests/xml2sexprdata/xml2sexpr-fv.sexpr | 10 +-
tests/xml2sexprdata/xml2sexpr-net-bridged.sexpr | 3 +-
tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr | 3 +-
tests/xml2sexprdata/xml2sexpr-net-routed.sexpr | 3 +-
.../xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr | 6 +-
tests/xml2sexprdata/xml2sexpr-pci-devs.sexpr | 2 +-
.../xml2sexpr-pv-bootloader-cmdline.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-pv-bootloader.sexpr | 2 +-
tests/xml2sexprdata/xml2sexpr-pv-localtime.sexpr | 6 +-
tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr | 3 +-
.../xml2sexprdata/xml2sexpr-pv-vfb-new-auto.sexpr | 3 +-
tests/xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr | 3 +-
tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr | 10 -
tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.xml | 23 --
tests/xml2sexprdata/xml2sexpr-pv.sexpr | 3 +-
tests/xml2sexprtest.c | 120 +++---
193 files changed, 919 insertions(+), 1833 deletions(-)
delete mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.sexpr
delete mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-net-ioemu.xml
delete mode 100644 tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.sexpr
delete mode 100644 tests/sexpr2xmldata/sexpr2xml-pv-vfb-orig.xml
delete mode 100644 tests/xmconfigdata/test-fullvirt-net-ioemu.cfg
delete mode 100644 tests/xmconfigdata/test-fullvirt-net-ioemu.xml
delete mode 100755 tests/xmconfigdata/test-fullvirt-old-cdrom.cfg
delete mode 100644 tests/xmconfigdata/test-fullvirt-old-cdrom.xml
delete mode 100644 tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.cfg
delete mode 100644 tests/xmconfigdata/test-paravirt-old-pvfb-vncdisplay.xml
delete mode 100755 tests/xmconfigdata/test-paravirt-old-pvfb.cfg
delete mode 100644 tests/xmconfigdata/test-paravirt-old-pvfb.xml
delete mode 100644 tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr
delete mode 100644 tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.xml
delete mode 100644 tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr
delete mode 100644 tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.xml
--
2.1.4
8 years, 11 months
[libvirt] [PATH lxc_support_ethernet] fix bug:lxc don't support network type of ethernet
by mark zhong
for exmple,the xml is:
<domain type = 'lxc'>
...
<devices>
<interface type ="ethernet">
<mac address="02:36:1d:18:2a:e4"/>
<ip address='192.168.112.105' family='ipv4' prefix='24'/>
<target dev="tap361d182e-14"/>
</interface>
<devices>
</domian>
when i start lxc with that xml file,system will report error and start lxc failed
Now i create the veth pair and set mac address in lxc if the network type is ethernet
Signed-off-by: mark zhong <zhongguocheng1(a)163.com>
---
src/lxc/lxc_process.c | 36 ++++++++++++++++++++++++++++++++++++
src/lxc/lxc_process.h | 3 +++
2 files changed, 39 insertions(+)
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 57e3880..913fe36 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -359,6 +359,39 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
return ret;
}
+char *virLXCProcessSetupInterfaceEthernet(virDomainDefPtr vm,
+ virDomainNetDefPtr net)
+{
+ char *ret = NULL;
+ char *parentVeth;
+ char *containerVeth = NULL;
+
+ VIR_DEBUG("calling vethCreate()");
+ parentVeth = net->ifname;
+ if (virNetDevVethCreate(&parentVeth, &containerVeth) < 0)
+ goto cleanup;
+ VIR_DEBUG("parentVeth: %s, containerVeth: %s", parentVeth, containerVeth);
+
+ if (net->ifname == NULL)
+ net->ifname = parentVeth;
+
+ if (virNetDevSetMAC(containerVeth, &net->mac) < 0)
+ goto cleanup;
+
+ if (virNetDevSetOnline(parentVeth, true) < 0)
+ goto cleanup;
+
+ if (net->filter &&
+ virDomainConfNWFilterInstantiate(vm->uuid, net) < 0)
+ goto cleanup;
+
+ ret = containerVeth;
+
+ cleanup:
+ return ret;
+}
+
+
static const char *nsInfoLocal[VIR_LXC_DOMAIN_NAMESPACE_LAST] = {
[VIR_LXC_DOMAIN_NAMESPACE_SHARENET] = "net",
[VIR_LXC_DOMAIN_NAMESPACE_SHAREIPC] = "ipc",
@@ -559,6 +592,9 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
break;
case VIR_DOMAIN_NET_TYPE_ETHERNET:
+ if (!(veth = virLXCProcessSetupInterfaceEthernet(def,
+ net)))
+ goto cleanup;
break;
case VIR_DOMAIN_NET_TYPE_USER:
diff --git a/src/lxc/lxc_process.h b/src/lxc/lxc_process.h
index b6c8083..3b4ade3 100644
--- a/src/lxc/lxc_process.h
+++ b/src/lxc/lxc_process.h
@@ -53,5 +53,8 @@ char *virLXCProcessSetupInterfaceBridged(virDomainDefPtr vm,
char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
virDomainDefPtr def,
virDomainNetDefPtr net);
+char *virLXCProcessSetupInterfaceEthernet(virDomainDefPtr vm,
+ virDomainNetDefPtr net);
+
#endif /* __LXC_PROCESS_H__ */
--
2.5.1.windows.1
8 years, 11 months
[libvirt] [PATCH 0/3] qemu_hotplug: dead code removal
by Ján Tomko
Originally posted as a part of https://www.redhat.com/archives/libvir-list/2015-August/msg00521.html
Ján Tomko (3):
qemu_hotplug: remove qemuDomainAttachDeviceControllerLive
Remove dead code from qemuDomainAttachControllerDevice
mark virDomainVirtioSerialAddrSetAddController as static.
src/conf/domain_addr.c | 23 +----------------------
src/conf/domain_addr.h | 8 --------
src/libvirt_private.syms | 2 --
src/qemu/qemu_driver.c | 23 +----------------------
src/qemu/qemu_hotplug.c | 25 +++++++------------------
5 files changed, 9 insertions(+), 72 deletions(-)
--
2.4.6
8 years, 11 months
[libvirt] [PATCH v2] Allow building lxc without virt-login-shell
by Cédric Bosdonnat
Add a configure option to disable virt-login-shell build even if lxc is
enabled.
---
Diff to V1:
* moved the configure.ac code into m4/virt-login-shell.m4
* allow building virt-login-shell without lxc
* Introduce WITH_SETUID_RPC_CLIENT to have it built if
either lxc or virt-login-shell is built.
configure.ac | 9 +++++++++
m4/virt-login-shell.m4 | 27 +++++++++++++++++++++++++++
src/Makefile.am | 4 ++--
tools/Makefile.am | 12 ++++++------
4 files changed, 44 insertions(+), 8 deletions(-)
create mode 100644 m4/virt-login-shell.m4
diff --git a/configure.ac b/configure.ac
index f481c50..6fef728 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1075,6 +1075,14 @@ fi
AM_CONDITIONAL([WITH_LXC], [test "$with_lxc" = "yes"])
dnl
+dnl Check for virt-login-shell
+dnl
+
+LIBVIRT_CHECK_LOGIN_SHELL
+
+AM_CONDITIONAL([WITH_SETUID_RPC_CLIENT], [test "$with_lxc$with_login_shell" != "nono"])
+
+dnl
dnl Checks for the Parallels driver
dnl
@@ -2974,6 +2982,7 @@ AC_MSG_NOTICE([ Init script: $with_init_script])
AC_MSG_NOTICE([Char device locks: $with_chrdev_lock_files])
AC_MSG_NOTICE([ Default Editor: $DEFAULT_EDITOR])
AC_MSG_NOTICE([ Loader/NVRAM: $with_loader_nvram])
+AC_MSG_NOTICE([ virt-login-shell: $with_login_shell])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Developer Tools])
AC_MSG_NOTICE([])
diff --git a/m4/virt-login-shell.m4 b/m4/virt-login-shell.m4
new file mode 100644
index 0000000..0701054
--- /dev/null
+++ b/m4/virt-login-shell.m4
@@ -0,0 +1,27 @@
+dnl Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl <http://www.gnu.org/licenses/>.
+
+AC_DEFUN([LIBVIRT_CHECK_LOGIN_SHELL], [
+ AC_ARG_WITH([login_shell],
+ [AS_HELP_STRING([--with-login-shell],
+ [build virt-login-shell @<:@default=yes@:>@])])
+ m4_divert_text([DEFAULTS], [with_login_shell=yes])
+
+ if test "$with_login_shell" ; then
+ AC_DEFINE_UNQUOTED([WITH_LOGIN_SHELL], 1, [whether virt-login-shell is built])
+ fi
+ AM_CONDITIONAL([WITH_LOGIN_SHELL], [test "$with_login_shell" = "yes"])
+])
diff --git a/src/Makefile.am b/src/Makefile.am
index 99b4993..2f40910 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2225,7 +2225,7 @@ libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
# have a RPC client for local UNIX socket access only. We use
# the ../config-post.h header to disable all external deps that
# we don't want
-if WITH_LXC
+if WITH_SETUID_RPC_CLIENT
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la
libvirt_setuid_rpc_client_la_SOURCES = \
@@ -2302,7 +2302,7 @@ libvirt_setuid_rpc_client_la_CFLAGS = \
$(SECDRIVER_CFLAGS) \
$(XDR_CFLAGS) \
$(NULL)
-endif WITH_LXC
+endif WITH_SETUID_RPC_CLIENT
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =
diff --git a/tools/Makefile.am b/tools/Makefile.am
index d5638d9..d005035 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -71,12 +71,12 @@ sbin_SCRIPTS = virt-sanlock-cleanup
DISTCLEANFILES += virt-sanlock-cleanup
endif WITH_SANLOCK
-if WITH_LXC
+if WITH_LOGIN_SHELL
conf_DATA += virt-login-shell.conf
bin_PROGRAMS += virt-login-shell
-else ! WITH_LXC
+else ! WITH_LOGIN_SHELL
EXTRA_DIST += virt-login-shell.conf
-endif ! WITH_LXC
+endif ! WITH_LOGIN_SHELL
dist_man1_MANS = \
@@ -84,11 +84,11 @@ dist_man1_MANS = \
virt-pki-validate.1 \
virt-xml-validate.1 \
virsh.1
-if WITH_LXC
+if WITH_LOGIN_SHELL
dist_man1_MANS += virt-login-shell.1
-else ! WITH_LXC
+else ! WITH_LOGIN_SHELL
EXTRA_DIST += virt-login-shell.1
-endif ! WITH_LXC
+endif ! WITH_LOGIN_SHELL
if WITH_SANLOCK
dist_man8_MANS = virt-sanlock-cleanup.8
endif WITH_SANLOCK
--
2.1.4
8 years, 11 months
[libvirt] [PATCH] schema: interleave domain name and uuid with other elements
by Ján Tomko
Allow <name> and <uuid> anywhere under <domain>, not just at the top:
error:XML document failed to validate against schema: Unable to validate
doc against /usr/share/libvirt/schemas/domain.rng
Expecting an element name, got nothing
Invalid sequence in interleave
Element domain failed to validate content
Introduced with the first RelaxNG schema in commit c642103.
https://bugzilla.redhat.com/show_bug.cgi?id=1292131
---
docs/schemas/domaincommon.rng | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 4804c69..01d99f0 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -30,8 +30,8 @@
<define name="domain">
<element name="domain">
<ref name="hvs"/>
- <ref name="ids"/>
<interleave>
+ <ref name="ids"/>
<optional>
<ref name="title"/>
</optional>
--
2.4.6
8 years, 11 months
[libvirt] [PATCH] qemu: Fix event generated for qemuDomainRevertToSnapshot (pause->run)
by John Ferlan
A closer review of the code shows that for the transition from paused to
running which was supposed to emit the VIR_DOMAIN_EVENT_RESUMED - no event
would be generated. Rather the event is generated when going from running
to running.
Following the 'was_running' boolean shows it is set when the domain obj
is active and the domain obj state is VIR_DOMAIN_RUNNING. So rather than
using was_running to generate the RESUMED event, use !was_running
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
I hope I've read the bread crumbs in the code correctly regarding state
transitions! Saw this while reviewing something else:
http://www.redhat.com/archives/libvir-list/2015-December/msg00330.html
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 783a7cd..deeffc1 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15549,7 +15549,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STARTED,
detail);
- } else if (was_running) {
+ } else if (!was_running) {
/* Transition 8 */
detail = VIR_DOMAIN_EVENT_RESUMED;
event = virDomainEventLifecycleNewFromObj(vm,
--
2.5.0
8 years, 11 months
[libvirt] [PATCH] storage: Fix startup issue for logical pool
by John Ferlan
Commit id '71b803ac' assumed that the storage pool source device path
was required for a 'logical' pool. This resulted in a failure to start
a pool without any device path defined.
So, adjust the virStorageBackendLogicalMatchPoolSource logic to
return success if at least the pool name matches the vgs output
when no pool source device path is/are provided.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/storage/storage_backend_logical.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index c52782f..f59684a 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -541,6 +541,15 @@ virStorageBackendLogicalMatchPoolSource(virStoragePoolObjPtr pool)
goto cleanup;
}
+ /* If the pool has defined source device(s), then let's make sure
+ * they match as well; otherwise, matching can only occur on the
+ * pool's name.
+ */
+ if (!pool->def->source.ndevice) {
+ ret = true;
+ goto cleanup;
+ }
+
/* Let's make sure the pool's device(s) match what the pvs output has
* for volume group devices.
*/
--
2.5.0
8 years, 11 months
[libvirt] [PATCH v2] storage: Attempt to refresh volume after successful wipe volume
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1270709
When a volume wipe is successful, perform a volume refresh afterwards to
update any volume data that may be used in future volume commands, such as
volume resize. For a raw file volume, a wipe could truncate the file and
a followup volume resize the capacity may fail because the volume target
allocation isn't updated to reflect the wipe activity.
Since the documentation doesn't mention this side effect of the zero
algorithm for a raw file volume, update the various documentation to
describe the results.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
v1:
http://www.redhat.com/archives/libvir-list/2015-December/msg00085.html
Changes since v1:
* Use the preferred call format from review
* Cause error if refreshVol fails
* Add wording to docs regarding zero wipe algorithm and truncating
the raw file.
src/libvirt-storage.c | 9 +++++++--
src/storage/storage_driver.c | 9 ++++++++-
tools/virsh.pod | 5 +++++
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c
index 66dd9f0..62bb999 100644
--- a/src/libvirt-storage.c
+++ b/src/libvirt-storage.c
@@ -1725,7 +1725,9 @@ virStorageVolDelete(virStorageVolPtr vol,
* @vol: pointer to storage volume
* @flags: extra flags; not used yet, so callers should always pass 0
*
- * Ensure data previously on a volume is not accessible to future reads
+ * Ensure data previously on a volume is not accessible to future reads.
+ * Use of this function is equivalent to calling virStorageVolWipePattern
+ * with the VIR_STORAGE_VOL_WIPE_ALG_ZERO for the algorithm.
*
* Returns 0 on success, or -1 on error
*/
@@ -1766,7 +1768,10 @@ virStorageVolWipe(virStorageVolPtr vol,
* @flags: future flags, use 0 for now
*
* Similar to virStorageVolWipe, but one can choose
- * between different wiping algorithms.
+ * between different wiping algorithms. When choosing the
+ * zero algorithm (VIR_STORAGE_VOL_WIPE_ALG_ZERO), it is
+ * possible the target storage backend will truncate the
+ * file rather than writing a stream of zeroes.
*
* Returns 0 on success, or -1 on error.
*/
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index bbf21f6..2531a88 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -2436,7 +2436,14 @@ storageVolWipePattern(virStorageVolPtr obj,
goto cleanup;
}
- ret = backend->wipeVol(obj->conn, pool, vol, algorithm, flags);
+ if (backend->wipeVol(obj->conn, pool, vol, algorithm, flags) < 0)
+ goto cleanup;
+
+ if (backend->refreshVol &&
+ backend->refreshVol(obj->conn, pool, vol) < 0)
+ goto cleanup;
+
+ ret = 0;
cleanup:
virStoragePoolObjUnlock(pool);
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 21ae4a3..7f6dc8d 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -3509,6 +3509,11 @@ B<Supported algorithms>
B<Note>: The availability of algorithms may be limited by the version
of the C<scrub> binary installed on the host.
+B<Note>: Use of the zero algorithm for some storage backends may result
+in the truncation of the target file instead of writing all zeroes to the
+file. The Storage Driver will refresh the volume allocation and capacity
+after successful volume wipe completion.
+
=item B<vol-dumpxml> [I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path>
Output the volume information as an XML dump to stdout.
--
2.5.0
8 years, 11 months
[libvirt] [PATCH 0/5] virStorageBackendWipeLocal cleanups
by Ján Tomko
The first patch fixes the return values of virStorageWipe on non-sparse local files
in the case of a partial wipe or a fdatasync error.
The rest reduces the number of parameters of virStorageBackendWipe{Extent,}Local.
Ján Tomko (5):
storage: fix return values of virStorageBackendWipeExtentLocal
storage: move buffer allocation inside
virStorageBackendWipeExtentLocal
storage: drop 'Extent' from virStorageBackendWipeExtentLocal
virStorageBackendWipeLocal: use unsigned long long instead of off_t
virStorageBackendWipeLocal: remove bytes_wiped argument
src/storage/storage_backend.c | 53 +++++++++++++++++--------------------------
1 file changed, 21 insertions(+), 32 deletions(-)
--
2.4.6
8 years, 11 months