[libvirt] [PATCH] capabilities: Advertise cpuselection if -cpu host is usable
by Jiri Denemark
When -cpu host is supported by a QEMU binary, a user can use
<cpu mode='host-passthrough'/> in domain XML even when libvirtd failed
to find a matching model for the host CPU. Let's make it obvious by
advertising <cpuselection/> guest capability whenever -cpu host is
supported.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 7 ++++---
tests/qemucaps2xmldata/all_1.6.0-1.xml | 1 +
tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml | 1 +
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 1bddf43..fcfd1cd 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -928,9 +928,10 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
machines = NULL;
nmachines = 0;
- if (caps->host.cpu &&
- caps->host.cpu->model &&
- virQEMUCapsGetCPUDefinitions(qemubinCaps, NULL) > 0 &&
+ if ((virQEMUCapsGet(qemubinCaps, QEMU_CAPS_CPU_HOST) ||
+ (caps->host.cpu &&
+ caps->host.cpu->model &&
+ virQEMUCapsGetCPUDefinitions(qemubinCaps, NULL) > 0)) &&
!virCapabilitiesAddGuestFeature(guest, "cpuselection", true, false))
goto cleanup;
diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.xml b/tests/qemucaps2xmldata/all_1.6.0-1.xml
index 2489f49..84d6000 100644
--- a/tests/qemucaps2xmldata/all_1.6.0-1.xml
+++ b/tests/qemucaps2xmldata/all_1.6.0-1.xml
@@ -18,6 +18,7 @@
</domain>
</arch>
<features>
+ <cpuselection/>
<deviceboot/>
<disksnapshot default='on' toggle='no'/>
<acpi default='on' toggle='yes'/>
diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
index 281fab0..28762c2 100644
--- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
+++ b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
@@ -18,6 +18,7 @@
</domain>
</arch>
<features>
+ <cpuselection/>
<deviceboot/>
<disksnapshot default='off' toggle='no'/>
<acpi default='on' toggle='yes'/>
--
2.8.2
8 years, 6 months
[libvirt] [PATCH 0/6] Cleanup of handling of secrets for disks
by Peter Krempa
I also wanted to get rid of yet another copy of virSecretGetSecretString in the
RBD driver code but I didn't figure out the linking yet, so I'll send the patch
separately.
John Ferlan (2):
util: string: Introduce helper to determine whether a byte buffer is
printable
secret: Alter virSecretGetSecretString
Peter Krempa (4):
util: alloc: Introduce freeing helpers that clear the memory before
freeing
secret: util: Refactor virSecretGetSecretString
util: string: Introduce virStringEncodeBase64
qemu: domain: Fix names for functions that clear security info
po/POTFILES.in | 1 -
src/conf/virsecretobj.c | 7 +---
src/libvirt_private.syms | 3 ++
src/libxl/libxl_conf.c | 23 +++++++-----
src/qemu/qemu_agent.c | 6 +--
src/qemu/qemu_command.c | 18 +++++++--
src/qemu/qemu_domain.c | 27 +++++--------
src/qemu/qemu_domain.h | 3 +-
src/secret/secret_util.c | 79 +++++++++++----------------------------
src/secret/secret_util.h | 12 +++---
src/storage/storage_backend_rbd.c | 17 ++-------
src/util/viralloc.c | 36 ++++++++++++++++++
src/util/viralloc.h | 56 +++++++++++++++++++++++++++
src/util/virstring.c | 43 +++++++++++++++++++++
src/util/virstring.h | 3 ++
tests/viralloctest.c | 37 ++++++++++++++++++
tools/virsh-secret.c | 6 +--
17 files changed, 256 insertions(+), 121 deletions(-)
--
2.8.2
8 years, 6 months
[libvirt] [PATCH 0/2] Enable QEMU_CAPS_PCI_ROMBAR unconditionally
by Andrea Bolognani
This capability was not handled correctly, causing aarch64
guests having
<interface type='network'>
...
<rom bar='off'/>
</interface>
to fail at startup with
error: unsupported configuration: rombar and romfile not
supported in this QEMU binary
I'm not sure whether we should drop the QEMU_CAPS_PCI_ROMBAR
capability entirely now that it's enabled unconditionally and
there is no code checking for it; as I understand it, we don't
ever drop capabilities, hence the current implementation.
Andrea Bolognani (2):
qemu: Enable QEMU_CAPS_PCI_ROMBAR unconditionally
qemu: Stop checking for QEMU_CAPS_PCI_ROMBAR
src/qemu/qemu_capabilities.c | 46 ++++++++++++----------
src/qemu/qemu_command.c | 12 ++----
tests/qemucapabilitiesdata/caps_1.2.2-1.x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_2.6.0-1.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_2.6.0-1.ppc64le.xml | 1 +
.../qemucapabilitiesdata/caps_2.6.0-2.aarch64.xml | 1 +
6 files changed, 33 insertions(+), 29 deletions(-)
--
2.5.5
8 years, 6 months
[libvirt] Patch to enable transient disks in libvirt for qemu
by Richard Harman
I'm not a C coder, but hey I managed to get transient disks working. I
think there was some discussion years ago on the list about having
libvirt/qemu dump the transient disk image into a default random temp
directory wasn't the Right Way To Do Things, and I think interest
evaporated.
Anyway, have a patch.
8 years, 6 months
[libvirt] [PATCH 0/8] domain: Support <address type='pci'/> allocation
by Cole Robinson
This patch series allows the user to specify bare device
<address type='pci'/> to explicitly request PCI address allocation.
This has several uses, but the motivating one is providing an
easy way to request PCI address allocation where it normally isn't
the default address type, like for aarch64 VMs.
Cole Robinson (8):
domain: Add virDomainDefAddImplicitDevices
domain: conf: Export virDomainDefPostParseDevices
qemu: Assign device addresses in PostParse
util: xml: add virXMLPropertyCount
tests: Add failure flags to CompareDomainXML2XML
domain: Make <address type='pci'/> request address allocation
qemu: Wire up address type=pci auto_allocate
tests: qemu: test <address type='pci'/> with aarch64
docs/schemas/domaincommon.rng | 5 +-
src/conf/domain_conf.c | 81 +++++++++++++++++-----
src/conf/domain_conf.h | 8 ++-
src/libvirt_private.syms | 3 +-
src/qemu/qemu_domain.c | 13 +++-
src/qemu/qemu_domain_address.c | 47 +++++++++++++
src/qemu/qemu_driver.c | 6 +-
src/util/virxml.c | 17 +++++
src/util/virxml.h | 1 +
src/vmx/vmx.c | 2 +-
src/vz/vz_sdk.c | 2 +-
tests/bhyvexml2xmltest.c | 2 +-
.../generic-pci-autofill-addr.xml | 27 ++++++++
tests/genericxml2xmltest.c | 17 +++--
tests/lxcxml2xmltest.c | 2 +-
.../qemuargv2xmldata/qemuargv2xml-pseries-disk.xml | 4 +-
...l2argv-aarch64-virtio-pci-manual-addresses.args | 4 +-
...ml2argv-aarch64-virtio-pci-manual-addresses.xml | 5 ++
.../qemuxml2argv-pci-autofill-addr.args | 24 +++++++
.../qemuxml2argv-pci-autofill-addr.xml | 44 ++++++++++++
tests/qemuxml2argvtest.c | 21 +++---
...2xmlout-aarch64-virtio-pci-manual-addresses.xml | 5 ++
.../qemuxml2xmlout-pci-autofill-addr.xml | 46 ++++++++++++
tests/qemuxml2xmltest.c | 18 +++--
tests/testutils.c | 10 ++-
tests/testutils.h | 4 ++
26 files changed, 359 insertions(+), 59 deletions(-)
create mode 100644 tests/genericxml2xmlindata/generic-pci-autofill-addr.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autofill-addr.xml
--
2.5.0
8 years, 6 months
[libvirt] [PATCH v4 0/8] tests: Introduce global mock library
by Michal Privoznik
diff to v3:
- Well, I've found out that we have virmock.h that can be used
just for what Peter suggested earlier: have LOAD_SYM shared. To
my surprise, we already have a macro just for that =
VIR_MOCK_REAL_INIT.
- As agreed in v3, this feature is yet not enabled by default,
but only if a env var is set. In order to do that, I have to
write (hackish?) patch 5/8.
Michal Privoznik (8):
virpcimock: Adapt to virmock.h
vircgroupmock: Adapt to virmock.h
nssmock: Adapt to virmock.h
securityselinuxhelper: Adapt to virmock.h
virmock.h: Introduce VIR_MOCK_CALL_STAT
tests: Introduce global mock library
virtestmock: Print invalid file accesses into a file
tests: Introduce check-file-access.pl
.gitignore | 1 +
HACKING | 10 ++
Makefile.am | 3 +
cfg.mk | 2 +-
docs/hacking.html.in | 13 +++
tests/Makefile.am | 28 ++++-
tests/check-file-access.pl | 104 ++++++++++++++++++
tests/file_access_whitelist.txt | 23 ++++
tests/nssmock.c | 27 ++---
tests/securityselinuxhelper.c | 80 ++++++--------
tests/testutils.c | 30 ++++--
tests/testutils.h | 10 +-
tests/vircgroupmock.c | 83 ++++++---------
tests/virmock.h | 33 ++++++
tests/virpcimock.c | 96 +++++++----------
tests/virtestmock.c | 226 ++++++++++++++++++++++++++++++++++++++++
16 files changed, 583 insertions(+), 186 deletions(-)
create mode 100755 tests/check-file-access.pl
create mode 100644 tests/file_access_whitelist.txt
create mode 100644 tests/virtestmock.c
--
2.8.1
8 years, 6 months
[libvirt] [PATCH v2 0/3] qemu: Fix hotplug of guest agent
by Martin Kletzander
v2:
- mostly a rebase, it was almost ACKed but not completely, just to
make sure let's see it again with everything done.
- use /tmp for paths in tests (automatically fixed by rebasing on top
of commit 1893b6df117b)
v1:
- https://www.redhat.com/archives/libvir-list/2016-March/msg01454.html
Martin Kletzander (3):
qemuhotplugtest: Allow testing of live data
qemu: Move channel path generation out of command creation
qemu: Generate channel target paths on hotplug as well
src/qemu/qemu_command.c | 25 ++--------
src/qemu/qemu_command.h | 5 +-
src/qemu/qemu_domain.c | 20 ++++++++
src/qemu/qemu_domain.h | 4 ++
src/qemu/qemu_hotplug.c | 3 ++
src/qemu/qemu_process.c | 12 +++--
tests/qemuhotplugtest.c | 37 ++++++++++----
.../qemuhotplug-hotplug-base+qemu-agent-detach.xml | 58 ++++++++++++++++++++++
.../qemuhotplug-hotplug-base+qemu-agent.xml | 58 ++++++++++++++++++++++
.../qemuhotplug-qemu-agent-detach.xml | 5 ++
.../qemuhotplugtestdata/qemuhotplug-qemu-agent.xml | 5 ++
11 files changed, 193 insertions(+), 39 deletions(-)
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent-detach.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+qemu-agent.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-qemu-agent-detach.xml
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-qemu-agent.xml
--
2.8.1
8 years, 6 months
[libvirt] [PATCH] qemu.conf: spaces correction
by poma
libvirt/qemu.conf: spaces correction
---
src/qemu/qemu.conf | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index 4fa5e8a..5cf4599 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -38,7 +38,7 @@
#
# ca-cert.pem - the CA master certificate
# server-cert.pem - the server certificate signed with ca-cert.pem
-# server-key.pem - the server private key
+# server-key.pem - the server private key
#
# This option allows the certificate directory to be changed
#
@@ -123,7 +123,7 @@
#
# ca-cert.pem - the CA master certificate
# server-cert.pem - the server certificate signed with ca-cert.pem
-# server-key.pem - the server private key
+# server-key.pem - the server private key
#
# This option allows the certificate directory to be changed.
#
@@ -179,7 +179,7 @@
#remote_display_port_max = 65535
# VNC WebSocket port policies, same rules apply as with remote display
-# ports. VNC WebSockets use similar display <-> port mappings, with
+# ports. VNC WebSockets use similar display <-> port mappings, with
# the exception being that ports start from 5700 instead of 5900.
#
#remote_websocket_port_min = 5700
@@ -196,7 +196,7 @@
# security_driver = [ "selinux", "apparmor" ]
#
# Notes: The DAC security driver is always enabled; as a result, the
-# value of security_driver cannot contain "dac". The value "none" is
+# value of security_driver cannot contain "dac". The value "none" is
# a special value; security_driver can be set to that value in
# isolation, but it cannot appear in a list of drivers.
#
@@ -272,7 +272,7 @@
# "/dev/null", "/dev/full", "/dev/zero",
# "/dev/random", "/dev/urandom",
# "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
-# "/dev/rtc","/dev/hpet", "/dev/vfio/vfio"
+# "/dev/rtc", "/dev/hpet", "/dev/vfio/vfio"
#]
#
# RDMA migration requires the following extra files to be added to the list:
@@ -285,11 +285,11 @@
# The default format for Qemu/KVM guest save images is raw; that is, the
-# memory from the domain is dumped out directly to a file. If you have
+# memory from the domain is dumped out directly to a file. If you have
# guests with a large amount of memory, however, this can take up quite
-# a bit of space. If you would like to compress the images while they
+# a bit of space. If you would like to compress the images while they
# are being saved to disk, you can also set "lzop", "gzip", "bzip2", or "xz"
-# for save_image_format. Note that this means you slow down the process of
+# for save_image_format. Note that this means you slow down the process of
# saving a domain in order to save disk space; the list above is in descending
# order by performance and ascending order by compression ratio.
#
@@ -319,7 +319,7 @@
# When a domain is configured to be auto-dumped, enabling this flag
# has the same effect as using the VIR_DUMP_BYPASS_CACHE flag with the
-# virDomainCoreDump API. That is, the system will avoid using the
+# virDomainCoreDump API. That is, the system will avoid using the
# file system cache while writing the dump file, but may cause
# slower operation.
#
@@ -327,17 +327,17 @@
# When a domain is configured to be auto-started, enabling this flag
# has the same effect as using the VIR_DOMAIN_START_BYPASS_CACHE flag
-# with the virDomainCreateWithFlags API. That is, the system will
+# with the virDomainCreateWithFlags API. That is, the system will
# avoid using the file system cache when restoring any managed state
# file, but may cause slower operation.
#
#auto_start_bypass_cache = 0
# If provided by the host and a hugetlbfs mount point is configured,
-# a guest may request huge page backing. When this mount point is
+# a guest may request huge page backing. When this mount point is
# unspecified here, determination of a host mount point in /proc/mounts
-# will be attempted. Specifying an explicit mount overrides detection
-# of the same in /proc/mounts. Setting the mount point to "" will
+# will be attempted. Specifying an explicit mount overrides detection
+# of the same in /proc/mounts. Setting the mount point to "" will
# disable guest hugepage backing. If desired, multiple mount points can
# be specified at once, separated by comma and enclosed in square
# brackets, for example:
@@ -353,9 +353,9 @@
#hugetlbfs_mount = "/dev/hugepages"
-# Path to the setuid helper for creating tap devices. This executable
+# Path to the setuid helper for creating tap devices. This executable
# is used to create <source type='bridge'> interfaces when libvirtd is
-# running unprivileged. libvirt invokes the helper directly, instead
+# running unprivileged. libvirt invokes the helper directly, instead
# of using "-netdev bridge", for security reasons.
#bridge_helper = "/usr/libexec/qemu-bridge-helper"
@@ -411,7 +411,7 @@
#
# WARNING: Enabling probing is a security hole in almost all
# deployments. It is strongly recommended that users update their
-# guest XML <disk> elements to include <driver type='XXXX'/>
+# guest XML <disk> elements to include <driver type='XXXX'/>
# elements instead of enabling this option.
#
#allow_disk_format_probing = 1
@@ -437,18 +437,18 @@
###################################################################
# Keepalive protocol:
# This allows qemu driver to detect broken connections to remote
-# libvirtd during peer-to-peer migration. A keepalive message is
+# libvirtd during peer-to-peer migration. A keepalive message is
# sent to the daemon after keepalive_interval seconds of inactivity
# to check if the daemon is still responding; keepalive_count is a
# maximum number of keepalive messages that are allowed to be sent
# to the daemon without getting any response before the connection
-# is considered broken. In other words, the connection is
+# is considered broken. In other words, the connection is
# automatically closed approximately after
# keepalive_interval * (keepalive_count + 1) seconds since the last
# message received from the daemon. If keepalive_interval is set to
# -1, qemu driver will not send keepalive requests during
# peer-to-peer migration; however, the remote libvirtd can still
-# send them and source libvirtd will send responses. When
+# send them and source libvirtd will send responses. When
# keepalive_count is set to 0, connections will be automatically
# closed after keepalive_interval seconds of inactivity without
# sending any keepalive messages.
@@ -471,9 +471,9 @@
# The default hostname or IP address which will be used by a migration
-# source for transferring migration data to this host. The migration
+# source for transferring migration data to this host. The migration
# source has to be able to resolve this hostname and connect to it so
-# setting "localhost" will not work. By default, the host's configured
+# setting "localhost" will not work. By default, the host's configured
# hostname is used.
#migration_host = "host.example.com"
--
2.4.11
8 years, 6 months
[libvirt] error: internal error unable to execute QEMU command 'getfd': No file descriptor supplied via SCM_RIGHTS
by 饶俊明(云平台事业部)
Hi,
I am getting the following error when I try to migrate VM on my network using virsh migrate:
error : qemuMonitorJSONCheckError:359 : internal error unable to execute QEMU command 'getfd': No file descriptor supplied via SCM_RIGHTS ;
but, other vm's running on the server successfully migrated to remote server;
Libvirt Version: libvirt-0.10.2-46.el6.x86_64;
Qemu-kvm Version: qemu-kvm-0.12.1.2-2.448.el6.3.x86_64;
OS Version: Red Hat Enterprise Linux Server release 6.6;
Thanks~
Work Hard, Have Fun, Make History!
Mail: raojunming113(a)pingan.com
-----邮件原件-----
发件人: libvir-list-bounces(a)redhat.com [mailto:libvir-list-bounces@redhat.com] 代表 libvir-list-request(a)redhat.com
发送时间: 2016年5月14日 7:47
收件人: libvir-list(a)redhat.com
主题: libvir-list Digest, Vol 126, Issue 182
Send libvir-list mailing list submissions to
libvir-list(a)redhat.com<mailto:libvir-list@redhat.com>
To subscribe or unsubscribe via the World Wide Web, visit
https://www.redhat.com/mailman/listinfo/libvir-list
or, via email, send a message with subject or body 'help' to
libvir-list-request(a)redhat.com<mailto:libvir-list-request@redhat.com>
You can reach the person managing the list at
libvir-list-owner(a)redhat.com<mailto:libvir-list-owner@redhat.com>
When replying, please edit your Subject line so it is more specific than "Re: Contents of libvir-list digest..."
Today's Topics:
1. [PATCH 3/6] iscsi: Export virISCSITargetAutologin (John Ferlan)
2. [PATCH 4/6] util: Add "--op nonpersistent" to iSCSI
sendtargets (John Ferlan)
3. [PATCH 5/6] iscsi: Inhibit autologin for only libvirt managed
targets (John Ferlan)
4. [PATCH 6/6] iscsi: Remove initiatoriqn from
virISCSIScanTargets (John Ferlan)
5. [PATCH] capabilities: Advertise cpuselection if -cpu host is
usable (Jiri Denemark)
6. Re: [PATCH 0/2] libxl: support pvusb (Jim Fehlig)
7. Re: [PATCH] libxl: add .domainInterfaceAddresses (Jim Fehlig)
----------------------------------------------------------------------
Message: 1
Date: Fri, 13 May 2016 17:29:23 -0400
From: John Ferlan <jferlan(a)redhat.com<mailto:jferlan@redhat.com>>
To: libvir-list(a)redhat.com<mailto:libvir-list@redhat.com>
Subject: [libvirt] [PATCH 3/6] iscsi: Export virISCSITargetAutologin
Message-ID: <1463174966-3185-4-git-send-email-jferlan(a)redhat.com<mailto:1463174966-3185-4-git-send-email-jferlan@redhat.com>>
Make it accessible for future patches
Signed-off-by: John Ferlan <jferlan(a)redhat.com<mailto:jferlan@redhat.com>>
---
src/libvirt_private.syms | 1 +
src/util/viriscsi.c | 2 +-
src/util/viriscsi.h | 7 +++++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index fb24808..719d753 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1675,6 +1675,7 @@ virISCSIGetSession; virISCSINodeUpdate; virISCSIRescanLUNs; virISCSIScanTargets;
+virISCSITargetAutologin;
# util/virjson.h
diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c index be296d7..ea01b3d 100644
--- a/src/util/viriscsi.c
+++ b/src/util/viriscsi.c
@@ -404,7 +404,7 @@ virISCSIGetTargets(char **const groups, }
-static int
+int
virISCSITargetAutologin(const char *portal,
const char *initiatoriqn,
const char *target, diff --git a/src/util/viriscsi.h b/src/util/viriscsi.h index f4093f7..3e7ea68 100644
--- a/src/util/viriscsi.h
+++ b/src/util/viriscsi.h
@@ -48,6 +48,13 @@ virISCSIRescanLUNs(const char *session)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
int
+virISCSITargetAutologin(const char *portal,
+ const char *initiatoriqn,
+ const char *target,
+ bool enable)
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
+
+int
virISCSIScanTargets(const char *portal,
const char *initiatoriqn,
size_t *ntargetsret,
--
2.5.5
------------------------------
Message: 2
Date: Fri, 13 May 2016 17:29:24 -0400
From: John Ferlan <jferlan(a)redhat.com<mailto:jferlan@redhat.com>>
To: libvir-list(a)redhat.com<mailto:libvir-list@redhat.com>
Subject: [libvirt] [PATCH 4/6] util: Add "--op nonpersistent" to iSCSI
sendtargets
Message-ID: <1463174966-3185-5-git-send-email-jferlan(a)redhat.com<mailto:1463174966-3185-5-git-send-email-jferlan@redhat.com>>
From: Fritz Elfert <fritz(a)fritz-elfert.de<mailto:fritz@fritz-elfert.de>>
The root cause of commit id '3c12b654' was to ensure that an iSCSI
sendtargets command to discover all the available targets on the
host didn't reset the "node.startup" value for a future restarts
on any target that libvirt is managing.
However, by adding the "--op nonpersistent" inhibits the iSCSI
initiator from recording/modifying in the bowels /var/lib/iscsi
of any target.
Signed-off-by: John Ferlan <jferlan(a)redhat.com<mailto:jferlan@redhat.com>>
---
src/util/viriscsi.c | 1 +
tests/viriscsitest.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c
index ea01b3d..36612c5 100644
--- a/src/util/viriscsi.c
+++ b/src/util/viriscsi.c
@@ -446,6 +446,7 @@ virISCSIScanTargets(const char *portal,
"--mode", "discovery",
"--type", "sendtargets",
"--portal", portal,
+ "--op", "nonpersistent",
NULL);
memset(&list, 0, sizeof(list));
diff --git a/tests/viriscsitest.c b/tests/viriscsitest.c
index c697a4a..b5b0e20 100644
--- a/tests/viriscsitest.c
+++ b/tests/viriscsitest.c
@@ -90,7 +90,9 @@ static void testIscsiadmCb(const char *const*args,
args[4] && STREQ(args[4], "sendtargets") &&
args[5] && STREQ(args[5], "--portal") &&
args[6] && STREQ(args[6], "10.20.30.40:3260,1") &&
- args[7] == NULL) {
+ args[7] && STREQ(args[7], "--op") &&
+ args[8] && STREQ(args[8], "nonpersistent") &&
+ args[9] == NULL) {
ignore_value(VIR_STRDUP(*output, iscsiadmSendtargetsOutput));
} else {
*status = -1;
--
2.5.5
------------------------------
Message: 3
Date: Fri, 13 May 2016 17:29:25 -0400
From: John Ferlan <jferlan(a)redhat.com<mailto:jferlan@redhat.com>>
To: libvir-list(a)redhat.com<mailto:libvir-list@redhat.com>
Subject: [libvirt] [PATCH 5/6] iscsi: Inhibit autologin for only
libvirt managed targets
Message-ID: <1463174966-3185-6-git-send-email-jferlan(a)redhat.com<mailto:1463174966-3185-6-git-send-email-jferlan@redhat.com>>
https://bugzilla.redhat.com/show_bug.cgi?id=1331552
Based on code originally posted by Fritz Elfert <fritz(a)fritz-elfert.de<mailto:fritz@fritz-elfert.de>>
to remove the Autologin code entirely from libvirt, but reworked to only
set Autologin for libvirt managed targets.
Commit id '3c12b654' took a "large hammer" approach to inhibiting logins
which causes issues if there are iSCSI targets not being managed by libvirt.
Now that the previous commit ensures that the iscsi initiator doesn't update
the /var/lib/iscsi tree with the results for a 'sendtargets' by using the
"--op nonpersistent" option, let's remove the code from virISCSIScanTargets
that disables autologin for every target, but add that same setting into
the start pool code for each managed/started target to ensure that nothing
else goes and tries to autologin.
Signed-off-by: John Ferlan <jferlan(a)redhat.com<mailto:jferlan@redhat.com>>
---
src/storage/storage_backend_iscsi.c | 11 +++++++++++
src/util/viriscsi.c | 15 ++-------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index 9e2d01e..5fbf390 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -404,6 +404,17 @@ virStorageBackendISCSIStartPool(virConnectPtr conn,
NULL, NULL) < 0)
goto cleanup;
+ /* Inhibit our autologin for our managed source device */
+ if (virISCSITargetAutologin(portal,
+ pool->def->source.initiator.iqn,
+ pool->def->source.devices[0].path,
+ false) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to inhibit autologin for target '%s'"),
+ pool->def->source.devices[0].path);
+ goto cleanup;
+ }
+
if (virStorageBackendISCSISetAuth(portal, conn, &pool->def->source) < 0)
goto cleanup;
diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c
index 36612c5..3133d88 100644
--- a/src/util/viriscsi.c
+++ b/src/util/viriscsi.c
@@ -415,13 +415,14 @@ virISCSITargetAutologin(const char *portal,
"--value", enable ? "automatic" : "manual",
NULL };
+ VIR_DEBUG("set autologin for '%s' to '%d'", target, enable);
return virISCSIConnection(portal, initiatoriqn, target, extraargv);
}
int
virISCSIScanTargets(const char *portal,
- const char *initiatoriqn,
+ const char *initiatoriqn ATTRIBUTE_UNUSED,
size_t *ntargetsret,
char ***targetsret)
{
@@ -459,18 +460,6 @@ virISCSIScanTargets(const char *portal,
&list, NULL, NULL) < 0)
goto cleanup;
- for (i = 0; i < list.ntargets; i++) {
- /* We have to ignore failure, because we can't undo
- * the results of 'sendtargets', unless we go scrubbing
- * around in the dirt in /var/lib/iscsi.
- */
- if (virISCSITargetAutologin(portal,
- initiatoriqn,
- list.targets[i], false) < 0)
- VIR_WARN("Unable to disable auto-login on iSCSI target %s: %s",
- portal, list.targets[i]);
- }
-
if (ntargetsret && targetsret) {
*ntargetsret = list.ntargets;
*targetsret = list.targets;
--
2.5.5
------------------------------
Message: 4
Date: Fri, 13 May 2016 17:29:26 -0400
From: John Ferlan <jferlan(a)redhat.com<mailto:jferlan@redhat.com>>
To: libvir-list(a)redhat.com<mailto:libvir-list@redhat.com>
Subject: [libvirt] [PATCH 6/6] iscsi: Remove initiatoriqn from
virISCSIScanTargets
Message-ID: <1463174966-3185-7-git-send-email-jferlan(a)redhat.com<mailto:1463174966-3185-7-git-send-email-jferlan@redhat.com>>
No longer necessary to have it, so remove it.
Signed-off-by: John Ferlan <jferlan(a)redhat.com<mailto:jferlan@redhat.com>>
---
src/storage/storage_backend_iscsi.c | 8 ++------
src/util/viriscsi.c | 3 +--
src/util/viriscsi.h | 1 -
tests/viriscsitest.c | 3 +--
4 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index 5fbf390..b6b23d3 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -197,9 +197,7 @@ virStorageBackendISCSIFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED,
if (!(portal = virStorageBackendISCSIPortal(source)))
goto cleanup;
- if (virISCSIScanTargets(portal,
- source->initiator.iqn,
- &ntargets, &targets) < 0)
+ if (virISCSIScanTargets(portal, &ntargets, &targets) < 0)
goto cleanup;
if (VIR_ALLOC_N(list.sources, ntargets) < 0)
@@ -399,9 +397,7 @@ virStorageBackendISCSIStartPool(virConnectPtr conn,
* iscsiadm doesn't let you login to a target, unless you've
* first issued a 'sendtargets' command to the portal :-(
*/
- if (virISCSIScanTargets(portal,
- pool->def->source.initiator.iqn,
- NULL, NULL) < 0)
+ if (virISCSIScanTargets(portal, NULL, NULL) < 0)
goto cleanup;
/* Inhibit our autologin for our managed source device */
diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c
index 3133d88..a2acb67 100644
--- a/src/util/viriscsi.c
+++ b/src/util/viriscsi.c
@@ -321,7 +321,7 @@ virISCSIConnection(const char *portal,
* portal. Without the sendtargets all that is received is a
* "iscsiadm: No records found"
*/
- if (virISCSIScanTargets(portal, initiatoriqn, NULL, NULL) < 0)
+ if (virISCSIScanTargets(portal, NULL, NULL) < 0)
goto cleanup;
break;
@@ -422,7 +422,6 @@ virISCSITargetAutologin(const char *portal,
int
virISCSIScanTargets(const char *portal,
- const char *initiatoriqn ATTRIBUTE_UNUSED,
size_t *ntargetsret,
char ***targetsret)
{
diff --git a/src/util/viriscsi.h b/src/util/viriscsi.h
index 3e7ea68..44fb1f4 100644
--- a/src/util/viriscsi.h
+++ b/src/util/viriscsi.h
@@ -56,7 +56,6 @@ virISCSITargetAutologin(const char *portal,
int
virISCSIScanTargets(const char *portal,
- const char *initiatoriqn,
size_t *ntargetsret,
char ***targetsret)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
diff --git a/tests/viriscsitest.c b/tests/viriscsitest.c
index b5b0e20..40e4d10 100644
--- a/tests/viriscsitest.c
+++ b/tests/viriscsitest.c
@@ -145,8 +145,7 @@ testISCSIScanTargets(const void *data)
virCommandSetDryRun(NULL, testIscsiadmCb, NULL);
- if (virISCSIScanTargets(info->portal, NULL,
- &ntargets, &targets) < 0)
+ if (virISCSIScanTargets(info->portal, &ntargets, &targets) < 0)
goto cleanup;
if (info->nexpected != ntargets) {
--
2.5.5
------------------------------
Message: 5
Date: Fri, 13 May 2016 23:36:17 +0200
From: Jiri Denemark <jdenemar(a)redhat.com<mailto:jdenemar@redhat.com>>
To: libvir-list(a)redhat.com<mailto:libvir-list@redhat.com>
Subject: [libvirt] [PATCH] capabilities: Advertise cpuselection if
-cpu host is usable
Message-ID:
<a3394e6b8d0f28591147dd981909e9a1ae39f64d.1463175377.git.jdenemar(a)redhat.com<mailto:a3394e6b8d0f28591147dd981909e9a1ae39f64d.1463175377.git.jdenemar@redhat.com>>
When -cpu host is supported by a QEMU binary, a user can use
<cpu mode='host-passthrough'/> in domain XML even when libvirtd failed
to find a matching model for the host CPU. Let's make it obvious by
advertising <cpuselection/> guest capability whenever -cpu host is
supported.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com<mailto:jdenemar@redhat.com>>
---
src/qemu/qemu_capabilities.c | 7 ++++---
tests/qemucaps2xmldata/all_1.6.0-1.xml | 1 +
tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml | 1 +
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 1bddf43..fcfd1cd 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -928,9 +928,10 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
machines = NULL;
nmachines = 0;
- if (caps->host.cpu &&
- caps->host.cpu->model &&
- virQEMUCapsGetCPUDefinitions(qemubinCaps, NULL) > 0 &&
+ if ((virQEMUCapsGet(qemubinCaps, QEMU_CAPS_CPU_HOST) ||
+ (caps->host.cpu &&
+ caps->host.cpu->model &&
+ virQEMUCapsGetCPUDefinitions(qemubinCaps, NULL) > 0)) &&
!virCapabilitiesAddGuestFeature(guest, "cpuselection", true, false))
goto cleanup;
diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.xml b/tests/qemucaps2xmldata/all_1.6.0-1.xml
index 2489f49..84d6000 100644
--- a/tests/qemucaps2xmldata/all_1.6.0-1.xml
+++ b/tests/qemucaps2xmldata/all_1.6.0-1.xml
@@ -18,6 +18,7 @@
</domain>
</arch>
<features>
+ <cpuselection/>
<deviceboot/>
<disksnapshot default='on' toggle='no'/>
<acpi default='on' toggle='yes'/>
diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
index 281fab0..28762c2 100644
--- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
+++ b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml
@@ -18,6 +18,7 @@
</domain>
</arch>
<features>
+ <cpuselection/>
<deviceboot/>
<disksnapshot default='off' toggle='no'/>
<acpi default='on' toggle='yes'/>
--
2.8.2
------------------------------
Message: 6
Date: Fri, 13 May 2016 16:57:30 -0600
From: Jim Fehlig <jfehlig(a)suse.com<mailto:jfehlig@suse.com>>
To: Joao Martins <joao.m.martins(a)oracle.com<mailto:joao.m.martins@oracle.com>>
Cc: libvirt-list(a)redhat.com<mailto:libvirt-list@redhat.com>
Subject: Re: [libvirt] [PATCH 0/2] libxl: support pvusb
Message-ID: <57365BDA.7090005(a)suse.com<mailto:57365BDA.7090005@suse.com>>
Content-Type: text/plain; charset=windows-1252
On 05/13/2016 07:14 AM, Joao Martins wrote:
> On 05/12/2016 11:43 PM, Jim Fehlig wrote:
>> Chunyan Liu wrote:
>>> This patch series is to support pvusb in libxl driver.
>>>
>>> Chunyan Liu (2):
>>> libxl: support creating guest with USB hostdev
>>> libxl: support hotplug USB host device
>> This series should also include support for converting domXML USB config to/from
>> xl.cfg(5) in src/xenconfig/xen_xl.c, along with a test.
>>
>> FYI, the series fails to build with Xen < 4.7, where LIBXL_HAVE_PVUSB is not
>> defined :-).
> Probably a nice follow-up after this series is in, would be to add the USB
> subsys type to domain capabilities (that you address in the OVMF series)
Yes, good point. I'll add it to that series if this one makes it in first.
Speaking of the OVMF series, I've fixed a few things after more testing and will
rebase and resend a V2. Thanks in advance if either of you have time to look at it.
Regards,
Jim
------------------------------
Message: 7
Date: Fri, 13 May 2016 17:47:09 -0600
From: Jim Fehlig <jfehlig(a)suse.com<mailto:jfehlig@suse.com>>
To: Chunyan Liu <cyliu(a)suse.com<mailto:cyliu@suse.com>>, libvirt-list(a)redhat.com<mailto:libvirt-list@redhat.com>
Subject: Re: [libvirt] [PATCH] libxl: add .domainInterfaceAddresses
Message-ID: <5736677D.8030209(a)suse.com<mailto:5736677D.8030209@suse.com>>
Content-Type: text/plain; charset=windows-1252
On 05/13/2016 12:21 AM, Chunyan Liu wrote:
> 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<mailto:cyliu@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;
> +}
It's unfortunate this is a copy-paste from the qemu driver. The code is not
trivial and any bug fixes in one copy could be missed in the other. A lot of the
function is domain related, so probably can't be abstracted further to the
network code. Have you considered approaches that allow the drivers to share
this code?
Regards,
Jim
------------------------------
--
libvir-list mailing list
libvir-list(a)redhat.com<mailto:libvir-list@redhat.com>
https://www.redhat.com/mailman/listinfo/libvir-list
End of libvir-list Digest, Vol 126, Issue 182
*********************************************
********************************************************************************************************************************
The information in this email is confidential and may be legally privileged. If you have received this email in error or are not the intended recipient, please immediately notify the sender and delete this message from your computer. Any use, distribution, or copying of this email other than by the intended recipient is strictly prohibited. All messages sent to and from us may be monitored to ensure compliance with internal policies and to protect our business.
Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. Anyone who communicates with us by email is taken to accept these risks.
收发邮件者请注意:
本邮件含保密信息,若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。
进出邮件均受到本公司合规监控。邮件可能发生被截留、被修改、丢失、被破坏或包含计算机病毒等不安全情况。
********************************************************************************************************************************
8 years, 6 months
[libvirt] 撤回: error: internal error unable to execute QEMU command 'getfd': No file descriptor supplied via SCM_RIGHTS
by 饶俊明(云平台事业部)
饶俊明(云平台事业部) 将撤回邮件“error: internal error unable to execute QEMU command 'getfd': No file descriptor supplied via SCM_RIGHTS”。
********************************************************************************************************************************
The information in this email is confidential and may be legally privileged. If you have received this email in error or are not the intended recipient, please immediately notify the sender and delete this message from your computer. Any use, distribution, or copying of this email other than by the intended recipient is strictly prohibited. All messages sent to and from us may be monitored to ensure compliance with internal policies and to protect our business.
Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. Anyone who communicates with us by email is taken to accept these risks.
收发邮件者请注意:
本邮件含保密信息,若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。
进出邮件均受到本公司合规监控。邮件可能发生被截留、被修改、丢失、被破坏或包含计算机病毒等不安全情况。
********************************************************************************************************************************
8 years, 6 months