[libvirt] [PATCH] remote generator: handle remoteDomainCreateWithFlags()
by Marc Hartmayer
This commit removes the handcrafted code for
remoteDomainCreateWithFlags() and lets it auto generate.
A little bit of history repeating...
Commit 03d813bbcd7b4a183601055006 removed the auto generation of
remoteDomainCreateWithFlags() because it was thought that the design
flaw in the remote protocol for virDomainCreate is also within the
remote protocol for virDomainCreateWithFlags. As the commit message of
ddaf15d7a3863d54e242f8ff75 mentions this is not the case therefore we
can auto generate the client part.
Even worse there was a typo in remoteDomainCreateWithFlags()
'remote_domain_create_with_flags_args ret;' but in fact it has to be
'remote_domain_create_with_flags_ret ret;'.
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk(a)linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
---
src/remote/remote_driver.c | 29 -----------------------------
src/remote/remote_protocol.x | 2 +-
2 files changed, 1 insertion(+), 30 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 8880520..7be9f17 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -2627,35 +2627,6 @@ remoteDomainCreate(virDomainPtr domain)
return rv;
}
-static int
-remoteDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
-{
- int rv = -1;
- struct private_data *priv = dom->conn->privateData;
- remote_domain_create_with_flags_args args;
- remote_domain_create_with_flags_args ret;
-
- remoteDriverLock(priv);
-
- make_nonnull_domain(&args.dom, dom);
- args.flags = flags;
-
- memset(&ret, 0, sizeof(ret));
- if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS,
- (xdrproc_t)xdr_remote_domain_create_with_flags_args, (char *)&args,
- (xdrproc_t)xdr_remote_domain_create_with_flags_ret, (char *)&ret) == -1) {
- goto done;
- }
-
- dom->id = ret.dom.id;
- xdr_free((xdrproc_t) &xdr_remote_domain_create_with_flags_ret, (char *) &ret);
- rv = 0;
-
- done:
- remoteDriverUnlock(priv);
- return rv;
-}
-
static char *
remoteDomainGetSchedulerType(virDomainPtr domain, int *nparams)
{
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index e8382dc..5b594ea 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -4741,7 +4741,7 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_EVENT_IO_ERROR_REASON = 195,
/**
- * @generate: server
+ * @generate: both
* @acl: domain:start
*/
REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS = 196,
--
2.5.5
7 years, 10 months
[libvirt] [PATCH] conf: check port range even for USB hubs
by Ján Tomko
Move the range check introduced by commit 2650d5e into
virDomainUSBAddressFindPort. That way both virDomainUSBAddressRelease
and virDomainUSBAddressSetAddHub can benefit from it.
Reported-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_addr.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 555da59..acff32f 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -1785,7 +1785,7 @@ virDomainUSBAddressFindPort(virDomainUSBAddressSetPtr addrs,
const char *portStr)
{
virDomainUSBAddressHubPtr hub = NULL;
- ssize_t i, lastIdx;
+ ssize_t i, lastIdx, targetPort;
if (info->addr.usb.bus >= addrs->nbuses ||
!addrs->buses[info->addr.usb.bus]) {
@@ -1820,7 +1820,15 @@ virDomainUSBAddressFindPort(virDomainUSBAddressSetPtr addrs,
}
}
- *targetIdx = info->addr.usb.port[lastIdx] - 1;
+ targetPort = info->addr.usb.port[lastIdx] - 1;
+ if (targetPort >= virBitmapSize(hub->portmap)) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("requested USB port %s not present on USB bus %u"),
+ portStr, info->addr.usb.bus);
+ return NULL;
+ }
+
+ *targetIdx = targetPort;
return hub;
}
@@ -2072,13 +2080,6 @@ virDomainUSBAddressReserve(virDomainDeviceInfoPtr info,
portStr)))
goto cleanup;
- if (targetPort >= virBitmapSize(targetHub->portmap)) {
- virReportError(VIR_ERR_XML_ERROR,
- _("requested USB port %s not present on USB bus %u"),
- portStr, info->addr.usb.bus);
- goto cleanup;
- }
-
if (virBitmapIsBitSet(targetHub->portmap, targetPort)) {
virReportError(VIR_ERR_XML_ERROR,
_("Duplicate USB address bus %u port %s"),
--
2.10.2
7 years, 10 months
[libvirt] [PATCH] qemu: assign USB port on a selected hub for all devices
by Ján Tomko
Due to a logic error, the autofilling of USB port when a bus is
specified:
<address type='usb' bus='0'/>
does not work for non-hub devices on domain startup.
Fix the logic in qemuDomainAssignUSBPortsIterator to also
assign ports for USB addresses that do not yet have one.
https://bugzilla.redhat.com/show_bug.cgi?id=1374128
---
src/qemu/qemu_domain_address.c | 7 ++++++-
tests/qemuxml2argvdata/qemuxml2argv-usb-port-missing.args | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 9cd1e9e..5c09620 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -2238,7 +2238,12 @@ qemuDomainAssignUSBPortsIterator(virDomainDeviceInfoPtr info,
{
struct qemuAssignUSBIteratorInfo *data = opaque;
- if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
+ if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
+ info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB)
+ return 0;
+
+ if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB &&
+ virDomainUSBAddressPortIsValid(info->addr.usb.port))
return 0;
return virDomainUSBAddressAssign(data->addrs, info);
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-usb-port-missing.args b/tests/qemuxml2argvdata/qemuxml2argv-usb-port-missing.args
index ff743c8..fbb328e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-usb-port-missing.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-usb-port-missing.args
@@ -22,5 +22,5 @@ server,nowait \
-usb \
-device usb-hub,id=hub0,bus=usb.0,port=1 \
-device usb-hub,id=hub1,bus=usb.0,port=2 \
--device usb-mouse,id=input0,bus=usb.0 \
+-device usb-mouse,id=input0,bus=usb.0,port=1.1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
--
2.10.2
7 years, 10 months
[libvirt] [PATCH] [libvirt-perl PATCH] Add more PERF_ constants
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
Changes | 10 +++++++++-
Virt.xs | 9 +++++++++
lib/Sys/Virt/Domain.pm | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 72 insertions(+), 1 deletion(-)
diff --git a/Changes b/Changes
index 90ee3a4..81a4ff4 100644
--- a/Changes
+++ b/Changes
@@ -2,7 +2,15 @@ Revision history for perl module Sys::Virt
3.1.0 2017-03-00
- - XXX
+ - Add PERF_PARAM_CPU_CLOCK constant
+ - Add PERF_PARAM_TASK_CLOCK constant
+ - Add PERF_PARAM_PAGE_FAULTS constant
+ - Add PERF_PARAM_CONTEXT_SWITCHES constant
+ - Add PERF_PARAM_CPU_MIGRATIONS constant
+ - Add PERF_PARAM_PAGE_FAULTS_MIN constant
+ - Add PERF_PARAM_PAGE_FAULTS_MAJ constant
+ - Add PERF_PARAM_ALIGNMENT_FAULTS constant
+ - Add PERF_PARAM_EMULATION_FAULTS constant
3.0.0 2017-01-19
diff --git a/Virt.xs b/Virt.xs
index a2947b6..7a33d7b 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -8491,6 +8491,15 @@ BOOT:
REGISTER_CONSTANT_STR(VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND, PERF_PARAM_STALLED_CYCLES_FRONTEND);
REGISTER_CONSTANT_STR(VIR_PERF_PARAM_STALLED_CYCLES_BACKEND, PERF_PARAM_STALLED_CYCLES_BACKEND);
REGISTER_CONSTANT_STR(VIR_PERF_PARAM_REF_CPU_CYCLES, PERF_PARAM_REF_CPU_CYCLES);
+ REGISTER_CONSTANT_STR(VIR_PERF_PARAM_CPU_CLOCK, PERF_PARAM_CPU_CLOCK);
+ REGISTER_CONSTANT_STR(VIR_PERF_PARAM_TASK_CLOCK, PERF_PARAM_TASK_CLOCK);
+ REGISTER_CONSTANT_STR(VIR_PERF_PARAM_PAGE_FAULTS, PERF_PARAM_PAGE_FAULTS);
+ REGISTER_CONSTANT_STR(VIR_PERF_PARAM_CONTEXT_SWITCHES, PERF_PARAM_CONTEXT_SWITCHES);
+ REGISTER_CONSTANT_STR(VIR_PERF_PARAM_CPU_MIGRATIONS, PERF_PARAM_CPU_MIGRATIONS);
+ REGISTER_CONSTANT_STR(VIR_PERF_PARAM_PAGE_FAULTS_MIN, PERF_PARAM_PAGE_FAULTS_MIN);
+ REGISTER_CONSTANT_STR(VIR_PERF_PARAM_PAGE_FAULTS_MAJ, PERF_PARAM_PAGE_FAULTS_MAJ);
+ REGISTER_CONSTANT_STR(VIR_PERF_PARAM_ALIGNMENT_FAULTS, PERF_PARAM_ALIGNMENT_FAULTS);
+ REGISTER_CONSTANT_STR(VIR_PERF_PARAM_EMULATION_FAULTS, PERF_PARAM_EMULATION_FAULTS);
REGISTER_CONSTANT_STR(VIR_DOMAIN_BANDWIDTH_IN_AVERAGE, BANDWIDTH_IN_AVERAGE);
REGISTER_CONSTANT_STR(VIR_DOMAIN_BANDWIDTH_IN_PEAK, BANDWIDTH_IN_PEAK);
diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm
index aa7b5bd..d191ec0 100644
--- a/lib/Sys/Virt/Domain.pm
+++ b/lib/Sys/Virt/Domain.pm
@@ -2809,6 +2809,60 @@ frequency scaling by applications running on the platform.
It corresponds to the "perf.ref_cpu_cycles" field in the
*Stats APIs.
+=item Sys::Virt::Domain::PERF_PARAM_CPU_CLOCK
+The cpu_clock perf event counter which can be used to
+measure the count of cpu clock by applications running
+on the platform. It corresponds to the "perf.cpu_clock"
+field in the *Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_TASK_CLOCK
+The task_clock perf event counter which can be used to
+measure the count of task clock by applications running
+on the platform. It corresponds to the "perf.task_clock"
+field in the *Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS
+The page_faults perf event counter which can be used to
+measure the count of page faults by applications running
+on the platform. It corresponds to the "perf.page_faults"
+field in the *Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_CONTEXT_SWITCHES
+The context_switches perf event counter which can be used to
+measure the count of context switches by applications running
+on the platform. It corresponds to the "perf.context_switches"
+field in the *Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_CPU_MIGRATIONS
+The cpu_migrations perf event counter which can be used to
+measure the count of cpu migrations by applications running
+on the platform. It corresponds to the "perf.cpu_migrations"
+field in the *Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS_MIN
+The page_faults_min perf event counter which can be used to
+measure the count of minor page faults by applications running
+on the platform. It corresponds to the "perf.page_faults_min"
+field in the *Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_PAGE_FAULTS_MAJ
+The page_faults_maj perf event counter which can be used to
+measure the count of major page faults by applications running
+on the platform. It corresponds to the "perf.page_faults_maj"
+field in the *Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_ALIGNMENT_FAULTS
+The alignment_faults perf event counter which can be used to
+measure the count of alignment faults by applications running
+on the platform. It corresponds to the "perf.alignment_faults"
+field in the *Stats APIs.
+
+=item Sys::Virt::Domain::PERF_PARAM_EMULATION_FAULTS
+The emulation_faults perf event counter which can be used to
+measure the count of emulation faults by applications running
+on the platform. It corresponds to the "perf.emulation_faults"
+field in the *Stats APIs.
+
=back
=head2 VCPU FLAGS
--
1.9.3
7 years, 10 months
[libvirt] [PATCH 1/1] qemu: libvirt live migration over RDMA of ipv6 addr failed
by David Dai
Using libvirt to do live migration over RDMA via ip v6 address failed.
For example:
# virsh migrate --live --migrateuri rdma://[deba::2222]:49152 \
rhel73_host1_guest1 qemu+ssh://[deba::2222]/system --verbose
root@deba::2222's password:
error: internal error: unable to execute QEMU command 'migrate': RDMA ERROR:
could not rdma_getaddrinfo address deba
As we can see, the ip v6 address used by rdma_getaddrinfo() has only "deba"
part. It should be "deba::2222".
1) According to rfc 3986, a literal ip v6 address should be enclosed
in '[' and ']'.
When using virsh command to do live migration via ip v6 addresss, user
will input the ip v6 address with brackets (i.e. rdma://[deba::2222]:49152).
libvirt will parse command line option by calling virURIParse().
Inside it calls virStringStripIPv6Brackets() to strip off the brackets.
The uri passed in to virURIParse() is:
"uri = rdma://[deba::2222]:49152"
Inside virURIParse() routine, it will strip off the bracket '[' and ']' if
it's ip v6 address. Then save the ip v6 address in this format "deba::2222"
in the virURI->server field, and to be passed to qemu.
2) At the beginning of migration, in qemu's qemu_rdma_data_init(host_port)
routine, it calls inet_parse(host_port) routine to parse the ip v6 address and
port string obtained from libvirt.
The input string host_port passed to qemu_rdma_data_init() can be:
"hostname:port", or
"ipv4address:port", or
"[ipv6address]:port" (i.e "[deba::2222]:49152"), or
"ipv6address:port" (i.e "deba::2222:49152").
Existing qemu api inet_parse() can handle the above first 3 cases properly,
but didn't handle the last case ("ipv6address:port") correctly.
In this live migration over rdma via ip v6 address case, the server ip v6
address obtained from libvirt doesn't contain the brackets '[' and ']'
(i.e. "deba::2222:49152"). It caused inet_parse() to parse only "deba" part,
and stopped at the 1st colon ':'. As the result, the subsequent
rdma_getaddrinfo() with ip address "deba" will fail.
NOTE:
If using libvirt to do live migration over TCP via ip v6 address:
# virsh migrate --live --migrateuri tcp://[deba::2222]:49152 \
rhel73_host1_guest1 qemu+ssh://[deba::2222]/system --verbose
It works fine.
In migrateuri of tcp case, libvirt will call virNetSocketNewConnectTCP()
directly to connect to remote "deba::2222" after it strips off
the brackets '[' and ']' for an ip v6 address.
On qemu side, fd_start_outgoing_migration() will be called to do migration.
It doesn't call inet_parse(). So we don't see issue in tcp case.
Solution:
Originally the patch was proposed to Qemu-devel commuity to changed code
in inet_parse() to handle ipv6 address w/o brackets ("ipv6:port" format).
Daniel's review comment is it's mandatory to use [] when providing a
numeric IPv6 address. So there's nothing broken in QEMU. libvirt needs
fixing to pass correct data to QEMU.
Now the new proposed patch is in libvirt's qemu driver, in
qemuMonitorMigrateToHost() routine, it will assemble uri based on host
and port values passed in. If the host passed in is an ipv6 address, we
will enclose brackets [] for the ipv6 address here before calling
qemuMonitorJSONMigrate().
The -incoming CLI part of enclosed brackets ipv6 address is already
taken care of in qemuMigrationPrepareIncoming() routine.
Signed-off-by: David Dai <zdai(a)linux.vnet.ibm.com>
---
src/qemu/qemu_monitor.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index b7be5e7..258665c 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2577,8 +2577,12 @@ qemuMonitorMigrateToHost(qemuMonitorPtr mon,
QEMU_CHECK_MONITOR(mon);
- if (virAsprintf(&uri, "%s:%s:%d", protocol, hostname, port) < 0)
- return -1;
+ if (strchr(hostname, ':')) {
+ if (virAsprintf(&uri, "%s:[%s]:%d", protocol, hostname, port) < 0)
+ return -1;
+ } else if (virAsprintf(&uri, "%s:%s:%d", protocol, hostname, port) < 0) {
+ return -1;
+ }
if (mon->json)
ret = qemuMonitorJSONMigrate(mon, flags, uri);
--
1.7.1
7 years, 10 months
[libvirt] question about connection between vms in two physical hosts
by 无敌浪子
Hi there,
I have some vms in two different physical hosts, the hosts are connected directly instead of a switcher, I'd like to make all these vms connected. the condition right now is that vm network type is nat, vm behind nat cannot get the new connection inbound, I suppose if I can make the inbound connection acceptable or if there is any other solution ? Thank you
best wishes
bill
7 years, 10 months
[libvirt] [PATCH v2] cpu: fix typo: rename __kvm_hv_spinlock to __kvm_hv_spinlocks
by Maxim Nestratov
Strings associated with virDomainHyperv values in domain_conf.c are used to
construct HyperV CPU features names to be compared with names defined in
cpu_x86_data.h and the names for HyperV "spinlocks" feature don't match.
This leads to a misleading warning:
"host doesn't support hyperv 'spinlocks' feature" even when it's supported.
Let's fix it and rename along with it VIR_CPU_x86_KVM_HV_SPINLOCK to
VIR_CPU_x86_KVM_HV_SPINLOCKS.
Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
---
src/cpu/cpu_x86.c | 4 ++--
src/cpu/cpu_x86_data.h | 8 +++++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 23a519e..40d98ee 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -100,7 +100,7 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_STIMER,
0x40000003, 0x00000008);
KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RELAXED,
0x40000003, 0x00000020);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SPINLOCK,
+KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SPINLOCKS,
0x40000003, 0x00000022);
KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VAPIC,
0x40000003, 0x00000030);
@@ -124,7 +124,7 @@ static virCPUx86Feature x86_kvm_features[] =
KVM_FEATURE(VIR_CPU_x86_KVM_HV_SYNIC),
KVM_FEATURE(VIR_CPU_x86_KVM_HV_STIMER),
KVM_FEATURE(VIR_CPU_x86_KVM_HV_RELAXED),
- KVM_FEATURE(VIR_CPU_x86_KVM_HV_SPINLOCK),
+ KVM_FEATURE(VIR_CPU_x86_KVM_HV_SPINLOCKS),
KVM_FEATURE(VIR_CPU_x86_KVM_HV_VAPIC),
KVM_FEATURE(VIR_CPU_x86_KVM_HV_VPINDEX),
KVM_FEATURE(VIR_CPU_x86_KVM_HV_RESET),
diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h
index 4660ab6..4c51e43 100644
--- a/src/cpu/cpu_x86_data.h
+++ b/src/cpu/cpu_x86_data.h
@@ -49,11 +49,17 @@ struct _virCPUx86CPUID {
# define VIR_CPU_x86_KVM_PV_EOI "__kvm_pv_eoi"
# define VIR_CPU_x86_KVM_PV_UNHALT "__kvm_pv_unhalt"
# define VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT "__kvm_clocksource_stable"
+
+/*
+ * The following HyperV feature names suffixes must exactly match corresponding
+ * ones defined in domain_conf.c. E.g "__kvm_runtime" -> "runtime",
+ * "__kvm_hv_spinlocks" -> "spinlocks" etc.
+*/
# define VIR_CPU_x86_KVM_HV_RUNTIME "__kvm_hv_runtime"
# define VIR_CPU_x86_KVM_HV_SYNIC "__kvm_hv_synic"
# define VIR_CPU_x86_KVM_HV_STIMER "__kvm_hv_stimer"
# define VIR_CPU_x86_KVM_HV_RELAXED "__kvm_hv_relaxed"
-# define VIR_CPU_x86_KVM_HV_SPINLOCK "__kvm_hv_spinlock"
+# define VIR_CPU_x86_KVM_HV_SPINLOCKS "__kvm_hv_spinlocks"
# define VIR_CPU_x86_KVM_HV_VAPIC "__kvm_hv_vapic"
# define VIR_CPU_x86_KVM_HV_VPINDEX "__kvm_hv_vpindex"
# define VIR_CPU_x86_KVM_HV_RESET "__kvm_hv_reset"
--
2.4.11
7 years, 10 months
[libvirt] [PATCH 00/10] Another set of qemu namespace fixes
by Michal Privoznik
The major problem was with symlinks. Imagine the following chain of symlinks:
/dev/my_awesome_disk -> /home/user/blaah -> /dev/disk/by-uuid/$uuid -> /dev/sda
We really need to create all those /dev/* symlinks and /dev/sda device. Also,
some other (less critical) bugs are fixed.
Michal Privoznik (10):
virProcessRunInMountNamespace: Report errors from child
util: Introduce virFileReadLink
qemuDomainPrepareDisk: Fix ordering
qemuSecurityRestoreAllLabel: Don't use transactions
qemu_security: Use more transactions
qemuDomain{Attach,Detach}Device NS helpers: Don't relabel devices
qemuDomainCreateDevice: Properly deal with symlinks
qemuDomainCreateDevice: Don't loop endlessly
qemuDomainAttachDeviceMknod: Deal with symlinks
qemuDomainAttachDeviceMknod: Don't loop endlessly
src/libvirt_private.syms | 1 +
src/qemu/qemu_domain.c | 438 +++++++++++++++++++++++++++--------------------
src/qemu/qemu_hotplug.c | 20 +--
src/qemu/qemu_security.c | 137 +++++++++------
src/util/virfile.c | 12 ++
src/util/virfile.h | 2 +
src/util/virprocess.c | 8 +-
7 files changed, 374 insertions(+), 244 deletions(-)
--
2.11.0
7 years, 10 months
Re: [libvirt] Issue with libvirtd
by Michal Privoznik
On 01/10/2017 07:48 AM, Faysal Ali wrote:
> Hi Michal,
[It is usually good idea to keep the list CCed - it may help others
finding a solution to their problems]
>
> Well I have created my little python/libivrt app to manage my virtual
> machines. I am using python socket to check libivrt port availability, and
> the error End of file while reading data: Input/output error* only happens
> whenever that python socket script is trigger.
>
> Here is the script of python socket
>
> import libvirt, socket, sys
>
> hostname='kvm09'
> port = 16509
>
> try:
> socket_host = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> socket_host.settimeout(1)
> socket_host.connect((hostname, port))
> socket_host.close()
> print 'true'
> except Exception as err:
> print err
Ah, I haven't expected this. Of course your are seeing the error
message. Libvirt has its own protocol on the top of TCP and since you
are connecting and dying immediately - without sending any valid libvirt
packet, the daemon logs an error. This is perfectly expected.
Also, this is *not* how you connect to libvirt. You want to open a
libvirt connection:
conn = libvirt.open(uri)
dom = conn.lookupByName(name)
...
Michal
7 years, 10 months
[libvirt] [PATCH] char: drop data written to a disconnected pty
by Ed Swierk
When a serial port writes data to a pty that's disconnected, drop the
data and return the length dropped. This avoids triggering pointless
retries in callers like the 16550A serial_xmit(), and causes
qemu_chr_fe_write() to write all data to the log file, rather than
logging only while a pty client like virsh console happens to be
connected.
Signed-off-by: Ed Swierk <eswierk(a)skyportsystems.com>
---
qemu-char.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-char.c b/qemu-char.c
index 676944a..ccb6923 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1528,7 +1528,7 @@ static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
/* guest sends data, check for (re-)connect */
pty_chr_update_read_handler_locked(chr);
if (!s->connected) {
- return 0;
+ return len;
}
}
return io_channel_send(s->ioc, buf, len);
--
1.9.1
7 years, 10 months