[libvirt] [PATCH 0/4] Improve mount setup in LXC containers
by Daniel P. Berrange
These 4 patches improve the way we setup special mounts like /sys and
/proc in LXC containers. This should help ensure systemd is happier
with the cgroups setup
These apply ontop of the earlier series to improve SELinux driver
integration
12 years, 6 months
[libvirt] [libvirt-glib] Add getter for GVirConfigDomain.virt_type
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
---
libvirt-gconfig/libvirt-gconfig-domain.c | 12 ++++++++++++
libvirt-gconfig/libvirt-gconfig-domain.h | 1 +
libvirt-gconfig/libvirt-gconfig.sym | 2 ++
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c
index b6b43f0..7477400 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain.c
@@ -187,6 +187,18 @@ GVirConfigDomain *gvir_config_domain_new(void)
return GVIR_CONFIG_DOMAIN(object);
}
+GVirConfigDomainVirtType gvir_config_domain_get_virt_type(GVirConfigDomain *domain)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN(domain),
+ GVIR_CONFIG_DOMAIN_VIRT_QEMU);
+
+ return gvir_config_object_get_attribute_genum
+ (GVIR_CONFIG_OBJECT(domain),
+ NULL,
+ "type",
+ GVIR_CONFIG_TYPE_DOMAIN_VIRT_TYPE,
+ GVIR_CONFIG_DOMAIN_VIRT_QEMU);
+}
void gvir_config_domain_set_virt_type(GVirConfigDomain *domain, GVirConfigDomainVirtType type)
{
diff --git a/libvirt-gconfig/libvirt-gconfig-domain.h b/libvirt-gconfig/libvirt-gconfig-domain.h
index bdb842b..5deb58e 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain.h
@@ -99,6 +99,7 @@ GType gvir_config_domain_get_type(void);
GVirConfigDomain *gvir_config_domain_new_from_xml(const gchar *xml, GError **error);
GVirConfigDomain *gvir_config_domain_new(void);
+GVirConfigDomainVirtType gvir_config_domain_get_virt_type(GVirConfigDomain *domain);
void gvir_config_domain_set_virt_type(GVirConfigDomain *domain, GVirConfigDomainVirtType type);
const char *gvir_config_domain_get_name(GVirConfigDomain *domain);
void gvir_config_domain_set_name(GVirConfigDomain *domain, const char *name);
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 21fff46..f1af2ea 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -376,6 +376,8 @@ LIBVIRT_GCONFIG_0.0.8 {
LIBVIRT_GCONFIG_0.0.9 {
global:
+ gvir_config_domain_get_virt_type;
+
gvir_config_domain_get_os;
gvir_config_domain_os_get_boot_devices;
--
1.7.7.6
12 years, 6 months
[libvirt] [PATCH] Set a sensible default master start port for ehci companion controllers
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The uhci1, uhci2, uhci3 companion controllers for ehci1 must
have a master start port set. Since this value is predictable
we should set it automatically if the app does not supply it
---
src/conf/domain_conf.c | 22 ++++++++++++++++++
.../qemuxml2argv-usb-ich9-ehci-addr.xml | 24 +++++---------------
2 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 54ac1db..f4775be 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4066,6 +4066,28 @@ virDomainControllerDefParseXML(xmlNodePtr node,
VIR_FREE(vectors);
break;
}
+ case VIR_DOMAIN_CONTROLLER_TYPE_USB: {
+ /* If the XML has a uhci1, uhci2, uhci3 controller and no
+ * master port was given, we should set a sensible one */
+ int masterPort = -1;
+ switch (def->model) {
+ case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI1:
+ masterPort = 0;
+ break;
+ case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI2:
+ masterPort = 2;
+ break;
+ case VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI3:
+ masterPort = 4;
+ break;
+ }
+ if (masterPort != -1 &&
+ def->info.mastertype == VIR_DOMAIN_CONTROLLER_MASTER_NONE) {
+ def->info.mastertype = VIR_DOMAIN_CONTROLLER_MASTER_USB;
+ def->info.master.usb.startport = masterPort;
+ }
+ break;
+ }
default:
break;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml b/tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml
index 8eff1d7..ad85d63 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml
@@ -19,19 +19,13 @@
<controller type='usb' index='1' model='ich9-ehci1'>
</controller>
- <controller type='usb' index='0' model='ich9-uhci1'>
- <master startport='0'/>
- </controller>
- <controller type='usb' index='1' model='ich9-uhci1'>
- <master startport='0'/>
- </controller>
+ <controller type='usb' index='0' model='ich9-uhci1'/>
+ <controller type='usb' index='1' model='ich9-uhci1'/>
<controller type='usb' index='2' model='ich9-uhci1'>
<master startport='0'/>
</controller>
- <controller type='usb' index='0' model='ich9-uhci3'>
- <master startport='4'/>
- </controller>
+ <controller type='usb' index='0' model='ich9-uhci3'/>
<controller type='usb' index='1' model='ich9-uhci3'>
<master startport='4'/>
</controller>
@@ -39,15 +33,9 @@
<master startport='4'/>
</controller>
- <controller type='usb' index='2' model='ich9-uhci2'>
- <master startport='2'/>
- </controller>
- <controller type='usb' index='1' model='ich9-uhci2'>
- <master startport='2'/>
- </controller>
- <controller type='usb' index='0' model='ich9-uhci2'>
- <master startport='2'/>
- </controller>
+ <controller type='usb' index='2' model='ich9-uhci2'/>
+ <controller type='usb' index='1' model='ich9-uhci2'/>
+ <controller type='usb' index='0' model='ich9-uhci2'/>
<memballoon model='virtio'/>
</devices>
</domain>
--
1.7.10.1
12 years, 6 months
[libvirt] [PATCH libvirt 0/9] domain/qemu enhancements
by Marc-André Lureau
Hi,
I have sent those patches before 0.12, and updated them according to
comments (hopefully you don't mind I send them all revised in the same
thread) They bring:
- domain audio <codec> selection, for ICH6 devices
- domain port <forward>, for user-mode networking
- storage <preallocation> mode for QCOW2 images
Marc-André Lureau (9):
qemu: test CAPS_HDA_MICRO
domain: add <codec> sound sub-element
qemu: honour sound <codec> sub-elements
tests: add qemu-1.1-rc0 data
tests: add ich6 codec type test to qemuxml2argv-sound-device
storage: add preallocation element
storage: learn to create qcow2 with preallocation
domain: add <forward> element for user mode networking
qemu: implement user mode port <forward>
docs/formatdomain.html.in | 40 +++
docs/formatstorage.html.in | 6 +
docs/schemas/domaincommon.rng | 58 +++-
docs/schemas/storagevol.rng | 18 ++
src/conf/domain_conf.c | 286 +++++++++++++++++++-
src/conf/domain_conf.h | 45 +++
src/conf/storage_conf.c | 26 ++
src/conf/storage_conf.h | 1 +
src/libvirt_private.syms | 3 +
src/qemu/qemu_capabilities.c | 3 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 213 +++++++++++++--
src/storage/storage_backend.c | 70 ++++-
src/util/storage_file.c | 4 +
src/util/storage_file.h | 10 +
tests/qemuhelpdata/qemu-1.1 | 266 ++++++++++++++++++
tests/qemuhelpdata/qemu-1.1-device | 95 +++++++
tests/qemuhelptest.c | 70 +++++
tests/qemuxml2argvdata/qemuxml2argv-net-user.args | 5 +-
tests/qemuxml2argvdata/qemuxml2argv-net-user.xml | 2 +
.../qemuxml2argv-sound-device.args | 7 +-
.../qemuxml2argvdata/qemuxml2argv-sound-device.xml | 7 +
tests/qemuxml2argvtest.c | 3 +-
tests/qemuxml2xmltest.c | 1 +
tests/storagevolxml2xmlin/vol-qcow2.xml | 1 +
tests/storagevolxml2xmlout/vol-qcow2.xml | 1 +
26 files changed, 1201 insertions(+), 41 deletions(-)
create mode 100644 tests/qemuhelpdata/qemu-1.1
create mode 100644 tests/qemuhelpdata/qemu-1.1-device
--
1.7.10.1
12 years, 6 months
[libvirt] [PATCH 0/2] qemu: Add support for -no-user-config
by Jiri Denemark
Eduardo submitted patches[1] for qemu implementing -no-user-config as a better
alternative to all-or-nothing -nodefconfig. With this new option, we are
finally able to use modern CPU models defined in qemu's configuration file
without allowing user-supplied qemu configuration to mess up with qemu
processes started by libvirt. The qemu patches are not committed upstream yet
(and this patchset won't be committed either until qemu support is finished)
but they are very close and are expected to make it into qemu-1.1.
[1] https://www.redhat.com/archives/libvir-list/2012-April/msg01293.html
Jiri Denemark (2):
qemu: Use common helper when probing qemu capabilities
qemu: Add support for -no-user-config
src/qemu/qemu_capabilities.c | 64 +++++++++++++++++++++++++++--------------
src/qemu/qemu_capabilities.h | 6 ++++
src/qemu/qemu_command.c | 11 ++++---
src/qemu/qemu_driver.c | 9 +++++-
4 files changed, 62 insertions(+), 28 deletions(-)
--
1.7.8.5
12 years, 6 months
[libvirt] [PATCH libvirt 0/5] Add ich6 <codec> sub-element
by Marc-André Lureau
Hi,
Upcoming qemu 1.1 will have hda-micro codec device type, which helps
to solve recording with some applications under Windows 7.
The following series allows to specify the codecs attached to a ICH6
audio device, using the syntax described in commit comment
6cabc0b0d0fbc35a68bf1c0646898ac148d2fa3f:
<sound model='ich6'>
<codec type='micro'/>
</sound>
The codec type 'micro' maps to qemu 'hda-micro' device kind.
See also https://bugzilla.redhat.com/show_bug.cgi?id=816503
Marc-André Lureau (5):
qemu: test CAPS_HDA_MICRO
domain: add <codec> sound sub-element
qemu: honour sound <codec> sub-elements
tests: add qemu-1.1-rc0 data
tests: add ich6 codec type test to qemuxml2argv-sound-device
docs/formatdomain.html.in | 16 ++
docs/schemas/domaincommon.rng | 29 ++-
src/conf/domain_conf.c | 119 ++++++++-
src/conf/domain_conf.h | 20 ++
src/qemu/qemu_capabilities.c | 3 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 74 ++++--
tests/qemuhelpdata/qemu-1.1 | 266 ++++++++++++++++++++
tests/qemuhelpdata/qemu-1.1-device | 95 +++++++
tests/qemuhelptest.c | 70 ++++++
.../qemuxml2argv-sound-device.args | 7 +-
.../qemuxml2argvdata/qemuxml2argv-sound-device.xml | 7 +
tests/qemuxml2argvtest.c | 3 +-
tests/qemuxml2xmltest.c | 1 +
14 files changed, 682 insertions(+), 29 deletions(-)
create mode 100644 tests/qemuhelpdata/qemu-1.1
create mode 100644 tests/qemuhelpdata/qemu-1.1-device
--
1.7.10
12 years, 6 months
[libvirt] [PATCH] Remove bogus udev.target dep from libvirtd unit
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
There is no 'udev.target' unit in systemd (only 'udev.service')
yet libvirtd's unit file had a dep on one. There's no compelling
reason for a dep on udev, so remove it altogether.
Reported-by: Avi Kivity <avi(a)redhat.com>
---
daemon/libvirtd.service.in | 1 -
1 file changed, 1 deletion(-)
diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in
index d6e46ab..64dbd27 100644
--- a/daemon/libvirtd.service.in
+++ b/daemon/libvirtd.service.in
@@ -6,7 +6,6 @@
[Unit]
Description=Virtualization daemon
After=syslog.target
-After=udev.target
After=avahi.target
After=dbus.target
Before=libvirt-guests.service
--
1.7.10.1
12 years, 6 months
[libvirt] The config of IP address for 'macvtap' network
by Lei Li
Hi guys,
I know the macvtap network is supported by libvirt as forward mode
'passthrough', I wonder is there anyway to configure the IP address
for its interface?
For example, If I create a network as below:
<network>
<name>vdsm-testnet</name>
<uuid>31f6b3b3-e959-0dd1-ad3a-bf95db660415</uuid>
<forward dev='eth0.8' mode='passthrough'>
<interface dev='eth0.8'/>
</forward>
</network>
For now, I have to set the IP address by 'ifconfig eth0.8 XXX.XXX.XXX.XXX'
after defining the network.
How can I set IP address for this VLAN device 'eth0.8' by libvirt, I mean
does libvirt support to assign IP address in this mode now? If does, what is the
xml format for it?
It'd appreciate a lot if anybody could read my post and give me some suggestions!
--
Lei
12 years, 6 months
[libvirt] [PATCH] Fix virDomainDeviceInfoIsSet() to check all struct fields
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The virDomainDeviceInfoIsSet API was only checking if an
address or alias was set in the struct. Thus if only a
rom bar setting / filename, boot index, or USB master
value was set, they could be accidentally dropped when
formatting XML
---
src/conf/domain_conf.c | 15 +++++++++++----
src/conf/domain_conf.h | 4 ++++
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 54ac1db..e43d76d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1904,14 +1904,21 @@ int virDomainDevicePCIAddressIsValid(virDomainDevicePCIAddressPtr addr)
}
-static int
+static bool
virDomainDeviceInfoIsSet(virDomainDeviceInfoPtr info, unsigned int flags)
{
if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
- return 1;
+ return true;
if (info->alias && !(flags & VIR_DOMAIN_XML_INACTIVE))
- return 1;
- return 0;
+ return true;
+ if (info->mastertype != VIR_DOMAIN_CONTROLLER_MASTER_NONE)
+ return true;
+ if ((info->rombar != VIR_DOMAIN_PCI_ROMBAR_DEFAULT) ||
+ info->romfile)
+ return true;
+ if (info->bootIndex)
+ return true;
+ return false;
}
void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 6648a17..1597212 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -253,6 +253,10 @@ struct _virDomainDeviceUSBMaster {
typedef struct _virDomainDeviceInfo virDomainDeviceInfo;
typedef virDomainDeviceInfo *virDomainDeviceInfoPtr;
struct _virDomainDeviceInfo {
+ /* If adding to this struct, ensure that
+ * virDomainDeviceInfoIsSet() is updated
+ * to consider the new fields
+ */
char *alias;
int type;
union {
--
1.7.10.1
12 years, 6 months
[libvirt] [libvirt-glib] Make sure %with_vala is defined for newer RHELs
by Christophe Fergeau
We want to build the vala bindings on recent RHELs. Given than
%with_introspection is defined for fedora >= 15 and rhel > 6 which
are exactly the versions for which we want to build the vala bindings,
and given that the vala bindings are to be disabled when introspection
is disabled, we can set %with_vala to the same value as %with_introspection.
---
libvirt-glib.spec.in | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/libvirt-glib.spec.in b/libvirt-glib.spec.in
index 1288c10..e312926 100644
--- a/libvirt-glib.spec.in
+++ b/libvirt-glib.spec.in
@@ -16,9 +16,7 @@
%if 0%{?rhel} && 0%{?rhel} < 7
%define with_python 1
%endif
-%if 0%{with_introspection} && 0%{?fedora} > 15
-%define with_vala 1
-%endif
+%define with_vala %{with_introspection}
%define libvirt_version 0.9.10
--
1.7.10.1
12 years, 6 months