[libvirt] [PATCH 0/6] RESEND vz: minor fixes
by Maxim Nestratov
Mikhail Feoktistov (2):
vz: handle sourceless cdroms
vz: fix template ct creation
Nikolay Shirokovskiy (4):
vz: remove check for auto file format for disks
vz: fix vzCheckUnsupportedDisks format checks for cdroms
vz: fix error message for readonly fs
vz: make error path code idiomatic
src/vz/vz_sdk.c | 29 +++++++++++++++++++----------
src/vz/vz_utils.c | 23 +++++++++--------------
2 files changed, 28 insertions(+), 24 deletions(-)
--
2.4.3
8 years, 7 months
[libvirt] [PATCH] admin: include: Rename argument dmn to conn in virAdmConnectListServers
by Erik Skultety
This is just a trivial cosmetic change, throughout all the APIs the argument
is called conn as from 'connection', having 'dmn' at just this single place
might look odd, so better change it now when the interface is still explicitly
disabled and we still have the ability to alter the signatures and public
names before officially enabling it.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
pushed under trivial rule
Erik
include/libvirt/libvirt-admin.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/libvirt/libvirt-admin.h b/include/libvirt/libvirt-admin.h
index 4e6074e..bde4aef 100644
--- a/include/libvirt/libvirt-admin.h
+++ b/include/libvirt/libvirt-admin.h
@@ -91,7 +91,7 @@ int virAdmConnectRef(virAdmConnectPtr conn);
int virAdmConnectIsAlive(virAdmConnectPtr conn);
int virAdmServerFree(virAdmServerPtr srv);
-int virAdmConnectListServers(virAdmConnectPtr dmn,
+int virAdmConnectListServers(virAdmConnectPtr conn,
virAdmServerPtr **servers,
unsigned int flags);
--
2.5.5
8 years, 7 months
[libvirt] [PATCH v3 00/14] improve graphics listen configuration
by Pavel Hrdina
This patch series improves the way how different listen types can be specified
and also introduce a new listen types for graphics devices.
First improvement is to move ports out of graphics element into listen element
with type address or network. This is a first step to make the code
listen-driven.
Second step is to create a new listen type socket to improve the current vnc
configuration and to print only socket path witout any other listen types. With
the new socket type now we can add support also to spice graphics.
The last improvement is to introduce new listen type none for spice and vnc
graphics to specify that the spice graphics shouldn't listen anywhere by default.
In case of spice graphics the new listen types socket or none are required to
start a guest with OpenGL support.
Changes in v3:
- add listen type none support for vnc
- fix issues pointed out in v2
Changes in v2:
- don't remove vnc_auto_unix_socket from qemu.conf
- add spice_auto_unix_socket
Pavel Hrdina (14):
graphics: don't parse listens if socket attribute is present
domain_conf: parse listen attribute while parsing listen elements
graphics: make address attribute for listen type='address' optional
domain_conf: cleanup virDomainGraphicsListenDefParseXML
graphics: move port definition to listen element
graphics: introduce listen type=socket and use it for VNC
qemu_capabilites: add QEMU_CAPS_SPICE_UNIX
qemu_command: refactor spice channel code
spice: add support for listen type socket
qemu_process: separate graphics socket and address generation
tests: cleanup vnc auto socket test
spice: introduce spice_auto_unix_socket config option
spice: introduce listen type none
vnc: add support for listen type none
docs/formatdomain.html.in | 141 +++--
docs/schemas/domaincommon.rng | 63 +-
src/conf/domain_conf.c | 637 ++++++++++++++-------
src/conf/domain_conf.h | 31 +-
src/libvirt_private.syms | 1 +
src/libxl/libxl_conf.c | 53 +-
src/libxl/libxl_domain.c | 17 +-
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 17 +-
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 273 +++++----
src/qemu/qemu_conf.c | 1 +
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_domain.c | 19 +-
src/qemu/qemu_hotplug.c | 40 +-
src/qemu/qemu_migration.c | 50 +-
src/qemu/qemu_parse_command.c | 41 +-
src/qemu/qemu_process.c | 351 ++++++++----
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/security/virt-aa-helper.c | 15 +-
src/vbox/vbox_common.c | 30 +-
src/vbox/vbox_tmpl.c | 34 +-
src/vbox/vbox_uniformed_api.h | 4 +-
src/vmx/vmx.c | 54 +-
src/vz/vz_sdk.c | 30 +-
src/xenconfig/xen_common.c | 75 ++-
src/xenconfig/xen_sxpr.c | 71 +--
src/xenconfig/xen_xl.c | 45 +-
.../generic-graphics-listen-back-compat-ports.xml | 30 +
...generic-graphics-vnc-listen-element-minimal.xml | 2 +-
...aphics-vnc-listen-element-with-address-port.xml | 30 +
...ric-graphics-vnc-socket-attr-listen-address.xml | 30 +
...hics-vnc-socket-attr-listen-socket-mismatch.xml | 30 +
...eric-graphics-vnc-socket-attr-listen-socket.xml | 30 +
.../generic-graphics-listen-back-compat-ports.xml | 30 +
.../generic-graphics-listen-back-compat.xml | 2 +-
.../generic-graphics-vnc-listen-attr-only.xml | 2 +-
...generic-graphics-vnc-listen-element-minimal.xml | 4 +-
...aphics-vnc-listen-element-with-address-port.xml | 30 +
...ic-graphics-vnc-listen-element-with-address.xml | 2 +-
.../generic-graphics-vnc-manual-port.xml | 4 +-
.../generic-graphics-vnc-minimal.xml | 4 +-
...ric-graphics-vnc-socket-attr-listen-address.xml | 30 +
...eric-graphics-vnc-socket-attr-listen-socket.xml | 30 +
.../generic-graphics-vnc-socket-listen.xml | 2 +-
.../generic-graphics-vnc-socket.xml | 4 +-
tests/genericxml2xmltest.c | 7 +
.../qemuargv2xml-graphics-vnc-policy.xml | 2 +-
.../qemuargv2xml-graphics-vnc-sasl.xml | 2 +-
.../qemuargv2xml-graphics-vnc-socket.xml | 4 +-
.../qemuargv2xml-graphics-vnc-tls.xml | 2 +-
.../qemuargv2xml-graphics-vnc-websocket.xml | 2 +-
.../qemuargv2xmldata/qemuargv2xml-graphics-vnc.xml | 2 +-
...qemuhotplug-console-compat-2+console-virtio.xml | 2 +-
.../qemuxml2argv-console-compat-2.xml | 2 +-
...emuxml2argv-graphics-spice-auto-socket-cfg.args | 20 +
...qemuxml2argv-graphics-spice-auto-socket-cfg.xml | 30 +
.../qemuxml2argv-graphics-spice-auto-socket.args | 20 +
.../qemuxml2argv-graphics-spice-auto-socket.xml | 30 +
.../qemuxml2argv-graphics-spice-socket.args | 20 +
.../qemuxml2argv-graphics-spice-socket.xml | 30 +
.../qemuxml2argv-graphics-vnc-auto-socket-cfg.args | 22 +
.../qemuxml2argv-graphics-vnc-auto-socket-cfg.xml | 34 ++
.../qemuxml2argv-graphics-vnc-auto-socket.args | 20 +
.../qemuxml2argv-graphics-vnc-auto-socket.xml | 30 +
.../qemuxml2argv-graphics-vnc-autosocket.args | 22 -
.../qemuxml2argv-graphics-vnc-autosocket.xml | 34 --
.../qemuxml2argv-graphics-vnc-socket.args | 4 +-
.../qemuxml2argv-graphics-vnc-socket.xml | 10 +-
.../qemuxml2argv-video-virtio-gpu-spice-gl.args | 2 +-
tests/qemuxml2argvtest.c | 16 +
.../qemuxml2xmlout-graphics-listen-network.xml | 2 +-
.../qemuxml2xmlout-graphics-listen-network2.xml | 4 +-
...muxml2xmlout-graphics-spice-auto-socket-cfg.xml | 35 ++
.../qemuxml2xmlout-graphics-spice-auto-socket.xml | 35 ++
.../qemuxml2xmlout-graphics-spice-compression.xml | 2 +-
.../qemuxml2xmlout-graphics-spice-qxl-vga.xml | 2 +-
.../qemuxml2xmlout-graphics-spice-socket.xml | 35 ++
.../qemuxml2xmlout-graphics-spice-timeout.xml | 4 +-
.../qemuxml2xmlout-graphics-spice.xml | 2 +-
...qemuxml2xmlout-graphics-vnc-auto-socket-cfg.xml | 41 ++
.../qemuxml2xmlout-graphics-vnc-auto-socket.xml | 35 ++
.../qemuxml2xmlout-graphics-vnc-autosocket.xml | 39 --
.../qemuxml2xmlout-graphics-vnc-no-listen-attr.xml | 2 +-
.../qemuxml2xmlout-graphics-vnc-sasl.xml | 2 +-
.../qemuxml2xmlout-graphics-vnc-socket.xml | 35 ++
.../qemuxml2xmlout-graphics-vnc-tls.xml | 2 +-
.../qemuxml2xmlout-graphics-vnc-websocket.xml | 2 +-
.../qemuxml2xmlout-graphics-vnc.xml | 2 +-
.../qemuxml2xmlout-interface-server.xml | 4 +-
.../qemuxml2xmlout-net-bandwidth.xml | 4 +-
.../qemuxml2xmlout-net-bandwidth2.xml | 4 +-
.../qemuxml2xmlout-pci-bridge.xml | 2 +-
...emuxml2xmlout-seclabel-dynamic-none-relabel.xml | 2 +-
.../qemuxml2xmlout-serial-spiceport.xml | 2 +-
.../qemuxml2xmlout-video-virtio-gpu-spice-gl.xml | 3 +-
tests/qemuxml2xmltest.c | 19 +-
tests/sexpr2xmldata/sexpr2xml-curmem.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml | 4 +-
.../sexpr2xml-fv-serial-dev-2-ports.xml | 4 +-
.../sexpr2xml-fv-serial-dev-2nd-port.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml | 4 +-
.../sexpr2xml-fv-serial-tcp-telnet.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-sound.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-utc.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv-v2.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-fv.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml | 4 +-
.../sexpr2xml-pv-vfb-new-vncdisplay.xml | 2 +-
tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml | 2 +-
.../sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml | 4 +-
tests/sexpr2xmldata/sexpr2xml-vif-rate.xml | 4 +-
tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 4 +-
.../test-disk-positional-parms-full.xml | 2 +-
.../test-disk-positional-parms-partial.xml | 2 +-
...est-fullvirt-direct-kernel-boot-bogus-extra.xml | 2 +-
.../test-fullvirt-direct-kernel-boot-extra.xml | 2 +-
.../test-fullvirt-direct-kernel-boot.xml | 2 +-
tests/xlconfigdata/test-fullvirt-multiusb.xml | 2 +-
tests/xlconfigdata/test-fullvirt-nohap.xml | 2 +-
tests/xlconfigdata/test-new-disk.xml | 2 +-
tests/xlconfigdata/test-rbd-multihost-noauth.xml | 2 +-
tests/xlconfigdata/test-spice-features.xml | 2 +-
tests/xlconfigdata/test-spice.xml | 2 +-
tests/xlconfigdata/test-vif-rate.xml | 2 +-
tests/xmconfigdata/test-escape-paths.xml | 2 +-
.../xmconfigdata/test-fullvirt-default-feature.xml | 2 +-
tests/xmconfigdata/test-fullvirt-force-hpet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-force-nohpet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-localtime.xml | 2 +-
tests/xmconfigdata/test-fullvirt-net-netfront.xml | 2 +-
tests/xmconfigdata/test-fullvirt-new-cdrom.xml | 2 +-
tests/xmconfigdata/test-fullvirt-nohap.xml | 2 +-
tests/xmconfigdata/test-fullvirt-parallel-tcp.xml | 2 +-
.../test-fullvirt-serial-dev-2-ports.xml | 2 +-
.../test-fullvirt-serial-dev-2nd-port.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-file.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-null.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-pipe.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-pty.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-stdio.xml | 2 +-
.../test-fullvirt-serial-tcp-telnet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-tcp.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-udp.xml | 2 +-
tests/xmconfigdata/test-fullvirt-serial-unix.xml | 2 +-
tests/xmconfigdata/test-fullvirt-sound.xml | 2 +-
tests/xmconfigdata/test-fullvirt-usbmouse.xml | 2 +-
tests/xmconfigdata/test-fullvirt-usbtablet.xml | 2 +-
tests/xmconfigdata/test-fullvirt-utc.xml | 2 +-
tests/xmconfigdata/test-no-source-cdrom.xml | 4 +-
tests/xmconfigdata/test-paravirt-net-e1000.xml | 2 +-
tests/xmconfigdata/test-paravirt-net-vifname.xml | 2 +-
.../test-paravirt-new-pvfb-vncdisplay.xml | 2 +-
tests/xmconfigdata/test-paravirt-new-pvfb.xml | 2 +-
tests/xmconfigdata/test-pci-devs.xml | 4 +-
172 files changed, 2310 insertions(+), 987 deletions(-)
create mode 100644 tests/genericxml2xmlindata/generic-graphics-listen-back-compat-ports.xml
create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-listen-element-with-address-port.xml
create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-socket-attr-listen-address.xml
create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-socket-attr-listen-socket-mismatch.xml
create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-socket-attr-listen-socket.xml
create mode 100644 tests/genericxml2xmloutdata/generic-graphics-listen-back-compat-ports.xml
create mode 100644 tests/genericxml2xmloutdata/generic-graphics-vnc-listen-element-with-address-port.xml
create mode 100644 tests/genericxml2xmloutdata/generic-graphics-vnc-socket-attr-listen-address.xml
create mode 100644 tests/genericxml2xmloutdata/generic-graphics-vnc-socket-attr-listen-socket.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket-cfg.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket-cfg.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-socket.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-socket.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket-cfg.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket-cfg.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket.xml
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.args
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-auto-socket-cfg.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-auto-socket.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-socket.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-auto-socket-cfg.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-auto-socket.xml
delete mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-autosocket.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-socket.xml
--
2.8.2
8 years, 7 months
[libvirt] [PATCH] docs: formatdomain: document virtio-mmio device addresses
by Cole Robinson
---
docs/formatdomain.html.in | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 58b8cb6..a461a4e 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2980,6 +2980,13 @@
set to 0xfe.
<span class="since">Since 1.0.4</span>
</dd>
+ <dt><code>virtio-mmio</code></dt>
+ <dd>This places the device on the virtio-mmio transport, which is
+ currently only available for some <code>armv7l</code> and
+ <code>aarch64</code> virtual machines. virtio-mmio addresses
+ do not have any additional attributes.
+ <span class="since">Since 1.1.3</span>
+ </dd>
<dt><code>isa</code></dt>
<dd>ISA addresses have the following additional
attributes: <code>iobase</code> and <code>irq</code>.
--
2.7.4
8 years, 7 months
[libvirt] [PATCH 0/2] correct libxl config file convert
by Chunyan Liu
Correct libxl config file type=vif handling.
Chunyan Liu (2):
xenFormatNet: correct `type=netfront' to 'type=vif' to match libxl
xlconfigtest: add test case for type=vif in xl format
src/xenconfig/xen_common.c | 38 ++++++++++++++++++-----------
src/xenconfig/xen_common.h | 7 +++---
src/xenconfig/xen_xl.c | 4 +--
src/xenconfig/xen_xm.c | 8 +++---
tests/xlconfigdata/test-vif-typename.cfg | 25 +++++++++++++++++++
tests/xlconfigdata/test-vif-typename.xml | 42 ++++++++++++++++++++++++++++++++
tests/xlconfigtest.c | 1 +
7 files changed, 102 insertions(+), 23 deletions(-)
create mode 100644 tests/xlconfigdata/test-vif-typename.cfg
create mode 100644 tests/xlconfigdata/test-vif-typename.xml
--
2.1.4
8 years, 7 months
[libvirt] [PATCH] conf: Allow all volume modes for disk type='lun' sources
by Peter Krempa
Commit 82ba41108acd0f3f made possible to use direct mapped iSCSI
volumes in qemu as disk sources but didn't remove the define time check.
Rework the check by simplifying the condition and allow any volumes to
be used with disk type='lun'.
---
src/conf/domain_conf.c | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 571b7bf..9484404 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4184,26 +4184,18 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev,
}
}
- /* Validate LUN configuration
- * NOTE: virStorageTranslateDiskSourcePool is not run yet, so for
- * disk "volume"'s, the closest we can get at config time is
- * to ensure mode isn't direct since host/default will allow
- * lun/block usage. At run time if it's determined the wrong
- * voltype and pooltype values are set, then failure occurs
- */
- if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN &&
- !(disk->src->type == VIR_STORAGE_TYPE_BLOCK ||
- (disk->src->type == VIR_STORAGE_TYPE_NETWORK &&
- disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI) ||
- (disk->src->type == VIR_STORAGE_TYPE_VOLUME &&
- disk->src->srcpool &&
- disk->src->srcpool->mode !=
- VIR_STORAGE_SOURCE_POOL_MODE_DIRECT))) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("disk '%s' improperly configured for a "
- "device='lun'"),
- disk->dst);
- return -1;
+ /* Validate LUN configuration */
+ if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
+ /* volumes weren't translated at this point, so accept them */
+ if (!(disk->src->type == VIR_STORAGE_TYPE_BLOCK ||
+ disk->src->type == VIR_STORAGE_TYPE_VOLUME ||
+ (disk->src->type == VIR_STORAGE_TYPE_NETWORK &&
+ disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI))) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("disk '%s' improperly configured for a "
+ "device='lun'"), disk->dst);
+ return -1;
+ }
}
if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
--
2.8.2
8 years, 7 months
[libvirt] [PATCH] libxl: add .domainInterfaceAddresses
by Chunyan Liu
Add .domainInterfaceAddresses so that user can have a way to
get domain interface address by 'virsh domifaddr'. Currently
it only supports '--source lease'.
Signed-off: Chunyan Liu <cyliu(a)suse.com>
---
src/libxl/libxl_driver.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 140 insertions(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 062d6f8..f2bd6fa 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -5425,6 +5425,145 @@ static int libxlNodeGetSecurityModel(virConnectPtr conn,
return 0;
}
+static int
+libxlGetDHCPInterfaces(virDomainPtr dom,
+ virDomainObjPtr vm,
+ virDomainInterfacePtr **ifaces)
+{
+ int rv = -1;
+ int n_leases = 0;
+ size_t i, j;
+ size_t ifaces_count = 0;
+ virNetworkPtr network = NULL;
+ char macaddr[VIR_MAC_STRING_BUFLEN];
+ virDomainInterfacePtr iface = NULL;
+ virNetworkDHCPLeasePtr *leases = NULL;
+ virDomainInterfacePtr *ifaces_ret = NULL;
+
+ if (!dom->conn->networkDriver ||
+ !dom->conn->networkDriver->networkGetDHCPLeases) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Network driver does not support DHCP lease query"));
+ return -1;
+ }
+
+ for (i = 0; i < vm->def->nnets; i++) {
+ if (vm->def->nets[i]->type != VIR_DOMAIN_NET_TYPE_NETWORK)
+ continue;
+
+ virMacAddrFormat(&(vm->def->nets[i]->mac), macaddr);
+ virObjectUnref(network);
+ network = virNetworkLookupByName(dom->conn,
+ vm->def->nets[i]->data.network.name);
+
+ if ((n_leases = virNetworkGetDHCPLeases(network, macaddr,
+ &leases, 0)) < 0)
+ goto error;
+
+ if (n_leases) {
+ if (VIR_EXPAND_N(ifaces_ret, ifaces_count, 1) < 0)
+ goto error;
+
+ if (VIR_ALLOC(ifaces_ret[ifaces_count - 1]) < 0)
+ goto error;
+
+ iface = ifaces_ret[ifaces_count - 1];
+ /* Assuming each lease corresponds to a separate IP */
+ iface->naddrs = n_leases;
+
+ if (VIR_ALLOC_N(iface->addrs, iface->naddrs) < 0)
+ goto error;
+
+ if (VIR_STRDUP(iface->name, vm->def->nets[i]->ifname) < 0)
+ goto cleanup;
+
+ if (VIR_STRDUP(iface->hwaddr, macaddr) < 0)
+ goto cleanup;
+ }
+
+ for (j = 0; j < n_leases; j++) {
+ virNetworkDHCPLeasePtr lease = leases[j];
+ virDomainIPAddressPtr ip_addr = &iface->addrs[j];
+
+ if (VIR_STRDUP(ip_addr->addr, lease->ipaddr) < 0)
+ goto cleanup;
+
+ ip_addr->type = lease->type;
+ ip_addr->prefix = lease->prefix;
+ }
+
+ for (j = 0; j < n_leases; j++)
+ virNetworkDHCPLeaseFree(leases[j]);
+
+ VIR_FREE(leases);
+ }
+
+ *ifaces = ifaces_ret;
+ ifaces_ret = NULL;
+ rv = ifaces_count;
+
+ cleanup:
+ virObjectUnref(network);
+ if (leases) {
+ for (i = 0; i < n_leases; i++)
+ virNetworkDHCPLeaseFree(leases[i]);
+ }
+ VIR_FREE(leases);
+
+ return rv;
+
+ error:
+ if (ifaces_ret) {
+ for (i = 0; i < ifaces_count; i++)
+ virDomainInterfaceFree(ifaces_ret[i]);
+ }
+ VIR_FREE(ifaces_ret);
+
+ goto cleanup;
+}
+
+
+static int
+libxlDomainInterfaceAddresses(virDomainPtr dom,
+ virDomainInterfacePtr **ifaces,
+ unsigned int source,
+ unsigned int flags)
+{
+ virDomainObjPtr vm = NULL;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ if (!(vm = libxlDomObjFromDomain(dom)))
+ goto cleanup;
+
+ if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def) < 0)
+ goto cleanup;
+
+ if (!virDomainObjIsActive(vm)) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain is not running"));
+ goto cleanup;
+ }
+
+ switch (source) {
+ case VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE:
+ ret = libxlGetDHCPInterfaces(dom, vm, ifaces);
+ break;
+
+ default:
+ virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
+ _("Unsupported IP address data source %d"),
+ source);
+ break;
+ }
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
+
static virHypervisorDriver libxlHypervisorDriver = {
.name = LIBXL_DRIVER_NAME,
.connectOpen = libxlConnectOpen, /* 0.9.0 */
@@ -5525,6 +5664,7 @@ static virHypervisorDriver libxlHypervisorDriver = {
.domainMigrateFinish3Params = libxlDomainMigrateFinish3Params, /* 1.2.6 */
.domainMigrateConfirm3Params = libxlDomainMigrateConfirm3Params, /* 1.2.6 */
.nodeGetSecurityModel = libxlNodeGetSecurityModel, /* 1.2.16 */
+ .domainInterfaceAddresses = libxlDomainInterfaceAddresses, /* 1.3.5 */
};
static virConnectDriver libxlConnectDriver = {
--
1.8.5.6
8 years, 7 months
[libvirt] [PATCH v2 0/3] Drop QEMU_CAPS_PCI_ROMBAR and a couple more
by Andrea Bolognani
Differences from [v1]:
* Instead of unconditionally enable capabilities that are
guaranteed to be available on any QEMU version we support,
prefix them with X_ and remove all uses, as suggested by
Pavel and Cole
[v1] https://www.redhat.com/archives/libvir-list/2016-May/msg00967.html
Andrea Bolognani (3):
qemu: Drop QEMU_CAPS_PCI_ROMBAR
qemu: Drop QEMU_CAPS_CPU_HOST
qemu: Drop QEMU_CAPS_VIRTIO_BLK_SG_IO
src/qemu/qemu_capabilities.c | 36 ++---------
src/qemu/qemu_capabilities.h | 6 +-
src/qemu/qemu_command.c | 32 ++--------
tests/qemucapabilitiesdata/caps_1.2.2.x86_64.xml | 2 -
tests/qemucapabilitiesdata/caps_1.3.1.x86_64.xml | 3 -
tests/qemucapabilitiesdata/caps_1.4.2.x86_64.xml | 3 -
tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 3 -
tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 3 -
tests/qemucapabilitiesdata/caps_1.6.50.x86_64.xml | 3 -
tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 3 -
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 3 -
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 3 -
.../caps_2.6.0-gicv2.aarch64.xml | 2 -
.../caps_2.6.0-gicv3.aarch64.xml | 2 -
tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 2 -
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 3 -
tests/qemuhelptest.c | 24 -------
tests/qemuxml2argvtest.c | 73 +++++++++++-----------
18 files changed, 47 insertions(+), 159 deletions(-)
--
2.5.5
8 years, 7 months
[libvirt] [PATCH] qemu: Allow suffixes for the RAM option and fix it's type
by Nishith Shah
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=812295
According to QEMU docs, the '-m' option for specifying RAM is by default
in MiB, and a suffix of "M" or "G" may be passed for values in MiB and
GiB respectively. This commit adds support and a test for the same.
Also, change the type of mem from int to unsigned long long as per
convention and also because virDomainDefSetMemoryTotal expects the latter.
Signed-off-by: Nishith Shah <nishithshah.2211(a)gmail.com>
---
src/qemu/qemu_parse_command.c | 14 +++++++++----
tests/qemuargv2xmldata/qemuargv2xml-m.args | 22 ++++++++++++++++++++
tests/qemuargv2xmldata/qemuargv2xml-m.xml | 33 ++++++++++++++++++++++++++++++
tests/qemuargv2xmltest.c | 1 +
4 files changed, 66 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuargv2xmldata/qemuargv2xml-m.args
create mode 100644 tests/qemuargv2xmldata/qemuargv2xml-m.xml
diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
index e30586f..48076eb 100644
--- a/src/qemu/qemu_parse_command.c
+++ b/src/qemu/qemu_parse_command.c
@@ -1869,15 +1869,21 @@ qemuParseCommandLine(virCapsPtr caps,
} else if (STREQ(arg, "-sdl")) {
have_sdl = true;
} else if (STREQ(arg, "-m")) {
- int mem;
+ unsigned long long mem;
+ char *end;
WANT_VALUE();
- if (virStrToLong_i(val, NULL, 10, &mem) < 0) {
+ if (virStrToLong_ull(val, &end, 10, &mem) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("cannot parse memory level '%s'"), val);
goto error;
}
- virDomainDefSetMemoryTotal(def, mem * 1024);
- def->mem.cur_balloon = mem * 1024;
+ if (virScaleInteger(&mem, end, 1024 * 1024, ULLONG_MAX) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, \
+ _("cannot scale memory '%s'"), val);
+ goto error;
+ }
+ virDomainDefSetMemoryTotal(def, mem / 1024);
+ def->mem.cur_balloon = mem / 1024;
} else if (STREQ(arg, "-smp")) {
WANT_VALUE();
if (qemuParseCommandLineSmp(def, val) < 0)
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-m.args b/tests/qemuargv2xmldata/qemuargv2xml-m.args
new file mode 100644
index 0000000..90da94d
--- /dev/null
+++ b/tests/qemuargv2xmldata/qemuargv2xml-m.args
@@ -0,0 +1,22 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 2G \
+-smp 1,maxcpus=2,sockets=2,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=ide,bus=0,unit=0 \
+-net none \
+-serial none \
+-parallel none
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-m.xml b/tests/qemuargv2xmldata/qemuargv2xml-m.xml
new file mode 100644
index 0000000..8002e00
--- /dev/null
+++ b/tests/qemuargv2xmldata/qemuargv2xml-m.xml
@@ -0,0 +1,33 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static' current='1'>2</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu>
+ <topology sockets='2' cores='1' threads='1'/>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='ide' index='0'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
index 48c83ea..c7bbc5b 100644
--- a/tests/qemuargv2xmltest.c
+++ b/tests/qemuargv2xmltest.c
@@ -264,6 +264,7 @@ mymain(void)
DO_TEST("hostdev-pci-address");
+ DO_TEST("m");
DO_TEST("smp");
DO_TEST("hyperv");
--
2.1.4
8 years, 7 months
[libvirt] Need to re-work final "peer address" patches and re-push them
by Laine Stump
I reverted these three patches that introduced and enabled a "peer"
attribute for type='ethernet' interface <ip> elements prior to the
release of 1.3.4 with the intent of fixing/re-posting them after
release, but forgot until today:
https://www.redhat.com/archives/libvir-list/2016-April/msg01995.html
I have patches for most of the bugs, but the one problem that still
doesn't have resolution is the naming of the "peer" attribute. In my
opinion, having the two address attributes named "address" and "peer"
makes it ambiguous which address is for the guest side and which for the
host side (especially since the attribute that has been named "peer"
would be set to the "address" in the netlink command, and the attribute
named "address" would be set to "peer" in the netlink command :-O).
Since "address" is an existing attribute, and already used for the guest
side IP address in lxc type='bridge' interfaces, it must remain as-is.
In order to make it obvious that the new address is for the host side of
the tap (or veth pair in the case of lxc), I propose calling it either
"host", or "hostAddress", e.g:
<ip address='192.168.123.43' host='192.168.123.1' prefix='25'/>
or
<ip address='192.168.123.4' hostAddress='192.168.123.1' prefix='25'/>
(Vasiliy had suggested "hostPeer", but I dislike that, since it sounds
like "the peer of the host", which is even more misleading).
Can some of you normally-opinionated people weigh in on this? I don't
like the feeling of making a unilateral decision :-)
Also, I'm realizing that, although there was a patch to support setting
the host-side address (hmm - "hostSide"? nah) for lxc type='bridge'
interface, this is not at all useful, because anything plugged into a
bridge should not have any IP on the side plugged into the bridge. The
place where it would be useful for lxc would be (just as it is for qemu)
with a type='ethernet' interface - the guest-side veth would have
"address" and the host-side veth would have "hostAddress", and it would
then properly work without needing a bridge (which I think is the entire
point). Since lxc doesn't currently support type='ethernet', I think
that initial support should be made for qemu only, and when
type='ethernet is added to lxc, it can be made to support an IP address
on both sides of the veth pair from the start.
Lacking any useful responses, I'm thinking to update Vasiliy's patches
to use "hostAddress" (and fix the other bugs I had found) and re-post them.
8 years, 7 months