[libvirt] [PATCH 1/2 v3] json: add stream parser
by Dmitry Guryanov
Add function virJSONValueFromStream, which reads data from
a stream and passes it to json parser. When end of the object
is reached, it returns this object.
To avoid reading from the stream by single bytes it reads to
a buffer (in a structure virJSONStreamParserState), which should
be passed to a consequent call of this function. So if the end
of one object and the beginning of the next object have been
read by a single system call - virJSONValueFromStream handle
it correctly.
example of usage:
virJSONValuePtr v;
virJSONStreamParserState state;
memset(&state, 0, sizeof(state));
while (1) {
v = virJSONValueFromStream(mon->fd, &state);
if (v == (void *)-1)
/* error */
break;
if (v == NULL)
/* file descriptor has been closed */
break;
/* handle object 'v' */
}
I need such function for the parallels driver. It caches info
about domains and needs some mechanism to update this cache.
There is a "prlsrvctl monitor" command which waits for events
forever and prints info about events to stdout in json format.
So parallels driver could start separate thread which will
read from prlsrvctl's stdout and update cache accordingly.
There is the same task in qemu_monitor_json, but each json object
is printed in a separate line there. It's not possible in my case,
because some fields could have line endings.
---
src/libvirt_private.syms | 1 +
src/util/virjson.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++
src/util/virjson.h | 8 +++
3 files changed, 119 insertions(+), 0 deletions(-)
* This patch left unchanged since v2
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index b449293..0db2a0d 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1391,6 +1391,7 @@ virJSONValueArrayGet;
virJSONValueArraySize;
virJSONValueFree;
virJSONValueFromString;
+virJSONValueFromStream;
virJSONValueGetBoolean;
virJSONValueGetNumberDouble;
virJSONValueGetNumberInt;
diff --git a/src/util/virjson.c b/src/util/virjson.c
index 3a6f520..9559a26 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -1022,6 +1022,116 @@ cleanup:
return ret;
}
+/*
+ * Read single JSON object from the stream. Store data, which
+ * have already been read from the stream, but belongs to the
+ * next object to the virJSONStreamParserState structure. So that
+ * consequent call to this function will parse it and return that
+ * object.
+ *
+ * @fd: file descriptor, opened for reading
+ * @state: pointer to the structure with buffer for data, read from fd.
+ *
+ * Return (void *)-1 in case of error, NULL when eof reached,
+ * pointer to the virJSONValuePtr in case of success.
+ */
+
+virJSONValuePtr virJSONValueFromStream(int fd, virJSONStreamParserStatePtr state)
+{
+ yajl_handle hand;
+ virJSONParser parser = { NULL, NULL, 0 };
+ virJSONValuePtr value = (void *)-1;
+# ifndef WITH_YAJL2
+ yajl_parser_config cfg = { 1, 1 };
+# endif
+ ssize_t len;
+ int ret = 0;
+ bool done = false;
+
+# ifdef WITH_YAJL2
+ hand = yajl_alloc(&parserCallbacks, NULL, &parser);
+ if (hand) {
+ yajl_config(hand, yajl_allow_comments, 1);
+ yajl_config(hand, yajl_dont_validate_strings, 0);
+ yajl_config(hand, yajl_allow_trailing_garbage, 1);
+ }
+# else
+ hand = yajl_alloc(&parserCallbacks, &cfg, NULL, &parser);
+# endif
+ if (!hand) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to create JSON parser"));
+ goto cleanup;
+ }
+
+ do {
+ if (strlen(&state->buf[state->pos]) == 0) {
+ state->pos = 0;
+ memset(state->buf, 0, sizeof(state->buf));
+ len = read(fd, state->buf, sizeof(state->buf) - 1);
+
+ if (len < 0) {
+ virReportSystemError(errno, _("cannot read from fd '%d'"), fd);
+ virJSONValueFree(parser.head);
+ goto cleanup;
+ }
+
+ if (len == 0) {
+ value = parser.head;
+ goto cleanup;
+ }
+ }
+
+ for (;state->pos < strlen(state->buf); state->pos++) {
+ unsigned char *buf = (unsigned char *)&state->buf[state->pos];
+ /*
+ * New yaml library has useful function yajl_get_bytes_consumed
+ * which allows parsing by larger chunks. But rhel-6 has 1.0.7
+ * version, which doesn't have it.
+ */
+ ret = yajl_parse(hand, buf, 1);
+# ifdef WITH_YAJL2
+ if (ret == 0 && yajl_get_bytes_consumed(hand) == 0) {
+ done = true;
+ /* state->pos points to the first symbol after current
+ * object */
+ break;
+ } else if (ret != 0) {
+# else
+ if (ret == 0) {
+ done = true;
+ /* state->pos points to the last symbol of the
+ * current object */
+ state->pos++;
+ break;
+ } else if (ret != yajl_status_insufficient_data) {
+# endif
+ unsigned char *errstr = yajl_get_error(hand, 1, buf, 1);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse json: %s"),
+ (const char*) errstr);
+ VIR_FREE(errstr);
+ virJSONValueFree(parser.head);
+ goto cleanup;
+ }
+ }
+ } while (!done);
+
+ value = parser.head;
+
+cleanup:
+ yajl_free(hand);
+
+ if (parser.nstate) {
+ int i;
+ for (i = 0 ; i < parser.nstate ; i++) {
+ VIR_FREE(parser.state[i].key);
+ }
+ }
+
+ VIR_DEBUG("result=%p", parser.head);
+ return value;
+}
static int virJSONValueToStringOne(virJSONValuePtr object,
yajl_gen g)
diff --git a/src/util/virjson.h b/src/util/virjson.h
index db11396..1f5ce38 100644
--- a/src/util/virjson.h
+++ b/src/util/virjson.h
@@ -48,6 +48,8 @@ typedef virJSONObjectPair *virJSONObjectPairPtr;
typedef struct _virJSONArray virJSONArray;
typedef virJSONArray *virJSONArrayPtr;
+typedef struct _virJSONStreamParserState virJSONStreamParserState;
+typedef virJSONStreamParserState *virJSONStreamParserStatePtr;
struct _virJSONObjectPair {
char *key;
@@ -77,6 +79,11 @@ struct _virJSONValue {
} data;
};
+struct _virJSONStreamParserState {
+ char buf[1024];
+ size_t pos;
+};
+
void virJSONValueFree(virJSONValuePtr value);
virJSONValuePtr virJSONValueNewString(const char *data);
@@ -138,5 +145,6 @@ int virJSONValueObjectRemoveKey(virJSONValuePtr object, const char *key,
virJSONValuePtr virJSONValueFromString(const char *jsonstring);
char *virJSONValueToString(virJSONValuePtr object,
bool pretty);
+virJSONValuePtr virJSONValueFromStream(int fd, virJSONStreamParserStatePtr state);
#endif /* __VIR_JSON_H_ */
--
1.7.1
11 years, 10 months
[libvirt] [PATCH] qemu_migration: Move waiting for SPICE migration
by Michal Privoznik
Currently, we wait for SPICE to migrate in the very same loop where we
wait for qemu to migrate. This has a disadvantage of slowing seamless
migration down. One one hand, we should not kill the domain until all
SPICE data has been migrated. On the other hand, there is no need to
wait in the very same loop and hence slowing down 'cont' on the
destination. For instance, if users are watching a movie, they can
experience the movie to be stopped for a couple of seconds, as
processors are not running nor on src nor on dst as libvirt waits for
SPICE to migrate. We should move the waiting phase to migration CONFIRM
phase.
---
src/qemu/qemu_migration.c | 57 ++++++++++++++++++++++++++++++++---------------
1 file changed, 39 insertions(+), 18 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index ca79bc2..1d65df5 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1582,6 +1582,40 @@ cleanup:
return ret;
}
+static int
+qemuMigrationWaitForSpice(virQEMUDriverPtr driver,
+ virDomainObjPtr vm)
+{
+ qemuDomainObjPrivatePtr priv = vm->privateData;
+ bool wait_for_spice = false;
+ bool spice_migrated = false;
+
+ if (vm->def->ngraphics == 1 &&
+ vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
+ virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SEAMLESS_MIGRATION))
+ wait_for_spice = true;
+
+ if (!wait_for_spice)
+ return 0;
+
+ while (!spice_migrated) {
+ /* Poll every 50ms for progress & to allow cancellation */
+ struct timespec ts = { .tv_sec = 0, .tv_nsec = 50 * 1000 * 1000ull };
+
+ qemuDomainObjEnterMonitor(driver, vm);
+ if (qemuMonitorGetSpiceMigrationStatus(priv->mon,
+ &spice_migrated) < 0) {
+ qemuDomainObjExitMonitor(driver, vm);
+ return -1;
+ }
+ qemuDomainObjExitMonitor(driver, vm);
+ virObjectUnlock(vm);
+ nanosleep(&ts, NULL);
+ virObjectLock(vm);
+ }
+
+ return 0;
+}
static int
qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver,
@@ -1591,19 +1625,10 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver,
{
qemuDomainObjPrivatePtr priv = vm->privateData;
int ret;
- bool wait_for_spice = false;
- bool spice_migrated = false;
qemuMonitorMigrationStatus status;
memset(&status, 0, sizeof(status));
- /* If guest uses SPICE and supports seamles_migration we have to hold up
- * migration finish until SPICE server transfers its data */
- if (vm->def->ngraphics == 1 &&
- vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
- virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SEAMLESS_MIGRATION))
- wait_for_spice = true;
-
ret = qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob);
if (ret < 0) {
/* Guest already exited; nothing further to update. */
@@ -1611,13 +1636,6 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver,
}
ret = qemuMonitorGetMigrationStatus(priv->mon, &status);
- /* If qemu says migrated, check spice */
- if (wait_for_spice &&
- ret == 0 &&
- status.status == QEMU_MONITOR_MIGRATION_STATUS_COMPLETED)
- ret = qemuMonitorGetSpiceMigrationStatus(priv->mon,
- &spice_migrated);
-
qemuDomainObjExitMonitor(driver, vm);
priv->job.status = status;
@@ -1657,8 +1675,7 @@ qemuMigrationUpdateJobStatus(virQEMUDriverPtr driver,
break;
case QEMU_MONITOR_MIGRATION_STATUS_COMPLETED:
- if ((wait_for_spice && spice_migrated) || (!wait_for_spice))
- priv->job.info.type = VIR_DOMAIN_JOB_COMPLETED;
+ priv->job.info.type = VIR_DOMAIN_JOB_COMPLETED;
ret = 0;
break;
@@ -4121,6 +4138,10 @@ int qemuMigrationConfirm(virQEMUDriverPtr driver,
* domain object, but if no, resume CPUs
*/
if (retcode == 0) {
+ /* If guest uses SPICE and supports seamless migration we have to hold
+ * up domain shutdown until SPICE server transfers its data */
+ qemuMigrationWaitForSpice(driver, vm);
+
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_MIGRATED,
VIR_QEMU_PROCESS_STOP_MIGRATED);
virDomainAuditStop(vm, "migrated");
--
1.8.1.5
11 years, 10 months
[libvirt] [PATCH 0/6] Enumerate scsi generic device
by Osier Yang
The scsi generic device is listed as a child of the parent
of the mapped disk device. E.g.
+- pci_0000_00_1f_2
| |
| +- scsi_host0
| | |
| | +- scsi_target0_0_0
| | |
| | +- scsi_0_0_0_0
| | |
| | +- block_sda_TOSHIBA_MK5061GSY_9243PG8CT
| | +- scsi_generic_sg0
This is consistent with the sysfs/udev.
The XML produced by udev backend:
<device>
<name>scsi_generic_sg0</name>
<path>/sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/scsi_generic/sg0</path>
<parent>scsi_0_0_0_0</parent>
<capability type='scsi_generic'>
<char>/dev/sg0</char>
</capability>
</device>
The XML produced by HAL backend:
<device>
<name>pci_8086_2922_scsi_host_scsi_device_lun0_scsi_generic</name>
<path>/sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/scsi_generic/sg0</path>
<parent>pci_8086_2922_scsi_host_scsi_device_lun0</parent>
<capability type='scsi_generic'>
<char>/dev/sg0</char>
</capability>
</device>
Osier Yang (6):
nodedev: Expose sysfs path of device
nodedev_udev: Refactor udevGetDeviceType
nodedev_udev: Enumerate scsi generic device
nodedev_hal: Enumerate scsi generic device
nodedev: Support SCSI_GENERIC cap flag for listAllNodeDevices
virsh: Support SCSI_GENERIC cap flag for nodedev-list
include/libvirt/libvirt.h.in | 1 +
src/conf/node_device_conf.c | 11 ++-
src/conf/node_device_conf.h | 8 ++-
src/node_device/node_device_hal.c | 9 +++
src/node_device/node_device_udev.c | 137 ++++++++++++++++++++-----------------
tools/virsh-nodedev.c | 3 +
tools/virsh.pod | 6 +-
7 files changed, 105 insertions(+), 70 deletions(-)
--
1.8.1.4
11 years, 10 months
[libvirt] a problem about the progress's display of migration with non-shared storage
by Liuji (Jeremy)
Hi all,
I found a problem about the progress's display of migration with non-shared storage.
In the commit: 7b7600b3e6734117b3db39ba5c31ae33a40fb5bb (qemu_migration: Introduce qemuMigrationDriveMirror),
it use drive mirror instead of block migration. And after the driver mirror, then process the VM migration(no block).
But only in the VM migration stage, libvirt set the progress of migration(in qemuMigrationWaitForCompletion).
In the drive mirror stage, libvirt is waiting the completion of drive mirror, and don't set the progress of migration.
So, the libvirt can't display the progress of migration in the drive mirror stage.
For users, they are not concerned about the implementation details of the two stages. They think the two stages are both migration.
So, I think libvirt need consider the progress of drive mirror for migration. But I don't have a good solution.
Any idea about this problem?
Thanks for advance
Regards
11 years, 10 months
[libvirt] [PATCH 0/6] Support to use iscsi storage in domain conf
by Osier Yang
This supports to use libvirt iscsi storage volume for qemu with
either the LUN's path on host (e.g. /dev/disk/by-path/*-lun-1),
or the the libiscsi uri (e.g iscsi://demo.org:6000/$iqn/1)in
domain conf.
Osier Yang (6):
storage_iscsi: Reflect the default target port
conf: Introduce new XML tag "mode" for disk source
qemu: Translate the iscsi pool/volume disk source
security: Ignore to manage the volume type disk if its mode is uri
conf: Ignore the volume type disk if its mode is "uri"
qemu: Translate the volume type disk source before cgroup setting
docs/formatdomain.html.in | 9 ++-
docs/schemas/domaincommon.rng | 8 +++
src/conf/domain_conf.c | 71 +++++++++++++++++++++-
src/conf/domain_conf.h | 25 ++++++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 20 ++++--
src/qemu/qemu_conf.c | 117 +++++++++++++++++++++++++++++-------
src/qemu/qemu_process.c | 13 ++--
src/security/security_apparmor.c | 10 ++-
src/security/security_dac.c | 10 ++-
src/security/security_selinux.c | 10 ++-
src/storage/storage_backend_iscsi.c | 6 +-
tests/qemuxml2xmltest.c | 1 +
13 files changed, 261 insertions(+), 40 deletions(-)
--
1.8.1.4
11 years, 10 months
[libvirt] [PATCH] Move virGetUserEnt() to where its needed
by Doug Goldstein
In the first if case, virGetUserEnt() isn't necessary so don't bother
calling it before determining we need it.
---
Found this trying to get libvirtd running happily on my Mac OS X machine
for qemu. Unfortunately it appears virGetUserEnt() is always failing
on Mac OS X (getpwuid_r() returns 0 each time) because we are requesting
info on a different high value UIDs each time (32xxx). That's another
issue entirely but this fix allows me to ignore that and test other
fixes on my Mac.
---
src/util/virutil.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/util/virutil.c b/src/util/virutil.c
index c5246bc..6fa0212e 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -759,12 +759,13 @@ static char *virGetXDGDirectory(const char *xdgenvname, const char *xdgdefdir)
{
const char *path = getenv(xdgenvname);
char *ret = NULL;
- char *home = virGetUserEnt(geteuid(), VIR_USER_ENT_DIRECTORY);
+ char *home = NULL;
if (path && path[0]) {
if (virAsprintf(&ret, "%s/libvirt", path) < 0)
goto no_memory;
} else {
+ home = virGetUserEnt(geteuid(), VIR_USER_ENT_DIRECTORY);
if (virAsprintf(&ret, "%s/%s/libvirt", home, xdgdefdir) < 0)
goto no_memory;
}
--
1.8.1.5
11 years, 10 months
[libvirt] Unable to setup qemu-guest-agent
by Nehal J. Wani
Could anyone please list out the steps required to run the command
$virsh qemu-agent-command
Steps that I followed:
1. Clone the latest source code of libvirt
2. Create a vm of f18 (source:liveCD)
3. Edit f18 domain xml and add this:
<channel type='unix'>
<source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/>
<target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>
4. On host: #./tools/virsh start f18
5. On guest: #yum install qemu-guest-agent -y
6. On host: # ./tools/virsh qemu-agent-command f18
'{"execute":"guest-network-get-interfaces"}'
Expected Response:
{"return":[{"name":"lo","ip-
addresses":[{"ip-address-type":"ipv4","ip-address":"127.0.0.1","prefix":8},{"ip-address-type":"ipv6","ip-address":"::1","prefix":128}],"hardware-address":"00:00:00:00:00:00"},{"name":"eth0","ip-addresses":[{"ip-address-type":"ipv4","ip-address":"192.168.122.62","prefix":24},{"ip-address-type":"ipv6","ip-address":"fe80::5054:ff:fe14:9998","prefix":64}],"hardware-address":"52:54:00:14:99:98"}]}
Actual result:
error: unknown procedure: 3
Where am I going wrong?
--
Nehal J. Wani
UG2, BTech CS+MS(CL)
IIIT-Hyderabad
http://commanlinewani.blogspot.com
11 years, 10 months
[libvirt] [PATCH 0/2] Support setting the 'removable' flag for USB disks
by Fred A. Kemp
From: "Fred A. Kemp" <anonym(a)lavabit.com>
For reference, my first attempt at a patch for this feature was:
<1363682454-32012-1-git-send-email-anonym(a)lavabit.com>
I believe this patch fixes all previous concerns raised that
thread. However, note that I've only added the new capability for
usb-storage.removable to the qemu help tests of qemu(-kvm) version
1.2.0, since that's what I had easily available to get the output of
`-device usb-storage,?` from.
Fred A. Kemp (2):
qemu: Add capability flag for usb-storage
qemu: Support setting the 'removable' flag for USB disks
docs/formatdomain.html.in | 8 +++--
docs/schemas/domaincommon.rng | 8 +++++
src/conf/domain_conf.c | 31 ++++++++++++++++++--
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 10 +++++++
src/qemu/qemu_capabilities.h | 2 ++
src/qemu/qemu_command.c | 23 +++++++++++++--
tests/qemuhelpdata/qemu-1.2.0-device | 11 +++++++
tests/qemuhelpdata/qemu-kvm-1.2.0-device | 11 +++++++
tests/qemuhelptest.c | 20 +++++++++----
.../qemuxml2argv-disk-usb-device-removable.args | 8 +++++
.../qemuxml2argv-disk-usb-device-removable.xml | 27 +++++++++++++++++
tests/qemuxml2argvtest.c | 6 +++-
13 files changed, 151 insertions(+), 15 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.xml
--
1.7.10.4
11 years, 10 months
[libvirt] [RFC] conf: Order of AddImplicitControllers and DomainDefPostParse
by Viktor Mihajlovski
Implicit controllers may be dependent on device definitions altered
in a post-parse callback. E.g., if a console device is
defined without the target type, the type will be set in QEMU's
callback. In the case of s390, this is virtio, which requires
an implicit virtio-serial controller.
By moving the implicit controller definition after the post-parse
procssing this can be fixed. OTOH the implicit controllers might
need post-parse actions as well, although I am currentyl not
aware of one.
What would speak against swapping the order as suggested in
the patch below? Feedback welcome.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
src/conf/domain_conf.c | 8 ++++----
.../qemuxml2xmlout-balloon-device-auto.xml | 2 +-
.../qemuxml2xmlout-channel-virtio-auto.xml | 2 +-
.../qemuxml2xmlout-console-virtio.xml | 2 +-
.../qemuxml2xmlout-disk-scsi-device-auto.xml | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 29d6edc..ef1f876 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -12062,14 +12062,14 @@ virDomainDefParseXML(xmlDocPtr xml,
(def->ns.parse)(xml, root, ctxt, &def->namespaceData) < 0)
goto error;
- /* Auto-add any implied controllers which aren't present */
- if (virDomainDefAddImplicitControllers(def) < 0)
- goto error;
-
/* callback to fill driver specific domain aspects */
if (virDomainDefPostParse(def, caps, xmlopt) < 0)
goto error;
+ /* Auto-add any implied controllers which aren't present */
+ if (virDomainDefAddImplicitControllers(def) < 0)
+ goto error;
+
virHashFree(bootHash);
return def;
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml
index 6aed326..380b70f 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml
@@ -20,8 +20,8 @@
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'/>
- <controller type='ide' index='0'/>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='ide' index='0'/>
<memballoon model='virtio'/>
</devices>
</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml
index 0175272..fd6b852 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml
@@ -25,8 +25,8 @@
<controller type='virtio-serial' index='1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</controller>
- <controller type='virtio-serial' index='2'/>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='virtio-serial' index='2'/>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml
index 3c865c3..340430e 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml
@@ -21,8 +21,8 @@
</disk>
<controller type='usb' index='0'/>
<controller type='ide' index='0'/>
- <controller type='virtio-serial' index='0'/>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='virtio-serial' index='0'/>
<console type='pty'>
<target type='virtio' port='0'/>
</console>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml
index 7d152bc..5ec1e94 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml
@@ -26,8 +26,8 @@
</disk>
<controller type='usb' index='0'/>
<controller type='ide' index='0'/>
- <controller type='scsi' index='0'/>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='scsi' index='0'/>
<memballoon model='virtio'/>
</devices>
</domain>
--
1.7.9.5
11 years, 10 months
[libvirt] libvirtd 1.0.6 refuses to start
by Franky Van Liedekerke
I just downloaded and compiled libvirtd on the same server as I did
1.0.4. Upon updating, libvirtd refuses to start, with this in the
logfile (obfuscated the hostname by xxx's):
2013-06-11 13:43:49.154+0000: 3336: info : libvirt version: 1.0.6,
package: 1.el6 (Unknown, 2013-06-06-14:57:07, xxxxxxxx)
2013-06-11 13:43:49.154+0000: 3336: error : virFileReadAll:1195 :
Failed to open file '/sys/class/fc_host//host0/max_npiv_vports': No such
file or directory
2013-06-11 13:43:49.159+0000: 3336: error : detect_scsi_host_caps:87 :
Failed to read max_npiv_vports for host1
2013-06-11 13:43:49.163+0000: 3336: error : virFileReadAll:1195 :
Failed to open file '/sys/class/fc_host//host0/max_npiv_vports': No such
file or directory
2013-06-11 13:43:49.163+0000: 3336: error : detect_scsi_host_caps:87 :
Failed to read max_npiv_vports for host2
2013-06-11 13:43:49.386+0000: 3336: error : virLockManagerPluginNew:175
: Failed to load plugin /usr/lib64/libvirt/lock-driver/lockd.so:
/usr/lib64/libvirt/lock-driver/lockd.so: undefined symbol:
virProcessGetStartTime
2013-06-11 13:43:49.386+0000: 3336: error : virStateInitialize:831 :
Initialization of QEMU state driver failed
2013-06-11 13:43:49.386+0000: 3336: error : daemonRunStateInit:887 :
Driver state initialization failed
So it seems two issues are present here:
1) it searches for /sys/class/fc_host//host0/max_npiv_vports for both
host1 and host2. Imho this path needs to be
/sys/class/fc_host//host1/max_npiv_vports and
/sys/class/fc_host//host2/max_npiv_vports respectively.
2) the undefined symbol problem: seems a linking issue, no? The build
worked just fine on rhel6 with all patches applied.
For now I reverted back to 1.0.4. Hope this helps to debug :-)
Also: I created a bug report for 1.0.4/1.0.6 concerning the init
scripts:
https://bugzilla.redhat.com/show_bug.cgi?id=971408
Part of it (the virtlock socket) seems to be in the latest code
already, but I believe the other issues mentioned are valid as well.
With friendly regards,
Franky
11 years, 10 months