Compare commits
35 Commits
Author | SHA1 | Date |
---|---|---|
|
f1a1c9fa59 | |
|
478ce99c05 | |
|
c700f01de2 | |
|
2ef31dc2ae | |
|
d4e5211296 | |
|
1821e087f2 | |
|
18e08b3f76 | |
|
ff14b5ac1e | |
|
818f358ccf | |
|
fa8bc6764c | |
|
66484c0a3a | |
|
d815da8211 | |
|
bf918b0c15 | |
|
b59030d6b9 | |
|
7c228b7521 | |
|
8c8b755519 | |
|
c24c6d1abf | |
|
76fdaa7bb0 | |
|
56b51c0be8 | |
|
e5af44684c | |
|
cd6f0ffeda | |
|
47190b4726 | |
|
78f1d3ac45 | |
|
a6948b8e59 | |
|
5636327a0d | |
|
35cba470a0 | |
|
ceac8fe559 | |
|
46c95e5a07 | |
|
8a3c40567c | |
|
9b98b4ed36 | |
|
8d2677cf1f | |
|
7dcc6a4ac8 | |
|
71733e9328 | |
|
3acabefe34 | |
|
c41054c528 |
|
@ -0,0 +1,180 @@
|
|||
From f3997733f0bca081d71848e66ca7d728b4c0a864 Mon Sep 17 00:00:00 2001
|
||||
From: Alon Levy <alevy@redhat.com>
|
||||
Date: Tue, 8 May 2012 20:42:44 +0300
|
||||
Subject: [PATCH] domain_conf: add "default" to list of valid spice channels
|
||||
|
||||
qemu's behavior in this case is to change the spice server behavior to
|
||||
require secure connection to any channel not otherwise specified as
|
||||
being in plaintext mode. libvirt doesn't currently allow requesting this
|
||||
(via plaintext-channel=<channel name>).
|
||||
|
||||
RHBZ: 819499
|
||||
|
||||
Signed-off-by: Alon Levy <alevy@redhat.com>
|
||||
(cherry picked from commit ba97e4edc6aa439a4f1e70855cf4503181efdb7f)
|
||||
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
||||
---
|
||||
docs/formatdomain.html.in | 7 +++++++
|
||||
docs/schemas/domaincommon.rng | 9 +++++++++
|
||||
src/conf/domain_conf.c | 20 ++++++++++++++++++++
|
||||
src/conf/domain_conf.h | 1 +
|
||||
src/qemu/qemu_command.c | 13 +++++++++++++
|
||||
.../qemuxml2argv-graphics-spice.args | 2 +-
|
||||
.../qemuxml2argv-graphics-spice.xml | 2 +-
|
||||
7 files changed, 52 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
|
||||
index e33913f..4a70b0f 100644
|
||||
--- a/docs/formatdomain.html.in
|
||||
+++ b/docs/formatdomain.html.in
|
||||
@@ -2913,6 +2913,13 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<span class="since">Since 0.9.3</span>
|
||||
NB, this may not be supported by all hypervisors.
|
||||
<span class="since">"spice" since 0.8.6</span>.
|
||||
+ The <code>defaultMode</code> attribute sets the default channel
|
||||
+ security policy, valid values are <code>secure</code>,
|
||||
+ <code>insecure</code> and the default <code>any</code>
|
||||
+ (which is secure if possible, but falls back to insecure
|
||||
+ rather than erroring out if no secure path is
|
||||
+ available). <span class="since">"defaultMode" since
|
||||
+ 0.9.12</span>.
|
||||
</p>
|
||||
<p>
|
||||
When SPICE has both a normal and TLS secured TCP port
|
||||
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
|
||||
index 5bcf1b9..30ab4c6 100644
|
||||
--- a/docs/schemas/domaincommon.rng
|
||||
+++ b/docs/schemas/domaincommon.rng
|
||||
@@ -1779,6 +1779,15 @@
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
+ <optional>
|
||||
+ <attribute name="defaultMode">
|
||||
+ <choice>
|
||||
+ <value>any</value>
|
||||
+ <value>secure</value>
|
||||
+ <value>insecure</value>
|
||||
+ </choice>
|
||||
+ </attribute>
|
||||
+ </optional>
|
||||
<interleave>
|
||||
<ref name="listenElements"/>
|
||||
<zeroOrMore>
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index d017ea4..2b21b11 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -6069,6 +6069,8 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
||||
char *port = virXMLPropString(node, "port");
|
||||
char *tlsPort;
|
||||
char *autoport;
|
||||
+ char *defaultMode;
|
||||
+ int defaultModeVal;
|
||||
|
||||
if (port) {
|
||||
if (virStrToLong_i(port, NULL, 10, &def->data.spice.port) < 0) {
|
||||
@@ -6101,6 +6103,20 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
||||
VIR_FREE(autoport);
|
||||
}
|
||||
|
||||
+ def->data.spice.defaultMode = VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY;
|
||||
+
|
||||
+ if ((defaultMode = virXMLPropString(node, "defaultMode")) != NULL) {
|
||||
+ if ((defaultModeVal = virDomainGraphicsSpiceChannelModeTypeFromString(defaultMode)) < 0) {
|
||||
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("unknown default spice channel mode %s"),
|
||||
+ defaultMode);
|
||||
+ VIR_FREE(defaultMode);
|
||||
+ goto error;
|
||||
+ }
|
||||
+ def->data.spice.defaultMode = defaultModeVal;
|
||||
+ VIR_FREE(defaultMode);
|
||||
+ }
|
||||
+
|
||||
if (def->data.spice.port == -1 && def->data.spice.tlsPort == -1) {
|
||||
/* Legacy compat syntax, used -1 for auto-port */
|
||||
def->data.spice.autoport = 1;
|
||||
@@ -12111,6 +12127,10 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
|
||||
virBufferEscapeString(buf, " keymap='%s'",
|
||||
def->data.spice.keymap);
|
||||
|
||||
+ if (def->data.spice.defaultMode != VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY)
|
||||
+ virBufferAsprintf(buf, " defaultMode='%s'",
|
||||
+ virDomainGraphicsSpiceChannelModeTypeToString(def->data.spice.defaultMode));
|
||||
+
|
||||
virDomainGraphicsAuthDefFormatAttr(buf, &def->data.spice.auth, flags);
|
||||
break;
|
||||
|
||||
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
|
||||
index a2fea00..62eaafb 100644
|
||||
--- a/src/conf/domain_conf.h
|
||||
+++ b/src/conf/domain_conf.h
|
||||
@@ -1233,6 +1233,7 @@ struct _virDomainGraphicsDef {
|
||||
virDomainGraphicsAuthDef auth;
|
||||
unsigned int autoport :1;
|
||||
int channels[VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST];
|
||||
+ int defaultMode; /* enum virDomainGraphicsSpiceChannelMode */
|
||||
int image;
|
||||
int jpeg;
|
||||
int zlib;
|
||||
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||
index 55e772f..f411712 100644
|
||||
--- a/src/qemu/qemu_command.c
|
||||
+++ b/src/qemu/qemu_command.c
|
||||
@@ -5499,6 +5499,7 @@ qemuBuildCommandLine(virConnectPtr conn,
|
||||
const char *listenAddr = NULL;
|
||||
char *netAddr = NULL;
|
||||
int ret;
|
||||
+ int defaultMode = def->graphics[0]->data.spice.defaultMode;
|
||||
|
||||
if (!qemuCapsGet(qemuCaps, QEMU_CAPS_SPICE)) {
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
@@ -5582,6 +5583,18 @@ qemuBuildCommandLine(virConnectPtr conn,
|
||||
virBufferAsprintf(&opt, ",x509-dir=%s",
|
||||
driver->spiceTLSx509certdir);
|
||||
|
||||
+ switch (defaultMode) {
|
||||
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
|
||||
+ virBufferAsprintf(&opt, ",tls-channel=default");
|
||||
+ break;
|
||||
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
|
||||
+ virBufferAsprintf(&opt, ",plaintext-channel=default");
|
||||
+ break;
|
||||
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
|
||||
+ /* nothing */
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
for (i = 0 ; i < VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST ; i++) {
|
||||
int mode = def->graphics[0]->data.spice.channels[i];
|
||||
switch (mode) {
|
||||
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args
|
||||
index c9fdb99..698e39c 100644
|
||||
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args
|
||||
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args
|
||||
@@ -2,7 +2,7 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \
|
||||
/usr/bin/qemu -S -M pc -m 214 -smp 1 -nodefaults -monitor \
|
||||
unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -hda \
|
||||
/dev/HostVG/QEMUGuest1 -spice port=5903,tls-port=5904,addr=127.0.0.1,\
|
||||
-x509-dir=/etc/pki/libvirt-spice,tls-channel=main,plaintext-channel=inputs,\
|
||||
+x509-dir=/etc/pki/libvirt-spice,tls-channel=default,tls-channel=main,plaintext-channel=inputs,\
|
||||
image-compression=auto_glz,jpeg-wan-compression=auto,zlib-glz-wan-compression=auto,\
|
||||
playback-compression=on,streaming-video=filter,disable-copy-paste -vga \
|
||||
qxl -global qxl.vram_size=18874368 -device qxl,id=video1,vram_size=33554432,bus=pci.0,addr=0x4 \
|
||||
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml
|
||||
index 8930b60..a3789f2 100644
|
||||
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml
|
||||
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml
|
||||
@@ -22,7 +22,7 @@
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='ide' index='0'/>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
- <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1'>
|
||||
+ <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1' defaultMode='secure'>
|
||||
<listen type='address' address='127.0.0.1'/>
|
||||
<channel name='main' mode='secure'/>
|
||||
<channel name='inputs' mode='insecure'/>
|
||||
--
|
||||
1.7.7.6
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
From 3c3816ed226e766aa76624de7d159cdd1ee67913 Mon Sep 17 00:00:00 2001
|
||||
From: Alon Levy <alevy@redhat.com>
|
||||
Date: Tue, 8 May 2012 16:00:28 +0300
|
||||
Subject: [PATCH] domain_conf: add "usbredir" to list of valid spice channels
|
||||
|
||||
Add "usbredir" channel to list of recognized spice channels.
|
||||
|
||||
RHBZ: 819498
|
||||
|
||||
Signed-off-by: Alon Levy <alevy@redhat.com>
|
||||
(cherry picked from commit 4e78ffb63489071c4100678ed88d3111284555e8)
|
||||
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
||||
---
|
||||
docs/formatdomain.html.in | 8 ++-
|
||||
docs/schemas/domaincommon.rng | 1 +
|
||||
src/conf/domain_conf.c | 3 +-
|
||||
src/conf/domain_conf.h | 1 +
|
||||
.../qemuxml2argv-graphics-spice-usb-redir.args | 16 ++++++
|
||||
.../qemuxml2argv-graphics-spice-usb-redir.xml | 53 ++++++++++++++++++++
|
||||
tests/qemuxml2argvtest.c | 6 ++
|
||||
7 files changed, 84 insertions(+), 4 deletions(-)
|
||||
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-usb-redir.args
|
||||
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-usb-redir.xml
|
||||
|
||||
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
|
||||
index 801e1ec..e33913f 100644
|
||||
--- a/docs/formatdomain.html.in
|
||||
+++ b/docs/formatdomain.html.in
|
||||
@@ -2922,9 +2922,11 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
main <graphics> element. Valid channel names
|
||||
include <code>main</code>, <code>display</code>,
|
||||
<code>inputs</code>, <code>cursor</code>,
|
||||
- <code>playback</code>, <code>record</code>;
|
||||
- and <span class="since">since
|
||||
- 0.8.8</span>: <code>smartcard</code>.
|
||||
+ <code>playback</code>, <code>record</code>
|
||||
+ (all <span class="since"> since 0.8.6</span>);
|
||||
+ <code>smartcard</code> (<span class="since">since
|
||||
+ 0.8.8</span>); and <code>usbredir</code>
|
||||
+ (<span class="since">since 0.9.12</span>).
|
||||
</p>
|
||||
<pre>
|
||||
<graphics type='spice' port='-1' tlsPort='-1' autoport='yes'>
|
||||
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
|
||||
index 0cc04af..5bcf1b9 100644
|
||||
--- a/docs/schemas/domaincommon.rng
|
||||
+++ b/docs/schemas/domaincommon.rng
|
||||
@@ -1792,6 +1792,7 @@
|
||||
<value>playback</value>
|
||||
<value>record</value>
|
||||
<value>smartcard</value>
|
||||
+ <value>usbredir</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
<attribute name="mode">
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index d886b60..d017ea4 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 1b8741e..a2fea00 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
|
||||
};
|
||||
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-usb-redir.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-usb-redir.args
|
||||
new file mode 100644
|
||||
index 0000000..35e51a7
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-usb-redir.args
|
||||
@@ -0,0 +1,16 @@
|
||||
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice /usr/bin/qemu -S -M pc -m 214 -smp 1 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c \
|
||||
+-device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x4.0x7 \
|
||||
+-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x4 \
|
||||
+-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x4.0x1 \
|
||||
+-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x4.0x2 \
|
||||
+-spice port=5903,tls-port=5904,addr=127.0.0.1,\
|
||||
+x509-dir=/etc/pki/libvirt-spice,tls-channel=main,plaintext-channel=inputs,\
|
||||
+tls-channel=usbredir,\
|
||||
+image-compression=auto_glz,jpeg-wan-compression=auto,zlib-glz-wan-compression=auto,\
|
||||
+playback-compression=on,streaming-video=filter,disable-copy-paste \
|
||||
+-vga cirrus \
|
||||
+-chardev socket,id=charredir0,host=localhost,port=4000 \
|
||||
+-device usb-redir,chardev=charredir0,id=redir0 \
|
||||
+-chardev spicevmc,id=charredir1,name=usbredir \
|
||||
+-device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=4 \
|
||||
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
||||
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-usb-redir.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-usb-redir.xml
|
||||
new file mode 100644
|
||||
index 0000000..1dc23bd
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-usb-redir.xml
|
||||
@@ -0,0 +1,53 @@
|
||||
+<domain type='qemu'>
|
||||
+ <name>QEMUGuest1</name>
|
||||
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
+ <memory unit='KiB'>219136</memory>
|
||||
+ <currentMemory unit='KiB'>219136</currentMemory>
|
||||
+ <vcpu>1</vcpu>
|
||||
+ <os>
|
||||
+ <type arch='i686' machine='pc'>hvm</type>
|
||||
+ <boot dev='hd'/>
|
||||
+ </os>
|
||||
+ <clock offset='utc'/>
|
||||
+ <on_poweroff>destroy</on_poweroff>
|
||||
+ <on_reboot>restart</on_reboot>
|
||||
+ <on_crash>destroy</on_crash>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/qemu</emulator>
|
||||
+ <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1'>
|
||||
+ <listen type='address' address='127.0.0.1'/>
|
||||
+ <channel name='main' mode='secure'/>
|
||||
+ <channel name='inputs' mode='insecure'/>
|
||||
+ <channel name='usbredir' mode='secure'/>
|
||||
+ <image compression='auto_glz'/>
|
||||
+ <jpeg compression='auto'/>
|
||||
+ <zlib compression='auto'/>
|
||||
+ <playback compression='on'/>
|
||||
+ <streaming mode='filter'/>
|
||||
+ <clipboard copypaste='no'/>
|
||||
+ </graphics>
|
||||
+ <controller type='usb' index='0' model='ich9-ehci1'>
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x7'/>
|
||||
+ </controller>
|
||||
+ <controller type='usb' index='0' model='ich9-uhci1'>
|
||||
+ <master startport='0'/>
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0' multifunction='on'/>
|
||||
+ </controller>
|
||||
+ <controller type='usb' index='0' model='ich9-uhci2'>
|
||||
+ <master startport='2'/>
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x1'/>
|
||||
+ </controller>
|
||||
+ <controller type='usb' index='0' model='ich9-uhci3'>
|
||||
+ <master startport='4'/>
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x2'/>
|
||||
+ </controller>
|
||||
+ <redirdev bus='usb' type='tcp'>
|
||||
+ <source mode='connect' host='localhost' service='4000'/>
|
||||
+ <protocol type='raw'/>
|
||||
+ </redirdev>
|
||||
+ <redirdev bus='usb' type='spicevmc'>
|
||||
+ <address type='usb' bus='0' port='4'/>
|
||||
+ </redirdev>
|
||||
+ <memballoon model='virtio'/>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
|
||||
index a32d4f8..b128c07 100644
|
||||
--- a/tests/qemuxml2argvtest.c
|
||||
+++ b/tests/qemuxml2argvtest.c
|
||||
@@ -540,6 +540,12 @@ mymain(void)
|
||||
QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL,
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_SPICE,
|
||||
QEMU_CAPS_DEVICE_QXL_VGA);
|
||||
+ DO_TEST("graphics-spice-usb-redir", false,
|
||||
+ QEMU_CAPS_VGA, QEMU_CAPS_SPICE,
|
||||
+ QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
|
||||
+ QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB,
|
||||
+ QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR,
|
||||
+ QEMU_CAPS_CHARDEV_SPICEVMC);
|
||||
|
||||
DO_TEST("input-usbmouse", false, NONE);
|
||||
DO_TEST("input-usbtablet", false, NONE);
|
||||
--
|
||||
1.7.7.6
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
--- libvirt-0.9.11.5.orig/src/lxc/lxc_container.c 2012-08-12 18:03:58.000000000 -0500
|
||||
+++ libvirt-0.9.11.5.orig/src/lxc/lxc_container.c 2012-09-21 07:38:19.000000000 -0500
|
||||
@@ -506,7 +506,7 @@
|
||||
if (pivotRoot) {
|
||||
#if HAVE_SELINUX
|
||||
if (getfilecon("/", &con) < 0 &&
|
||||
- errno != ENOTSUP) {
|
||||
+ errno != ENOTSUP && errno != ENODATA) {
|
||||
virReportSystemError(errno, "%s",
|
||||
_("Failed to query file context on /"));
|
||||
goto cleanup;
|
||||
--- libvirt-0.9.11.5.orig/src/lxc/lxc_controller.c 2012-08-12 18:03:58.000000000 -0500
|
||||
+++ libvirt-0.9.11.5.orig/src/lxc/lxc_controller.c 2012-09-21 07:20:41.000000000 -0500
|
||||
@@ -1480,7 +1480,7 @@
|
||||
|
||||
#if HAVE_SELINUX
|
||||
if (getfilecon(root->src, &con) < 0 &&
|
||||
- errno != ENOTSUP) {
|
||||
+ errno != ENOTSUP && errno != ENODATA) {
|
||||
virReportSystemError(errno,
|
||||
_("Failed to query file context on %s"),
|
||||
root->src);
|
|
@ -0,0 +1,155 @@
|
|||
From 7c96ce960b84ba19b9cc8e090615f54206e44ff0 Mon Sep 17 00:00:00 2001
|
||||
From: Laine Stump <laine@laine.org>
|
||||
Date: Tue, 6 Dec 2011 12:47:28 -0500
|
||||
Subject: [PATCH] qemu: replace deprecated fedora-13 machine type with pc-0.14
|
||||
|
||||
This addresses https://bugzilla.redhat.com/show_bug.cgi?id=754772 .
|
||||
It should only be applied to Fedora builds of libvirt, F15 and
|
||||
later, so there is no upstream equivalent patch.
|
||||
|
||||
Background:
|
||||
|
||||
During the lifetime of Fedora 13, some features were backported into
|
||||
the F13 build of qemu-kvm from upstream. These features were part of
|
||||
the functionality of machine type "pc-0.13" in upstream qemu-kvm, so a
|
||||
special "fedora-13" machine type was created for the F13 qemu-kvm.
|
||||
Since "fedora-13" became the new "canonical machine type", all new
|
||||
domains created with F13 libvirt tools by default contained that
|
||||
machine type in their configuration file.
|
||||
|
||||
In Fedora 14, a patch was made to qemu to treat the fedora-13 machine
|
||||
type as equivalent to "pc-0.13". When Fedora 15 was released, this was
|
||||
inadvertently changed to make it equivalent to "pc-0.14".
|
||||
|
||||
With the release of Fedora 16, qemu-kvm initially removed support for
|
||||
this machine type, which caused failure of many guest configurations
|
||||
to start. qemu-kvm subsequently re-added the patch to support
|
||||
fedora-13 (as equivalent to pc-0.14), but with the promise that they
|
||||
could remove it with the release of Fedora 17. (see
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=748218 ).
|
||||
|
||||
Solution:
|
||||
|
||||
In order to create a repeat of the recent problems, prior to F17
|
||||
existing guest configurations need to be updated to change fedora-13
|
||||
to pc-0.14 (which has been determined to be equivalent for all
|
||||
practical purposes in both F15 and F16). That's what this patch does:
|
||||
|
||||
1) Each time libvirtd is started, it calls virDomainLoadAllConfigs()
|
||||
which calls virDomainLoadConfig(); this function has been modified to
|
||||
check for os.machine == "fedora-13", and change it to "pc-0.14" then
|
||||
write the updated config back to disk.
|
||||
|
||||
2) Also, any other time a domain definition is parsed, the parsed
|
||||
version in memory is changed to turn "fedora-13" into "pc-0.14". This
|
||||
handles domains that had been saved to disk prior to the upgrade, and
|
||||
are subsequently restarted.
|
||||
|
||||
3) Finally, whenever a domain definition is formatted into a string,
|
||||
any occurrence of fedora-13 is replaced with pc-0.14 *directly in the
|
||||
virDomainDef* (to avoid multiple warning messages for the same object
|
||||
when it's formatted multiple times). This should deal with those cases
|
||||
where a domain was running at the time of upgrade, and is later
|
||||
saved/snapshotted.
|
||||
|
||||
I had considered doing this with some sed commands in the specfile,
|
||||
but that wouldn't do anything to help the xml saved in image files.
|
||||
|
||||
(Also, one of the xml tests was using the machine type "fedora-13",
|
||||
and since that machine type is treated specially by the rest of this
|
||||
patch, it was failing. That has been changed in a separate patch,
|
||||
which must be applied with this patch, and which *is* also upstream).
|
||||
---
|
||||
src/conf/domain_conf.c | 62 +++++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 files changed, 59 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index f8d0a4c..c79014b 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -8394,7 +8394,25 @@ virDomainDefPtr virDomainDefParseString(virCapsPtr caps,
|
||||
unsigned int expectedVirtTypes,
|
||||
unsigned int flags)
|
||||
{
|
||||
- return virDomainDefParse(xmlStr, NULL, caps, expectedVirtTypes, flags);
|
||||
+ virDomainDefPtr def
|
||||
+ = virDomainDefParse(xmlStr, NULL, caps, expectedVirtTypes, flags);
|
||||
+
|
||||
+ /* Fedora-specific HACK - treat fedora-13 and pc-0.14 as equivalent.
|
||||
+ * This handles the case of domains that had been saved to an image file
|
||||
+ * prior to upgrade (save or snapshot), then restarted/reverted.
|
||||
+ */
|
||||
+ if (def && STREQ_NULLABLE(def->os.machine, "fedora-13")) {
|
||||
+ VIR_FREE(def->os.machine);
|
||||
+ if (!(def->os.machine = strdup("pc-0.14"))) {
|
||||
+ virReportOOMError();
|
||||
+ virDomainDefFree(def);
|
||||
+ def = NULL;
|
||||
+ } else {
|
||||
+ VIR_WARN("Replacing deprecated 'fedora-13' machine type "
|
||||
+ "with equivalent 'pc-0.14' in domain %s xml", def->name);
|
||||
+ }
|
||||
+ }
|
||||
+ return def;
|
||||
}
|
||||
|
||||
virDomainDefPtr virDomainDefParseFile(virCapsPtr caps,
|
||||
@@ -11737,8 +11755,30 @@ virDomainDefFormatInternal(virDomainDefPtr def,
|
||||
virBufferAddLit(buf, " <type");
|
||||
if (def->os.arch)
|
||||
virBufferAsprintf(buf, " arch='%s'", def->os.arch);
|
||||
- if (def->os.machine)
|
||||
- virBufferAsprintf(buf, " machine='%s'", def->os.machine);
|
||||
+ if (def->os.machine) {
|
||||
+ /* Fedora-specific HACK - replace "fedora-13" with "pc-0.14"
|
||||
+ * (in the original DomainDef as well as in the xml output).
|
||||
+ * This will catch XML being written to save/migration images
|
||||
+ * of domains that were running when libvirtd was restarted at
|
||||
+ * the time of upgrade.
|
||||
+ */
|
||||
+ if (STREQ_NULLABLE(def->os.machine, "fedora-13")) {
|
||||
+ virBufferAddLit(buf, " machine='pc-0.14'");
|
||||
+ VIR_WARN("substituting machine type 'fedora-13' with 'pc-0.14' "
|
||||
+ "in domain %s", def->name);
|
||||
+ /* It's not exactly nice to modify the source object,
|
||||
+ * but sometimes virDomainFormat is called > 100 times for the
|
||||
+ * same object, which would result in far too many warning logs.
|
||||
+ */
|
||||
+ VIR_FREE(def->os.machine);
|
||||
+ if (!(def->os.machine = strdup("pc-0.14"))) {
|
||||
+ virReportOOMError();
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ } else {
|
||||
+ virBufferAsprintf(buf, " machine='%s'", def->os.machine);
|
||||
+ }
|
||||
+ }
|
||||
/*
|
||||
* HACK: For xen driver we previously used bogus 'linux' as the
|
||||
* os type for paravirt, whereas capabilities declare it to
|
||||
@@ -12149,6 +12189,22 @@ static virDomainObjPtr virDomainLoadConfig(virCapsPtr caps,
|
||||
VIR_DOMAIN_XML_INACTIVE)))
|
||||
goto error;
|
||||
|
||||
+ /* Fedora-specific HACK - replace "fedora-13" with "pc-0.14".
|
||||
+ * This updates all config files at the first restart of libvirt
|
||||
+ * after upgrade.
|
||||
+ */
|
||||
+ if (STREQ_NULLABLE(def->os.machine, "fedora-13")) {
|
||||
+ VIR_FREE(def->os.machine);
|
||||
+ if (!(def->os.machine = strdup("pc-0.14"))) {
|
||||
+ virReportOOMError();
|
||||
+ goto error;
|
||||
+ }
|
||||
+ VIR_WARN("Replacing deprecated 'fedora-13' machine type "
|
||||
+ "with equivalent 'pc-0.14' in domain %s configuration file", name);
|
||||
+ if (virDomainSaveConfig(configDir, def) < 0)
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
if ((autostartLink = virDomainConfigFile(autostartDir, name)) == NULL)
|
||||
goto error;
|
||||
|
||||
--
|
||||
1.7.7.6
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
commit b8012ce9312f00947c5ca7250a7a96534c85835f
|
||||
Author: David Weber <wb@munzinger.de>
|
||||
Date: Mon May 14 09:53:02 2012 +0000
|
||||
|
||||
sanlock: fix locking for readonly devices
|
||||
|
||||
Add ignore param for readonly and shared disk in sanlock
|
||||
|
||||
diff --git a/src/locking/libvirt_sanlock.aug b/src/locking/libvirt_sanlock.aug
|
||||
index 5f5f8a1..d65b002 100644
|
||||
--- a/src/locking/libvirt_sanlock.aug
|
||||
+++ b/src/locking/libvirt_sanlock.aug
|
||||
@@ -21,6 +21,7 @@ module Libvirt_sanlock =
|
||||
| bool_entry "auto_disk_leases"
|
||||
| int_entry "host_id"
|
||||
| bool_entry "require_lease_for_disks"
|
||||
+ | bool_entry "ignore_readonly_and_shared_disks"
|
||||
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
|
||||
let empty = [ label "#empty" . eol ]
|
||||
|
||||
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
|
||||
index d344d6a..146aefd 100644
|
||||
--- a/src/locking/lock_driver_sanlock.c
|
||||
+++ b/src/locking/lock_driver_sanlock.c
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* lock_driver_sanlock.c: A lock driver for Sanlock
|
||||
*
|
||||
- * Copyright (C) 2010-2011 Red Hat, Inc.
|
||||
+ * Copyright (C) 2010-2012 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -65,6 +65,7 @@ struct _virLockManagerSanlockDriver {
|
||||
bool requireLeaseForDisks;
|
||||
int hostID;
|
||||
bool autoDiskLease;
|
||||
+ bool ignoreReadonlyShared;
|
||||
char *autoDiskLeasePath;
|
||||
};
|
||||
|
||||
@@ -114,6 +115,10 @@ static int virLockManagerSanlockLoadConfig(const char *configFile)
|
||||
CHECK_TYPE("auto_disk_leases", VIR_CONF_LONG);
|
||||
if (p) driver->autoDiskLease = p->l;
|
||||
|
||||
+ p = virConfGetValue(conf, "ignore_readonly_and_shared_disks");
|
||||
+ CHECK_TYPE("ignore_readonly_and_shared_disks", VIR_CONF_LONG);
|
||||
+ if (p) driver->ignoreReadonlyShared = p->l;
|
||||
+
|
||||
p = virConfGetValue(conf, "disk_lease_dir");
|
||||
CHECK_TYPE("disk_lease_dir", VIR_CONF_STRING);
|
||||
if (p && p->str) {
|
||||
@@ -625,6 +630,12 @@ static int virLockManagerSanlockAddResource(virLockManagerPtr lock,
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ if ((flags & (VIR_LOCK_MANAGER_RESOURCE_READONLY |
|
||||
+ VIR_LOCK_MANAGER_RESOURCE_SHARED)) &&
|
||||
+ driver->ignoreReadonlyShared) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
if (flags & VIR_LOCK_MANAGER_RESOURCE_READONLY) {
|
||||
virLockError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Readonly leases are not supported"));
|
||||
diff --git a/src/locking/sanlock.conf b/src/locking/sanlock.conf
|
||||
index efc35ee..19ab2b3 100644
|
||||
--- a/src/locking/sanlock.conf
|
||||
+++ b/src/locking/sanlock.conf
|
||||
@@ -52,3 +52,10 @@
|
||||
# to enabled, otherwise it defaults to disabled.
|
||||
#
|
||||
#require_lease_for_disks = 1
|
||||
+
|
||||
+#
|
||||
+# Enable this flag to have sanlock ignore readonly and shared disks.
|
||||
+# If disabled, then this rejects attempts to share resources until
|
||||
+# sanlock gains support for shared locks.
|
||||
+#
|
||||
+#ignore_readonly_and_shared_disks = 1
|
||||
commit acbd4965c44c4dbc676dfe89aff970052e376073
|
||||
Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
Date: Thu Jun 21 15:34:46 2012 +0100
|
||||
|
||||
Add support for shared sanlock leases
|
||||
|
||||
A sanlock lease can be marked as shared (rather
|
||||
than exclusive) using SANLK_RES_SHARED flag. This
|
||||
adds support for that flag and ensures that in auto
|
||||
disk mode, any shared disks use shared leases. This
|
||||
also makes any read-only disks be completely
|
||||
ignored.
|
||||
|
||||
These changes remove the need for the option
|
||||
|
||||
ignore_readonly_and_shared_disks
|
||||
|
||||
so that is removed
|
||||
|
||||
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
|
||||
index 146aefd..16941c9 100644
|
||||
--- a/src/locking/lock_driver_sanlock.c
|
||||
+++ b/src/locking/lock_driver_sanlock.c
|
||||
@@ -65,7 +65,6 @@ struct _virLockManagerSanlockDriver {
|
||||
bool requireLeaseForDisks;
|
||||
int hostID;
|
||||
bool autoDiskLease;
|
||||
- bool ignoreReadonlyShared;
|
||||
char *autoDiskLeasePath;
|
||||
};
|
||||
|
||||
@@ -115,10 +114,6 @@ static int virLockManagerSanlockLoadConfig(const char *configFile)
|
||||
CHECK_TYPE("auto_disk_leases", VIR_CONF_LONG);
|
||||
if (p) driver->autoDiskLease = p->l;
|
||||
|
||||
- p = virConfGetValue(conf, "ignore_readonly_and_shared_disks");
|
||||
- CHECK_TYPE("ignore_readonly_and_shared_disks", VIR_CONF_LONG);
|
||||
- if (p) driver->ignoreReadonlyShared = p->l;
|
||||
-
|
||||
p = virConfGetValue(conf, "disk_lease_dir");
|
||||
CHECK_TYPE("disk_lease_dir", VIR_CONF_STRING);
|
||||
if (p && p->str) {
|
||||
@@ -428,7 +423,8 @@ static int virLockManagerSanlockDiskLeaseName(const char *path,
|
||||
static int virLockManagerSanlockAddLease(virLockManagerPtr lock,
|
||||
const char *name,
|
||||
size_t nparams,
|
||||
- virLockManagerParamPtr params)
|
||||
+ virLockManagerParamPtr params,
|
||||
+ bool shared)
|
||||
{
|
||||
virLockManagerSanlockPrivatePtr priv = lock->privateData;
|
||||
int ret = -1;
|
||||
@@ -440,6 +436,7 @@ static int virLockManagerSanlockAddLease(virLockManagerPtr lock,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ res->flags = shared ? SANLK_RES_SHARED : 0;
|
||||
res->num_disks = 1;
|
||||
if (!virStrcpy(res->name, name, SANLK_NAME_LEN)) {
|
||||
virLockError(VIR_ERR_INTERNAL_ERROR,
|
||||
@@ -485,7 +482,8 @@ cleanup:
|
||||
static int virLockManagerSanlockAddDisk(virLockManagerPtr lock,
|
||||
const char *name,
|
||||
size_t nparams,
|
||||
- virLockManagerParamPtr params ATTRIBUTE_UNUSED)
|
||||
+ virLockManagerParamPtr params ATTRIBUTE_UNUSED,
|
||||
+ bool shared)
|
||||
{
|
||||
virLockManagerSanlockPrivatePtr priv = lock->privateData;
|
||||
int ret = -1;
|
||||
@@ -503,6 +501,7 @@ static int virLockManagerSanlockAddDisk(virLockManagerPtr lock,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ res->flags = shared ? SANLK_RES_SHARED : 0;
|
||||
res->num_disks = 1;
|
||||
if (virLockManagerSanlockDiskLeaseName(name, res->name, SANLK_NAME_LEN) < 0)
|
||||
goto cleanup;
|
||||
@@ -630,27 +629,15 @@ static int virLockManagerSanlockAddResource(virLockManagerPtr lock,
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if ((flags & (VIR_LOCK_MANAGER_RESOURCE_READONLY |
|
||||
- VIR_LOCK_MANAGER_RESOURCE_SHARED)) &&
|
||||
- driver->ignoreReadonlyShared) {
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- if (flags & VIR_LOCK_MANAGER_RESOURCE_READONLY) {
|
||||
- virLockError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
- _("Readonly leases are not supported"));
|
||||
- return -1;
|
||||
- }
|
||||
- if (flags & VIR_LOCK_MANAGER_RESOURCE_SHARED) {
|
||||
- virLockError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
- _("Shareable leases are not supported"));
|
||||
- return -1;
|
||||
- }
|
||||
+ /* Treat R/O resources as a no-op lock request */
|
||||
+ if (flags & VIR_LOCK_MANAGER_RESOURCE_READONLY)
|
||||
+ return 0;
|
||||
|
||||
switch (type) {
|
||||
case VIR_LOCK_MANAGER_RESOURCE_TYPE_DISK:
|
||||
if (driver->autoDiskLease) {
|
||||
- if (virLockManagerSanlockAddDisk(lock, name, nparams, params) < 0)
|
||||
+ if (virLockManagerSanlockAddDisk(lock, name, nparams, params,
|
||||
+ !!(flags & VIR_LOCK_MANAGER_RESOURCE_SHARED)) < 0)
|
||||
return -1;
|
||||
|
||||
if (virLockManagerSanlockCreateLease(priv->res_args[priv->res_count-1]) < 0)
|
||||
@@ -664,7 +651,8 @@ static int virLockManagerSanlockAddResource(virLockManagerPtr lock,
|
||||
break;
|
||||
|
||||
case VIR_LOCK_MANAGER_RESOURCE_TYPE_LEASE:
|
||||
- if (virLockManagerSanlockAddLease(lock, name, nparams, params) < 0)
|
||||
+ if (virLockManagerSanlockAddLease(lock, name, nparams, params,
|
||||
+ !!(flags & VIR_LOCK_MANAGER_RESOURCE_SHARED)) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
diff --git a/src/locking/sanlock.conf b/src/locking/sanlock.conf
|
||||
index 19ab2b3..efc35ee 100644
|
||||
--- a/src/locking/sanlock.conf
|
||||
+++ b/src/locking/sanlock.conf
|
||||
@@ -52,10 +52,3 @@
|
||||
# to enabled, otherwise it defaults to disabled.
|
||||
#
|
||||
#require_lease_for_disks = 1
|
||||
-
|
||||
-#
|
||||
-# Enable this flag to have sanlock ignore readonly and shared disks.
|
||||
-# If disabled, then this rejects attempts to share resources until
|
||||
-# sanlock gains support for shared locks.
|
||||
-#
|
||||
-#ignore_readonly_and_shared_disks = 1
|
673
libvirt.spec
673
libvirt.spec
|
@ -22,7 +22,7 @@
|
|||
|
||||
# RHEL-5 builds are client-only for s390, ppc
|
||||
%if 0%{?rhel} == 5
|
||||
%ifnarch i386 i586 i686 x86_64 ia64
|
||||
%ifnarch %{ix86} x86_64 ia64
|
||||
%define client_only 1
|
||||
%endif
|
||||
%endif
|
||||
|
@ -42,23 +42,31 @@
|
|||
%define with_libvirtd 0%{!?_without_libvirtd:%{server_drivers}}
|
||||
%define with_avahi 0%{!?_without_avahi:%{server_drivers}}
|
||||
|
||||
# Then the hypervisor drivers that run on local host
|
||||
# Then the hypervisor drivers that run in libvirtd
|
||||
%define with_xen 0%{!?_without_xen:%{server_drivers}}
|
||||
%define with_qemu 0%{!?_without_qemu:%{server_drivers}}
|
||||
%define with_openvz 0%{!?_without_openvz:%{server_drivers}}
|
||||
%define with_lxc 0%{!?_without_lxc:%{server_drivers}}
|
||||
%define with_vbox 0%{!?_without_vbox:%{server_drivers}}
|
||||
%define with_uml 0%{!?_without_uml:%{server_drivers}}
|
||||
%define with_libxl 0%{!?_without_libxl:%{server_drivers}}
|
||||
%define with_vmware 0%{!?_without_vmware:%{server_drivers}}
|
||||
|
||||
# Then the hypervisor drivers that talk via a native remote protocol
|
||||
%define with_qemu_tcg %{with_qemu}
|
||||
# Change if we ever provide qemu-kvm binaries on non-x86 hosts
|
||||
%ifarch %{ix86} x86_64
|
||||
%define with_qemu_kvm %{with_qemu}
|
||||
%else
|
||||
%define with_qemu_kvm 0
|
||||
%endif
|
||||
|
||||
# Then the hypervisor drivers that run outside libvirtd, in libvirt.so
|
||||
%define with_openvz 0%{!?_without_openvz:1}
|
||||
%define with_vbox 0%{!?_without_vbox:1}
|
||||
%define with_vmware 0%{!?_without_vmware:1}
|
||||
%define with_phyp 0%{!?_without_phyp:1}
|
||||
%define with_esx 0%{!?_without_esx:1}
|
||||
%define with_hyperv 0%{!?_without_hyperv:1}
|
||||
%define with_xenapi 0%{!?_without_xenapi:1}
|
||||
|
||||
# Then the secondary host drivers
|
||||
# Then the secondary host drivers, which run inside libvirtd
|
||||
%define with_network 0%{!?_without_network:%{server_drivers}}
|
||||
%define with_storage_fs 0%{!?_without_storage_fs:%{server_drivers}}
|
||||
%define with_storage_lvm 0%{!?_without_storage_lvm:%{server_drivers}}
|
||||
|
@ -84,6 +92,7 @@
|
|||
%define with_cgconfig 0%{!?_without_cgconfig:0}
|
||||
%define with_sanlock 0%{!?_without_sanlock:0}
|
||||
%define with_systemd 0%{!?_without_systemd:0}
|
||||
%define with_numad 0%{!?_without_numad:0}
|
||||
|
||||
# Non-server/HV driver defaults which are always enabled
|
||||
%define with_python 0%{!?_without_python:1}
|
||||
|
@ -93,7 +102,7 @@
|
|||
# Finally set the OS / architecture specific special cases
|
||||
|
||||
# Xen is available only on i386 x86_64 ia64
|
||||
%ifnarch i386 i586 i686 x86_64 ia64
|
||||
%ifnarch %{ix86} x86_64 ia64
|
||||
%define with_xen 0
|
||||
%define with_libxl 0
|
||||
%endif
|
||||
|
@ -117,15 +126,18 @@
|
|||
%define with_hyperv 0
|
||||
%endif
|
||||
|
||||
# Although earlier Fedora has systemd, libvirt still used sysvinit
|
||||
%if 0%{?fedora} >= 17
|
||||
# Fedora 17 / RHEL-7 are first where we use systemd. Although earlier
|
||||
# Fedora has systemd, libvirt still used sysvinit there.
|
||||
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
|
||||
%define with_systemd 1
|
||||
%endif
|
||||
|
||||
# RHEL-5 has restricted QEMU to x86_64 only and is too old for LXC
|
||||
%if 0%{?rhel} == 5
|
||||
%define with_qemu_tcg 0
|
||||
%ifnarch x86_64
|
||||
%define with_qemu 0
|
||||
%define with_qemu_kvm 0
|
||||
%endif
|
||||
%define with_lxc 0
|
||||
%endif
|
||||
|
@ -133,14 +145,16 @@
|
|||
# RHEL-6 has restricted QEMU to x86_64 only, stopped including Xen
|
||||
# on all archs. Other archs all have LXC available though
|
||||
%if 0%{?rhel} >= 6
|
||||
%define with_qemu_tcg 0
|
||||
%ifnarch x86_64
|
||||
%define with_qemu 0
|
||||
%define with_qemu_kvm 0
|
||||
%endif
|
||||
%define with_xen 0
|
||||
%endif
|
||||
|
||||
# Fedora doesn't have any QEMU on ppc64 - only ppc
|
||||
%if 0%{?fedora}
|
||||
# Fedora doesn't have any QEMU on ppc64 until FC16 - only ppc
|
||||
%if 0%{?fedora} && 0%{?fedora} < 16
|
||||
%ifarch ppc64
|
||||
%define with_qemu 0
|
||||
%endif
|
||||
|
@ -184,7 +198,7 @@
|
|||
%define with_sanlock 0%{!?_without_sanlock:%{server_drivers}}
|
||||
%endif
|
||||
%if 0%{?rhel} >= 6
|
||||
%ifarch i386 i586 i686 x86_64
|
||||
%ifarch %{ix86} x86_64
|
||||
%define with_sanlock 0%{!?_without_sanlock:%{server_drivers}}
|
||||
%endif
|
||||
%endif
|
||||
|
@ -205,11 +219,19 @@
|
|||
%define with_storage_disk 0
|
||||
%endif
|
||||
|
||||
# Enable libpcap library
|
||||
%if %{with_qemu}
|
||||
%if %{with_qemu} || %{with_lxc} || %{with_uml}
|
||||
%define with_nwfilter 0%{!?_without_nwfilter:%{server_drivers}}
|
||||
# Enable libpcap library
|
||||
%define with_libpcap 0%{!?_without_libpcap:%{server_drivers}}
|
||||
%define with_macvtap 0%{!?_without_macvtap:%{server_drivers}}
|
||||
|
||||
# numad is used to manage the CPU and memory placement dynamically,
|
||||
# it's not available on s390[x] and ARM.
|
||||
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 6
|
||||
%ifnarch s390 s390x %{arm}
|
||||
%define with_numad 0%{!?_without_numad:%{server_drivers}}
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if %{with_macvtap}
|
||||
|
@ -251,114 +273,51 @@
|
|||
|
||||
Summary: Library providing a simple virtualization API
|
||||
Name: libvirt
|
||||
Version: 0.9.10
|
||||
Version: 0.9.11.10
|
||||
Release: 1%{?dist}%{?extra_release}
|
||||
License: LGPLv2+
|
||||
Group: Development/Libraries
|
||||
Source: http://libvirt.org/sources/libvirt-%{version}.tar.gz
|
||||
|
||||
%if %(echo %{version} | grep -o \\. | wc -l) == 3
|
||||
%define mainturl stable_updates/
|
||||
%endif
|
||||
Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz
|
||||
|
||||
# Replace fedora-13->pc-0.14 to prep for qemu removal (bz #754772)
|
||||
# keep: keeping this for the lifetime of F17, gone for newer releases
|
||||
Patch1: libvirt-qemu-replace-deprecated-fedora-13-machine.patch
|
||||
# Add usbredir spice channel (bz #821469)
|
||||
# keep: fedora feature backport that won't hit 0.9.11 maint
|
||||
Patch2: libvirt-add-usbredir-spice-channel.patch
|
||||
# Add default spice channel (bz #821474)
|
||||
# keep: fedora feature backport that won't hit 0.9.11 maint
|
||||
Patch3: libvirt-add-default-spice-channel.patch
|
||||
# sanlock: Add param to ignore readonly/shared disks (bz #828633)
|
||||
# keep: 0.9.12 feature backport for vdsm, won't hit -maint
|
||||
Patch4: libvirt-sanlock-readonly-option.patch
|
||||
# Fix LXC domain startup with selinux=disabled (bz #858104)
|
||||
# keep: non upstream fix that doesn't apply to git head
|
||||
Patch5: libvirt-lxc-selinux-context-error.patch
|
||||
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
URL: http://libvirt.org/
|
||||
|
||||
# All runtime requirements for the libvirt package (runtime requrements
|
||||
# for subpackages are listed later in those subpackages)
|
||||
|
||||
# The client side, i.e. shared libs and virsh are in a subpackage
|
||||
Requires: %{name}-client = %{version}-%{release}
|
||||
|
||||
# Used by many of the drivers, so turn it on whenever the
|
||||
# daemon is present
|
||||
%if %{with_libvirtd}
|
||||
# for modprobe of pci devices
|
||||
Requires: module-init-tools
|
||||
# for /sbin/ip & /sbin/tc
|
||||
Requires: iproute
|
||||
%if %{with_avahi}
|
||||
Requires: avahi-libs
|
||||
%endif
|
||||
%endif
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
%if %{with_network}
|
||||
Requires: dnsmasq >= 2.41
|
||||
Requires: radvd
|
||||
%endif
|
||||
%if %{with_network} || %{with_nwfilter}
|
||||
Requires: iptables
|
||||
Requires: iptables-ipv6
|
||||
Requires: libvirt-daemon-config-network = %{version}-%{release}
|
||||
%endif
|
||||
%if %{with_nwfilter}
|
||||
Requires: ebtables
|
||||
Requires: libvirt-daemon-config-nwfilter = %{version}-%{release}
|
||||
%endif
|
||||
# needed for device enumeration
|
||||
%if %{with_hal}
|
||||
Requires: hal
|
||||
%endif
|
||||
%if %{with_udev}
|
||||
Requires: udev >= 145
|
||||
%endif
|
||||
%if %{with_polkit}
|
||||
%if 0%{?fedora} >= 12 || 0%{?rhel} >=6
|
||||
Requires: polkit >= 0.93
|
||||
%else
|
||||
Requires: PolicyKit >= 0.6
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_storage_fs}
|
||||
Requires: nfs-utils
|
||||
# For mkfs
|
||||
Requires: util-linux-ng
|
||||
# For pool-build probing for existing pools
|
||||
BuildRequires: libblkid-devel >= 2.17
|
||||
# For glusterfs
|
||||
%if 0%{?fedora} >= 11
|
||||
Requires: glusterfs-client >= 2.0.1
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_qemu}
|
||||
# From QEMU RPMs
|
||||
Requires: /usr/bin/qemu-img
|
||||
# For image compression
|
||||
Requires: gzip
|
||||
Requires: bzip2
|
||||
Requires: lzop
|
||||
Requires: xz
|
||||
%else
|
||||
%if %{with_xen}
|
||||
# From Xen RPMs
|
||||
Requires: /usr/sbin/qcow-create
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_storage_lvm}
|
||||
# For LVM drivers
|
||||
Requires: lvm2
|
||||
%endif
|
||||
%if %{with_storage_iscsi}
|
||||
# For ISCSI driver
|
||||
Requires: iscsi-initiator-utils
|
||||
%endif
|
||||
%if %{with_storage_disk}
|
||||
# For disk driver
|
||||
Requires: parted
|
||||
Requires: device-mapper
|
||||
%endif
|
||||
%if %{with_storage_mpath}
|
||||
# For multipath support
|
||||
Requires: device-mapper
|
||||
%endif
|
||||
%if %{with_cgconfig}
|
||||
Requires: libcgroup
|
||||
%endif
|
||||
%ifarch i386 i586 i686 x86_64 ia64
|
||||
# For virConnectGetSysinfo
|
||||
Requires: dmidecode
|
||||
%endif
|
||||
# For service management
|
||||
%if %{with_systemd}
|
||||
Requires(post): systemd-units
|
||||
Requires(post): systemd-sysv
|
||||
Requires(preun): systemd-units
|
||||
Requires(postun): systemd-units
|
||||
# XXX when we turn on driver modules, we need to add
|
||||
# deps on each driver (Requires: libvirt-daemon-drv-qemu)
|
||||
%endif
|
||||
Requires: libvirt-client = %{version}-%{release}
|
||||
|
||||
# All build-time requirements
|
||||
# All build-time requirements. Run-time requirements are
|
||||
# listed against each sub-RPM
|
||||
%if 0%{?enable_autotools}
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
|
@ -388,7 +347,11 @@ BuildRequires: augeas
|
|||
BuildRequires: hal-devel
|
||||
%endif
|
||||
%if %{with_udev}
|
||||
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
|
||||
BuildRequires: systemd-devel >= 185
|
||||
%else
|
||||
BuildRequires: libudev-devel >= 145
|
||||
%endif
|
||||
BuildRequires: libpciaccess-devel >= 0.10.9
|
||||
%endif
|
||||
%if %{with_yajl}
|
||||
|
@ -513,11 +476,231 @@ BuildRequires: nfs-utils
|
|||
# Fedora build root suckage
|
||||
BuildRequires: gawk
|
||||
|
||||
# For storage wiping with different algorithms
|
||||
BuildRequires: scrub
|
||||
|
||||
%if %{with_numad}
|
||||
BuildRequires: numad
|
||||
%endif
|
||||
|
||||
Provides: bundled(gnulib)
|
||||
|
||||
%description
|
||||
Libvirt is a C toolkit to interact with the virtualization capabilities
|
||||
of recent versions of Linux (and other OSes). The main package includes
|
||||
the libvirtd server exporting the virtualization support.
|
||||
|
||||
%package docs
|
||||
Summary: API reference and website documentation
|
||||
Group: Development/Libraries
|
||||
|
||||
%description docs
|
||||
Includes the API reference for the libvirt C library, and a complete
|
||||
copy of the libvirt.org website documentation.
|
||||
|
||||
%if %{with_libvirtd}
|
||||
%package daemon
|
||||
Summary: Server side daemon and supporting files for libvirt library
|
||||
Group: Development/Libraries
|
||||
|
||||
# All runtime requirements for the libvirt package (runtime requrements
|
||||
# for subpackages are listed later in those subpackages)
|
||||
|
||||
# The client side, i.e. shared libs and virsh are in a subpackage
|
||||
Requires: %{name}-client = %{version}-%{release}
|
||||
|
||||
# for modprobe of pci devices
|
||||
Requires: module-init-tools
|
||||
# for /sbin/ip & /sbin/tc
|
||||
Requires: iproute
|
||||
%if %{with_avahi}
|
||||
Requires: avahi-libs
|
||||
%endif
|
||||
%if %{with_network}
|
||||
Requires: dnsmasq >= 2.41
|
||||
Requires: radvd
|
||||
%endif
|
||||
%if %{with_network} || %{with_nwfilter}
|
||||
Requires: iptables
|
||||
Requires: iptables-ipv6
|
||||
%endif
|
||||
%if %{with_nwfilter}
|
||||
Requires: ebtables
|
||||
%endif
|
||||
# needed for device enumeration
|
||||
%if %{with_hal}
|
||||
Requires: hal
|
||||
%endif
|
||||
%if %{with_udev}
|
||||
Requires: udev >= 145
|
||||
%endif
|
||||
%if %{with_polkit}
|
||||
%if 0%{?fedora} >= 12 || 0%{?rhel} >=6
|
||||
Requires: polkit >= 0.93
|
||||
%else
|
||||
Requires: PolicyKit >= 0.6
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_storage_fs}
|
||||
Requires: nfs-utils
|
||||
# For mkfs
|
||||
Requires: util-linux-ng
|
||||
# For pool-build probing for existing pools
|
||||
BuildRequires: libblkid-devel >= 2.17
|
||||
# For glusterfs
|
||||
%if 0%{?fedora} >= 11
|
||||
Requires: glusterfs-client >= 2.0.1
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_qemu}
|
||||
# From QEMU RPMs
|
||||
Requires: /usr/bin/qemu-img
|
||||
# For image compression
|
||||
Requires: gzip
|
||||
Requires: bzip2
|
||||
Requires: lzop
|
||||
Requires: xz
|
||||
%else
|
||||
%if %{with_xen}
|
||||
# From Xen RPMs
|
||||
Requires: /usr/sbin/qcow-create
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_storage_lvm}
|
||||
# For LVM drivers
|
||||
Requires: lvm2
|
||||
%endif
|
||||
%if %{with_storage_iscsi}
|
||||
# For ISCSI driver
|
||||
Requires: iscsi-initiator-utils
|
||||
%endif
|
||||
%if %{with_storage_disk}
|
||||
# For disk driver
|
||||
Requires: parted
|
||||
Requires: device-mapper
|
||||
%endif
|
||||
%if %{with_storage_mpath}
|
||||
# For multipath support
|
||||
Requires: device-mapper
|
||||
%endif
|
||||
%if %{with_cgconfig}
|
||||
Requires: libcgroup
|
||||
%endif
|
||||
%ifarch %{ix86} x86_64 ia64
|
||||
# For virConnectGetSysinfo
|
||||
Requires: dmidecode
|
||||
%endif
|
||||
# For service management
|
||||
%if %{with_systemd}
|
||||
Requires(post): systemd-units
|
||||
Requires(post): systemd-sysv
|
||||
Requires(preun): systemd-units
|
||||
Requires(postun): systemd-units
|
||||
%endif
|
||||
%if %{with_numad}
|
||||
Requires: numad
|
||||
%endif
|
||||
|
||||
%description daemon
|
||||
Server side daemon required to manage the virtualization capabilities
|
||||
of recent versions of Linux. Requires a hypervisor specific sub-RPM
|
||||
for specific drivers.
|
||||
|
||||
%if %{with_network}
|
||||
%package daemon-config-network
|
||||
Summary: Default configuration files for the libvirtd daemon
|
||||
Group: Development/Libraries
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
|
||||
%description daemon-config-network
|
||||
Default configuration files for setting up NAT based networking
|
||||
%endif
|
||||
|
||||
%if %{with_nwfilter}
|
||||
%package daemon-config-nwfilter
|
||||
Summary: Network filter configuration files for the libvirtd daemon
|
||||
Group: Development/Libraries
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
|
||||
%description daemon-config-nwfilter
|
||||
Network filter configuration files for cleaning guest traffic
|
||||
%endif
|
||||
|
||||
# XXX when we turn on driver modules, we will need to
|
||||
# create daemon-drv-XXX sub-RPMs and add them as deps
|
||||
# to all of the following daemon-XXX RPMs
|
||||
|
||||
%if %{with_qemu_tcg}
|
||||
%package daemon-qemu
|
||||
Summary: Server side daemon & driver required to run QEMU guests
|
||||
Group: Development/Libraries
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: qemu
|
||||
|
||||
%description daemon-qemu
|
||||
Server side daemon and driver required to manage the virtualization
|
||||
capabilities of the QEMU TCG emulators
|
||||
%endif
|
||||
|
||||
|
||||
%if %{with_qemu_kvm}
|
||||
%package daemon-kvm
|
||||
Summary: Server side daemon & driver required to run KVM guests
|
||||
Group: Development/Libraries
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: qemu-kvm
|
||||
|
||||
%description daemon-kvm
|
||||
Server side daemon and driver required to manage the virtualization
|
||||
capabilities of the KVM hypervisor
|
||||
%endif
|
||||
|
||||
|
||||
%if %{with_lxc}
|
||||
%package daemon-lxc
|
||||
Summary: Server side daemon & driver required to run LXC guests
|
||||
Group: Development/Libraries
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
|
||||
%description daemon-lxc
|
||||
Server side daemon and driver required to manage the virtualization
|
||||
capabilities of LXC
|
||||
%endif
|
||||
|
||||
|
||||
%if %{with_uml}
|
||||
%package daemon-uml
|
||||
Summary: Server side daemon & driver required to run UML guests
|
||||
Group: Development/Libraries
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
# There are no UML kernel RPMs in Fedora/RHEL to depend on.
|
||||
|
||||
%description daemon-uml
|
||||
Server side daemon and driver required to manage the virtualization
|
||||
capabilities of UML
|
||||
%endif
|
||||
|
||||
|
||||
%if %{with_xen} || %{with_libxl}
|
||||
%package daemon-xen
|
||||
Summary: Server side daemon & driver required to run XEN guests
|
||||
Group: Development/Libraries
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
Requires: xen
|
||||
|
||||
%description daemon-xen
|
||||
Server side daemon and driver required to manage the virtualization
|
||||
capabilities of XEN
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package client
|
||||
Summary: Client side library and utilities of the libvirt library
|
||||
Group: Development/Libraries
|
||||
|
@ -547,14 +730,11 @@ virtualization capabilities of recent versions of Linux (and other OSes).
|
|||
Summary: Libraries, includes, etc. to compile with the libvirt library
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}-client = %{version}-%{release}
|
||||
Requires: %{name}-docs = %{version}-%{release}
|
||||
Requires: pkgconfig
|
||||
%if %{with_xen}
|
||||
Requires: xen-devel
|
||||
%endif
|
||||
|
||||
%description devel
|
||||
Includes and documentations for the C library providing an API to use
|
||||
the virtualization capabilities of recent versions of Linux (and other OSes).
|
||||
Include header files & development libraries for the libvirt C library.
|
||||
|
||||
%if %{with_sanlock}
|
||||
%package lock-sanlock
|
||||
|
@ -563,7 +743,7 @@ Group: Development/Libraries
|
|||
Requires: sanlock >= 1.8
|
||||
#for virt-sanlock-cleanup require augeas
|
||||
Requires: augeas
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name}-daemon = %{version}-%{release}
|
||||
|
||||
%description lock-sanlock
|
||||
Includes the Sanlock lock manager plugin for the QEMU
|
||||
|
@ -586,6 +766,22 @@ of recent versions of Linux (and other OSes).
|
|||
%prep
|
||||
%setup -q
|
||||
|
||||
# Replace fedora-13->pc-0.14 to prep for qemu removal (bz #754772)
|
||||
# keep: keeping this for the lifetime of F17, gone for newer releases
|
||||
%patch1 -p1
|
||||
# Add usbredir spice channel (bz #821469)
|
||||
# keep: fedora feature backport that won't hit 0.9.11 maint
|
||||
%patch2 -p1
|
||||
# Add default spice channel (bz #821474)
|
||||
# keep: fedora feature backport that won't hit 0.9.11 maint
|
||||
%patch3 -p1
|
||||
# sanlock: Add param to ignore readonly/shared disks (bz #828633)
|
||||
# keep: 0.9.12 feature backport for vdsm, won't hit -maint
|
||||
%patch4 -p1
|
||||
# Fix LXC domain startup with selinux=disabled (bz #858104)
|
||||
# keep: non upstream fix that doesn't apply to git head
|
||||
%patch5 -p1
|
||||
|
||||
%build
|
||||
%if ! %{with_xen}
|
||||
%define _without_xen --without-xen
|
||||
|
@ -687,6 +883,10 @@ of recent versions of Linux (and other OSes).
|
|||
%define _without_numactl --without-numactl
|
||||
%endif
|
||||
|
||||
%if ! %{with_numad}
|
||||
%define _without_numad --without-numad
|
||||
%endif
|
||||
|
||||
%if ! %{with_capng}
|
||||
%define _without_capng --without-capng
|
||||
%endif
|
||||
|
@ -753,6 +953,7 @@ autoreconf -if
|
|||
%{?_without_openvz} \
|
||||
%{?_without_lxc} \
|
||||
%{?_without_vbox} \
|
||||
%{?_without_libxl} \
|
||||
%{?_without_xenapi} \
|
||||
%{?_without_sasl} \
|
||||
%{?_without_avahi} \
|
||||
|
@ -772,6 +973,7 @@ autoreconf -if
|
|||
%{?_without_storage_disk} \
|
||||
%{?_without_storage_mpath} \
|
||||
%{?_without_numactl} \
|
||||
%{?_without_numad} \
|
||||
%{?_without_capng} \
|
||||
%{?_without_netcf} \
|
||||
%{?_without_selinux} \
|
||||
|
@ -787,8 +989,7 @@ autoreconf -if
|
|||
%{with_packager_version} \
|
||||
--with-qemu-user=%{qemu_user} \
|
||||
--with-qemu-group=%{qemu_group} \
|
||||
%{init_scripts} \
|
||||
--with-remote-pid-file=%{_localstatedir}/run/libvirtd.pid
|
||||
%{init_scripts}
|
||||
make %{?_smp_mflags}
|
||||
gzip -9 ChangeLog
|
||||
|
||||
|
@ -838,16 +1039,6 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
|
|||
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-python-%{version}
|
||||
%endif
|
||||
|
||||
%if %{client_only}
|
||||
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version}
|
||||
%endif
|
||||
|
||||
%if ! %{with_libvirtd}
|
||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter
|
||||
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version}/html \
|
||||
$RPM_BUILD_ROOT%{_datadir}/doc/libvirt-devel-%{version}/
|
||||
%endif
|
||||
|
||||
%if ! %{with_qemu}
|
||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
|
||||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
|
||||
|
@ -860,6 +1051,16 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
|
|||
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
|
||||
%endif
|
||||
|
||||
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} \
|
||||
$RPM_BUILD_ROOT%{_datadir}/doc/libvirt-docs-%{version}
|
||||
|
||||
%if %{with_dtrace}
|
||||
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
|
||||
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes.stp \
|
||||
$RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes-64.stp
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%clean
|
||||
rm -fr %{buildroot}
|
||||
|
||||
|
@ -874,7 +1075,8 @@ do
|
|||
done
|
||||
make check
|
||||
|
||||
%pre
|
||||
%if %{with_libvirtd}
|
||||
%pre daemon
|
||||
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
|
||||
# Normally 'setup' adds this in /etc/passwd, but this is
|
||||
# here for case of upgrades from earlier Fedora/RHEL. This
|
||||
|
@ -886,22 +1088,9 @@ getent passwd qemu >/dev/null || \
|
|||
-c "qemu user" qemu
|
||||
%endif
|
||||
|
||||
%post
|
||||
%post daemon
|
||||
|
||||
%if %{with_libvirtd}
|
||||
%if %{with_network}
|
||||
# We want to install the default network for initial RPM installs
|
||||
# or on the first upgrade from a non-network aware libvirt only.
|
||||
# We check this by looking to see if the daemon is already installed
|
||||
if ! /sbin/chkconfig libvirtd && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml
|
||||
then
|
||||
UUID=`/usr/bin/uuidgen`
|
||||
sed -e "s,</name>,</name>\n <uuid>$UUID</uuid>," \
|
||||
< %{_datadir}/libvirt/networks/default.xml \
|
||||
> %{_sysconfdir}/libvirt/qemu/networks/default.xml
|
||||
ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
|
||||
fi
|
||||
|
||||
# All newly defined networks will have a mac address for the bridge
|
||||
# auto-generated, but networks already existing at the time of upgrade
|
||||
# will not. We need to go through all the network configs, look for
|
||||
|
@ -951,9 +1140,9 @@ if [ $1 -eq 1 ] ; then
|
|||
fi
|
||||
%else
|
||||
%if %{with_cgconfig}
|
||||
# Starting with Fedora 16, systemd automounts all cgroups, and cgconfig is
|
||||
# no longer a necessary service.
|
||||
%if 0%{?rhel} || (0%{?fedora} && 0%{?fedora} < 16)
|
||||
# Starting with Fedora 16/RHEL-7, systemd automounts all cgroups,
|
||||
# and cgconfig is no longer a necessary service.
|
||||
%if (0%{?rhel} && 0%{?rhel} < 7) || (0%{?fedora} && 0%{?fedora} < 16)
|
||||
if [ "$1" -eq "1" ]; then
|
||||
/sbin/chkconfig cgconfig on
|
||||
fi
|
||||
|
@ -965,10 +1154,8 @@ if [ "$1" -ge "1" ]; then
|
|||
/sbin/service libvirtd condrestart > /dev/null 2>&1
|
||||
fi
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%preun
|
||||
%if %{with_libvirtd}
|
||||
%preun daemon
|
||||
%if %{with_systemd}
|
||||
if [ $1 -eq 0 ] ; then
|
||||
# Package removal, not upgrade
|
||||
|
@ -981,10 +1168,8 @@ if [ $1 = 0 ]; then
|
|||
/sbin/chkconfig --del libvirtd
|
||||
fi
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%postun
|
||||
%if %{with_libvirtd}
|
||||
%postun daemon
|
||||
%if %{with_systemd}
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
if [ $1 -ge 1 ] ; then
|
||||
|
@ -992,6 +1177,17 @@ if [ $1 -ge 1 ] ; then
|
|||
/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
%endif
|
||||
|
||||
%if %{with_network}
|
||||
%post daemon-config-network
|
||||
if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
|
||||
UUID=`/usr/bin/uuidgen`
|
||||
sed -e "s,</name>,</name>\n <uuid>$UUID</uuid>," \
|
||||
< %{_datadir}/libvirt/networks/default.xml \
|
||||
> %{_sysconfdir}/libvirt/qemu/networks/default.xml
|
||||
ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
|
||||
fi
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if %{with_libvirtd}
|
||||
|
@ -1024,14 +1220,6 @@ fi
|
|||
%if %{with_systemd}
|
||||
%else
|
||||
/sbin/chkconfig --add libvirt-guests
|
||||
if [ $1 -ge 1 ]; then
|
||||
level=$(/sbin/runlevel | /bin/cut -d ' ' -f 2)
|
||||
if /sbin/chkconfig --levels $level libvirt-guests; then
|
||||
# this doesn't do anything but allowing for libvirt-guests to be
|
||||
# stopped on the first shutdown
|
||||
/sbin/service libvirt-guests start > /dev/null 2>&1 || true
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
%postun client -p /sbin/ldconfig
|
||||
|
@ -1048,10 +1236,27 @@ fi
|
|||
/bin/systemctl try-restart libvirt-guests.service >/dev/null 2>&1 || :
|
||||
%endif
|
||||
|
||||
%if %{with_libvirtd}
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
|
||||
%files docs
|
||||
%defattr(-, root, root)
|
||||
# Website
|
||||
%dir %{_datadir}/doc/libvirt-docs-%{version}
|
||||
%dir %{_datadir}/doc/libvirt-docs-%{version}/html
|
||||
%{_datadir}/doc/libvirt-docs-%{version}/html/*
|
||||
|
||||
# API docs
|
||||
%dir %{_datadir}/gtk-doc/html/libvirt/
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.devhelp
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.html
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.png
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.css
|
||||
|
||||
%if %{with_libvirtd}
|
||||
%files daemon
|
||||
%defattr(-, root, root)
|
||||
|
||||
%doc AUTHORS ChangeLog.gz NEWS README COPYING.LIB TODO
|
||||
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
|
||||
|
||||
|
@ -1062,7 +1267,6 @@ fi
|
|||
%endif
|
||||
|
||||
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
|
||||
%{_sysconfdir}/libvirt/nwfilter/*.xml
|
||||
|
||||
%{_sysconfdir}/rc.d/init.d/libvirtd
|
||||
%if %{with_systemd}
|
||||
|
@ -1076,10 +1280,6 @@ fi
|
|||
%else
|
||||
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
|
||||
%endif
|
||||
%if %{with_dtrace}
|
||||
%{_datadir}/systemtap/tapset/libvirt_probes.stp
|
||||
%{_datadir}/systemtap/tapset/libvirt_functions.stp
|
||||
%endif
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
|
||||
|
@ -1173,7 +1373,41 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
|
|||
|
||||
%{_mandir}/man8/libvirtd.8*
|
||||
|
||||
%doc docs/*.xml
|
||||
%if %{with_network}
|
||||
%files daemon-config-network
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %{with_nwfilter}
|
||||
%files daemon-config-nwfilter
|
||||
%defattr(-, root, root)
|
||||
%{_sysconfdir}/libvirt/nwfilter/*.xml
|
||||
%endif
|
||||
|
||||
%if %{with_qemu_tcg}
|
||||
%files daemon-qemu
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %{with_qemu_kvm}
|
||||
%files daemon-kvm
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %{with_lxc}
|
||||
%files daemon-lxc
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %{with_uml}
|
||||
%files daemon-uml
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %{with_xen} || %{with_libxl}
|
||||
%files daemon-xen
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if %{with_sanlock}
|
||||
|
@ -1205,6 +1439,11 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
|
|||
%{_bindir}/virt-host-validate
|
||||
%{_libdir}/lib*.so.*
|
||||
|
||||
%if %{with_dtrace}
|
||||
%{_datadir}/systemtap/tapset/libvirt_probes*.stp
|
||||
%{_datadir}/systemtap/tapset/libvirt_functions.stp
|
||||
%endif
|
||||
|
||||
%dir %{_datadir}/libvirt/
|
||||
%dir %{_datadir}/libvirt/schemas/
|
||||
|
||||
|
@ -1243,11 +1482,10 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
|
|||
%dir %{_includedir}/libvirt
|
||||
%{_includedir}/libvirt/*.h
|
||||
%{_libdir}/pkgconfig/libvirt.pc
|
||||
%dir %{_datadir}/gtk-doc/html/libvirt/
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.devhelp
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.html
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.png
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.css
|
||||
|
||||
%dir %{_datadir}/libvirt/api/
|
||||
%{_datadir}/libvirt/api/libvirt-api.xml
|
||||
%{_datadir}/libvirt/api/libvirt-qemu-api.xml
|
||||
|
||||
%doc docs/*.html docs/html docs/*.gif
|
||||
%doc docs/libvirt-api.xml
|
||||
|
@ -1274,6 +1512,93 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
|
|||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Jun 12 2013 Cole Robinson <crobinso@redhat.com> - 0.9.11.10-1
|
||||
- Rebased to version 0.9.11.10
|
||||
- Fix launching qemu with ccid database property (bz #904692)
|
||||
- Don't error if disk resize isn't multiple of 512 (bz #951495)
|
||||
- Fix build with latest kernels (bz #959531)
|
||||
|
||||
* Mon Jan 28 2013 Cole Robinson <crobinso@redhat.com> - 0.9.11.9-1
|
||||
- Rebased to version 0.9.11.9
|
||||
- CVE-2013-0170 libvirt: use-after-free in virNetMessageFree() (bz #893450, bz
|
||||
#905173)
|
||||
|
||||
* Sun Dec 16 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.8-2
|
||||
- Fix conflict with NM launched dnsmasq (bz #886663)
|
||||
|
||||
* Sun Dec 09 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.8-1
|
||||
- Rebased to version 0.9.11.8
|
||||
- CVE-2012-3411: avoid open DNS proxy with dnsmasq (bz #874702, bz #882309)
|
||||
- Don't ignore address for USB disks (bz #861309)
|
||||
- Fix error with blkdeviotune (bz #872582)
|
||||
|
||||
* Sat Oct 27 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.7-1
|
||||
- Rebased to version 0.9.11.7
|
||||
- Fix multilib conflict with systemtap files (bz #831425)
|
||||
- Don't trigger keytab warning in system logs (bz #745203)
|
||||
- Fix qemu domxml-2-native NIC model out (bz #636832)
|
||||
- Fix error message if not enough space for lvm vol (bz #609104)
|
||||
|
||||
* Sun Oct 07 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.6-1
|
||||
- Rebased to version 0.9.11.6
|
||||
- Fix LXC domain startup with selinux=disabled (bz #858104)
|
||||
- CVE-2012-4423 Fix null dereference (bz #857135, bz #857133)
|
||||
- dnsmasq: avoid forwarding queries without a domain (bz #849787)
|
||||
|
||||
* Wed Aug 22 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.5-3
|
||||
- Drop bogus daemon dep additions (bz 849159)
|
||||
|
||||
* Tue Aug 14 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.5-2
|
||||
- Fix libvirt driver deps
|
||||
|
||||
* Mon Aug 13 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.5-1
|
||||
- Rebased to version 0.9.11.5
|
||||
- CVE-2012-3445 crash in virTypedParameterArrayClear (bz 844734)
|
||||
- Fix libvirt-guests (bz 843836)
|
||||
- Fix occasional loss of domain events in boxes (bz 819617)
|
||||
|
||||
* Thu Jun 28 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.4-3
|
||||
- Latest upstream patch for sanlock readonly/shared disks (bz 828633)
|
||||
|
||||
* Tue Jun 19 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.4-2
|
||||
- sanlock: Add param to ignore readonly/shared disks (bz 828633)
|
||||
|
||||
* Fri Jun 15 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.4-1
|
||||
- Rebased to version 0.9.11.4
|
||||
- Add usbredir spice channel (bz 821469)
|
||||
- Add default spice channel (bz 821474)
|
||||
- Fix libnuma dependency (bz 812874)
|
||||
- Fix USB device attach ambiguity CVE-2012-2693 (bz 816560)
|
||||
- Add bundled(gnulib) provides (bz 821776)
|
||||
- Drop unneeded systemd unit deps (bz 824204)
|
||||
- Update qemu.conf augeas lens (bz 824672)
|
||||
- Fix several double close bugs (bz 827125)
|
||||
- Fix potential deadlock when launching sub processes (bz 828565)
|
||||
|
||||
* Fri Apr 27 2012 Cole Robinson <crobinso@redhat.com> - 0.9.11.3-1
|
||||
- Rebased to version 0.9.11.3
|
||||
- Abide URI username when connecting to hypervisor (bz 811397)
|
||||
- Fix managed USB mode (bz 814866)
|
||||
- Fix crash connecting to ESX host (bz 811891)
|
||||
|
||||
* Wed Apr 4 2012 Daniel P. Berrange <berrange@redhat.com> - 0.9.11-1
|
||||
- Update to 0.9.11 release
|
||||
|
||||
* Tue Apr 3 2012 Daniel P. Berrange <berrange@redhat.com> - 0.9.10-4
|
||||
- Revert previous change
|
||||
|
||||
* Sat Mar 31 2012 Daniel P. Berrange <berrange@redhat.com> - 0.9.10-3
|
||||
- Remove previous non-upstream patch which did not fix bug 802475
|
||||
- Refactor RPM spec to allow install without default configs
|
||||
|
||||
* Wed Mar 28 2012 Kevin Fenzi <kevin@scrye.com> - 0.9.10-2.1
|
||||
- Add patch to fix ordering to come up after network target. Bug 802475
|
||||
|
||||
* Fri Mar 9 2012 Laine Stump <laine@redhat.com> - 0.9.10-2
|
||||
- replace "fedora-13" machine type with "pc-0.14" to prepare
|
||||
systems for removal of "fedora-13" from qemu - Bug 754772
|
||||
(this change is already in the F16 builds)
|
||||
|
||||
* Mon Feb 13 2012 Daniel P. Berrange <berrange@redhat.com> - 0.9.10-1
|
||||
- Update to 0.9.10
|
||||
|
||||
|
@ -1344,7 +1669,7 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
|
|||
* Sat Jul 30 2011 Dan Hor?k <dan[at]danny.cz> - 0.9.3-3
|
||||
- xenlight available only on Xen arches
|
||||
|
||||
* Wed Jul 5 2011 Peter Robinson <pbrobinson@gmail.com> - 0.9.3-2
|
||||
* Tue Jul 5 2011 Peter Robinson <pbrobinson@gmail.com> - 0.9.3-2
|
||||
- Add ARM to NUMA platform excludes
|
||||
|
||||
* Mon Jul 4 2011 Daniel Veillard <veillard@redhat.com> - 0.9.3-1
|
||||
|
@ -1684,7 +2009,7 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
|
|||
* Fri Apr 3 2009 Daniel Veillard <veillard@redhat.com> - 0.6.2-1
|
||||
- release of 0.6.2
|
||||
|
||||
* Fri Mar 4 2009 Daniel Veillard <veillard@redhat.com> - 0.6.1-1
|
||||
* Wed Mar 4 2009 Daniel Veillard <veillard@redhat.com> - 0.6.1-1
|
||||
- release of 0.6.1
|
||||
|
||||
* Sat Jan 31 2009 Daniel Veillard <veillard@redhat.com> - 0.6.0-1
|
||||
|
|
Loading…
Reference in New Issue