[libvirt] [PATCH] snapshot: avoid virsh crash with older servers
by Eric Blake
Commits 51082301, 16d7b39, and 521cc447 introduced support for
'virsh snapshot-list --from' when talking to a server older than
0.9.5, but broke support for plain 'virsh snapshot-list' for the
same old server in the process. Because the code is not properly
gated, we end up with a SIGSEGV during a strcmp with a NULL argument.
* tools/virsh.c (cmdSnapshotList): Don't waste time on fallbacks
when --from is not present.
---
Caveat: I tested by manually setting ctl->useSnapshotOld=true in
virsh.c, rather than actually loading an older libvirtd, but I'm
confident that the results would be the same.
tools/virsh.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index abcfbff..0453b95 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -16740,10 +16740,10 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
qsort(&names[0], actual, sizeof(char*), namesorter);
- if (tree || ctl->useSnapshotOld) {
+ if (tree || (from && ctl->useSnapshotOld)) {
parents = vshCalloc(ctl, sizeof(char *), actual);
for (i = (from && !ctl->useSnapshotOld); i < actual; i++) {
- if (ctl->useSnapshotOld && STREQ(names[i], from)) {
+ if (from && ctl->useSnapshotOld && STREQ(names[i], from)) {
start_index = i;
continue;
}
@@ -16765,7 +16765,8 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
char indentBuf[INDENT_BUFLEN];
for (i = 0 ; i < actual ; i++) {
memset(indentBuf, '\0', sizeof(indentBuf));
- if (ctl->useSnapshotOld ? STREQ(names[i], from) : !parents[i])
+ if ((from && ctl->useSnapshotOld) ? STREQ(names[i], from) :
+ !parents[i])
cmdNodeListDevicesPrint(ctl,
names,
parents,
@@ -16834,7 +16835,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
}
for (i = 0; i < actual; i++) {
- if (ctl->useSnapshotOld &&
+ if (from && ctl->useSnapshotOld &&
(descendants ? !names[i] : STRNEQ_NULLABLE(parents[i], from)))
continue;
--
1.7.10.2
12 years, 6 months
[libvirt] [PATCH] Only migrate profile in non-privileged libvirtd instance
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Only the non-privileged libvirtd instance uses $HOME. So avoid
running the code for migrating to XDG directories unless using
a non-privileged libvirtd
---
daemon/libvirtd.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index d5ad05e..de6c96e 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -783,6 +783,8 @@ static int migrateProfile(void)
int ret = -1;
mode_t old_umask;
+ VIR_DEBUG("Checking if user profile needs migrating");
+
if (!(home = virGetUserDirectory()))
goto cleanup;
@@ -795,6 +797,9 @@ static int migrateProfile(void)
goto cleanup;
if (!virFileIsDir(old_base) || virFileExists(config_dir)) {
+ VIR_DEBUG("No old profile in '%s' / "
+ "new profile directory already present '%s'",
+ old_base, config_dir);
ret = 0;
goto cleanup;
}
@@ -830,6 +835,7 @@ static int migrateProfile(void)
goto cleanup;
}
+ VIR_DEBUG("Profile migrated from %s to %s", old_base, config_dir);
ret = 0;
cleanup:
@@ -1063,7 +1069,8 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
- if (migrateProfile() < 0)
+ if (!privileged &&
+ migrateProfile() < 0)
exit(EXIT_FAILURE);
if (config->host_uuid &&
--
1.7.10.2
12 years, 6 months
[libvirt] [PATCH] Fix privileges on /var/run/libvirt directory
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Previous commit
commit 32a9aac2e04c991340b66c855a1095e4e6445e54
Author: William Jon McCann <william.jon.mccann(a)gmail.com>
Date: Thu May 3 12:36:27 2012 -0400
Use XDG Base Directories instead of storing in home directory
Accidentally changed the umask when creating /var/run/libvirt
to 077. This prevents /var/run/libvirt being readable by non-root,
which is required for non-root to connect to libvirtd. Fix the
code so that umask 077 is only used for the non-privileged libvirtd
instance.
---
daemon/libvirtd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index de6c96e..c1ee3f4 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -1131,7 +1131,10 @@ int main(int argc, char **argv) {
goto cleanup;
}
- old_umask = umask(077);
+ if (privileged)
+ old_umask = umask(022);
+ else
+ old_umask = umask(077);
if (virFileMakePath(run_dir) < 0) {
char ebuf[1024];
VIR_ERROR(_("unable to create rundir %s: %s"), run_dir,
--
1.7.10.2
12 years, 6 months
[libvirt] [patch]make rundir permission equals to socket permission to support unprivileged access
by Royce Lv
Libvirt-socket-rw and libvirt-socket-ro are not used only for libvirt or
root user,
but also for unprivileged application such as vdsm,
Restrain the rundir only read/search for libvirt prevent comunication
with unprivileged client,change rundir the permission equals to the sockets
permission.
See bug:
https://bugzilla.redhat.com/show_bug.cgi?id=828073
Signed-off-by: lvroyce <lvroyce(a)linux.vnet.ibm.com>
---
daemon/libvirtd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index c74cd43..6095072 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -293,7 +293,7 @@ daemonUnixSocketPaths(struct daemonConfig *config,
if (!(rundir = virGetUserRuntimeDirectory()))
goto error;
- old_umask = umask(077);
+ old_umask = umask(022);
if (virFileMakePath(rundir) < 0) {
umask(old_umask);
goto error;
12 years, 6 months
[libvirt] Multiple KVM virtio console is not working.
by Pankaj Rawat
Let me explain our scenario:
We need to provide multiple console options so that from Host, user can login into the KVM guest using different console.
Environment - Fedora 17 (Host), Fedora 17 (Guest)
Libvirt version installed - 0.9.11
On Host, we have edit the guest XMl file and added for the multiple virtio console entry:
<console type='pty'>
<target type='virtio'/>
</console>
<console type='pty'>
<target type='virtio'/>
</console>
We are able to connect to guest via serial console device. works fine.
#virsh console guest
We are unable to connect to guest via virtio console. Not working.
#virsh console --devname console1 guest
We login using the serial console into guest and check the lsmod command, So the virtio console driver module is not loaded.
Also the getty process is not running for different virtio console devices.
So i manually load the virtio console (virtio_console.ko) module -> Even then i am unable to login using the virtio console.
In the guest, /dev/hvc[0-7] is present.
Pls tell us whether we are missing any configuration or settings on Host/Guest side.
Regards
Pankaj Rawat
DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NECHCL or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the
opinions of NECHCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
-----------------------------------------------------------------------------------------------------------------------
12 years, 6 months
[libvirt] [PATCH] LXC: fix memory leak in lxcContainerMountFSBlockAuto
by Gao feng
we forgot to free fslist,just add VIR_FREE(fslist).
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index cd15ca4..297bd6d 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -969,6 +969,7 @@ retry:
cleanup:
VIR_FREE(line);
+ VIR_FREE(fslist);
VIR_FORCE_FCLOSE(fp);
return ret;
}
--
1.7.7.6
12 years, 6 months
[libvirt] [PATCH] LXC: fix incorrect parameter of mount in lxcContainerMountFSBind
by Gao feng
when do remount,the source and target should be the same
values specified in the initial mount() call.
So change fs->dst to src.
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 506eb43..cd15ca4 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -744,7 +744,7 @@ static int lxcContainerMountFSBind(virDomainFSDefPtr fs,
if (fs->readonly) {
VIR_DEBUG("Binding %s readonly", fs->dst);
- if (mount(fs->dst, fs->dst, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) {
+ if (mount(src, fs->dst, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) {
virReportSystemError(errno,
_("Failed to make directory %s readonly"),
fs->dst);
--
1.7.7.6
12 years, 6 months
[libvirt] [PATCH] LXC: delete unused variable src in lxcContainerMountBasicFS
by Gao feng
there is no code use the variable "src" in lxcContainerMountBasicFS.
so delete it and VIR_FREE.
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index fb59694..506eb43 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -456,7 +456,6 @@ static int lxcContainerMountBasicFS(virDomainDefPtr def,
VIR_DEBUG("Mounting basic filesystems pivotRoot=%d", pivotRoot);
for (i = 0 ; i < ARRAY_CARDINALITY(mnts) ; i++) {
- char *src = NULL;
const char *srcpath = NULL;
VIR_DEBUG("Processing %s -> %s",
@@ -473,21 +472,17 @@ static int lxcContainerMountBasicFS(virDomainDefPtr def,
/* Skip if mount doesn't exist in source */
if ((srcpath[0] == '/') &&
- (access(srcpath, R_OK) < 0)) {
- VIR_FREE(src);
+ (access(srcpath, R_OK) < 0))
continue;
- }
VIR_DEBUG("Mount %s on %s type=%s flags=%x, opts=%s",
srcpath, mnts[i].dst, mnts[i].type, mnts[i].mflags, mnts[i].opts);
if (mount(srcpath, mnts[i].dst, mnts[i].type, mnts[i].mflags, mnts[i].opts) < 0) {
- VIR_FREE(src);
virReportSystemError(errno,
_("Failed to mount %s on %s type %s"),
mnts[i].src, mnts[i].dst, NULLSTR(mnts[i].type));
goto cleanup;
}
- VIR_FREE(src);
}
if (pivotRoot) {
--
1.7.7.6
12 years, 6 months
[libvirt] [PATCH] msg_buf_size is unsigned long not size_t
by Guido Günther
This fixes the build on 32bit systems which otherwise fails with:
virnetmessagetest.c: In function 'testMessageHeaderEncode':
virnetmessagetest.c:75:9: error: format '%zu' expects argument of type 'size_t', but argument 7 has type 'long unsigned int' [-Werror=format]
---
Probably o.k. to push under the build breaker rule but I'd rather check.
Cheers,
-- Guido
tests/virnetmessagetest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c
index 6c294ca..0408b5b 100644
--- a/tests/virnetmessagetest.c
+++ b/tests/virnetmessagetest.c
@@ -72,7 +72,7 @@ static int testMessageHeaderEncode(const void *args ATTRIBUTE_UNUSED)
}
if (msg->bufferLength != msg_buf_size) {
- VIR_DEBUG("Expect message offset %zu got %zu",
+ VIR_DEBUG("Expect message offset %lu got %zu",
msg_buf_size, msg->bufferLength);
goto cleanup;
}
--
1.7.10
12 years, 6 months
[libvirt] [PATCH 1/2] Add VSCSI bus type and VSCSI controller type for pseries guest.
by Li Zhang
Now, there is only SCSI bus and controller type in libvirt.
And when configuring VSCSI controller, it needs to configure
the spapr-vio bus address type externally. It's a little
inconvenient to configure the controller type.
This patch is to add VSCSI bus type and VSCSI controller type.
And handle with the problems when VSCSI and SCSI devices
working together, by assign the even number to index of
VSCSI controller and odd number to index of SCSI controller.
And when the VSCSI controller is always assigned as SPAPRVIO
bus address type and SCSI controller will be always assigned
as PCI bus address, which is implemented according to the
controllers' type.
So when one disk is based on VSCSI controller, then assign
the bus as 'vscsi', and one right VSCSI controller will be
selected.
If one disk is based on VSCSI controller, the XML file is
as the following:
<disk type='file' device='disk' >
<driver name='qemu' type='raw'/>
<source file='/path/file'/>
<target dev='sda' bus='vscsi'/>
</disk>
VSCSI controllers' configuration in XML file will be like
this:
<controller type='vscsi' index='0'>
</controller>
If one disk is based on 'vscsi', the 'vscsi' bus should be assigned
externally. Otherwise, it will be set as 'scsi' bus according
to the 'sd' target prefix of the disk.
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
---
src/conf/domain_conf.c | 62 ++++++++++++++++++++++++++++++++++++++++++-----
src/conf/domain_conf.h | 2 ++
src/qemu/qemu_command.c | 11 +++++++--
3 files changed, 67 insertions(+), 8 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 184ff23..99005b7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -177,7 +177,8 @@ VIR_ENUM_IMPL(virDomainDiskBus, VIR_DOMAIN_DISK_BUS_LAST,
"xen",
"usb",
"uml",
- "sata")
+ "sata",
+ "vscsi")
VIR_ENUM_IMPL(virDomainDiskCache, VIR_DOMAIN_DISK_CACHE_LAST,
"default",
@@ -236,7 +237,8 @@ VIR_ENUM_IMPL(virDomainController, VIR_DOMAIN_CONTROLLER_TYPE_LAST,
"sata",
"virtio-serial",
"ccid",
- "usb")
+ "usb",
+ "vscsi")
VIR_ENUM_IMPL(virDomainControllerModelSCSI, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST,
"auto",
@@ -2973,6 +2975,7 @@ virDomainDiskDefAssignAddress(virCapsPtr caps, virDomainDiskDefPtr def)
switch (def->bus) {
case VIR_DOMAIN_DISK_BUS_SCSI:
+ case VIR_DOMAIN_DISK_BUS_VSCSI:
def->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE;
if (caps->hasWideScsiBus) {
@@ -2981,6 +2984,16 @@ virDomainDiskDefAssignAddress(virCapsPtr caps, virDomainDiskDefPtr def)
* Unit 7 is the SCSI controller itself. Therefore unit 7
* cannot be assigned to disks and is skipped.
*/
+
+ /* assign even number to index of vscsi controller,
+ * and odd number to index of scsi controller, which can
+ * make vscsi controller and scsi controller work together.
+ */
+ if (def->bus == VIR_DOMAIN_DISK_BUS_VSCSI)
+ def->info.addr.drive.controller = (idx / 15) * 2;
+ else
+ def->info.addr.drive.controller = (idx / 15) * 2 + 1;
+
def->info.addr.drive.controller = idx / 15;
def->info.addr.drive.bus = 0;
def->info.addr.drive.unit = idx % 15;
@@ -2992,6 +3005,17 @@ virDomainDiskDefAssignAddress(virCapsPtr caps, virDomainDiskDefPtr def)
} else {
/* For a narrow SCSI bus we define the default mapping to be
* 7 units per bus, 1 bus per controller, many controllers */
+
+ /* assign even number to index of vscsi controller,
+ * and odd number to index of scsi controller, which can
+ * make vscsi controller and scsi controller work together.
+ */
+
+ if (def->bus == VIR_DOMAIN_DISK_BUS_VSCSI)
+ def->info.addr.drive.controller = (idx / 7) * 2;
+ else
+ def->info.addr.drive.controller = (idx / 7 ) * 2 + 1;
+
def->info.addr.drive.controller = idx / 7;
def->info.addr.drive.bus = 0;
def->info.addr.drive.unit = idx % 7;
@@ -4061,6 +4085,10 @@ virDomainControllerDefParseXML(xmlNodePtr node,
break;
}
+ case VIR_DOMAIN_CONTROLLER_TYPE_VSCSI:
+ def->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO;
+ break;
+
default:
break;
}
@@ -7606,6 +7634,9 @@ static int virDomainDefMaybeAddController(virDomainDefPtr def,
cont->idx = idx;
cont->model = -1;
+ if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_VSCSI)
+ cont->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO;
+
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL) {
cont->opts.vioserial.ports = -1;
cont->opts.vioserial.vectors = -1;
@@ -10133,9 +10164,19 @@ static int virDomainDefAddDiskControllersForType(virDomainDefPtr def,
maxController = def->disks[i]->info.addr.drive.controller;
}
- for (i = 0 ; i <= maxController ; i++) {
- if (virDomainDefMaybeAddController(def, controllerType, i) < 0)
- return -1;
+ /* To make scsi and vscsi can work together correctly,
+ * assign even number to index of vscsi controller
+ * and odd number of scsi controller.*/
+ if (diskBus == VIR_DOMAIN_DISK_BUS_VSCSI) {
+ for (i = 0 ; i * 2 <= maxController ; i ++ ) {
+ if (virDomainDefMaybeAddController(def, controllerType, 2 * i) < 0)
+ return -1;
+ }
+ } else {
+ for (i = 0 ; i * 2 + 1 <= maxController ; i ++ ) {
+ if (virDomainDefMaybeAddController(def, controllerType, 2 * i + 1) < 0)
+ return -1;
+ }
}
return 0;
@@ -10247,6 +10288,11 @@ int virDomainDefAddImplicitControllers(virDomainDefPtr def)
VIR_DOMAIN_DISK_BUS_SATA) < 0)
return -1;
+ if (virDomainDefAddDiskControllersForType(def,
+ VIR_DOMAIN_CONTROLLER_TYPE_VSCSI,
+ VIR_DOMAIN_DISK_BUS_VSCSI) < 0)
+ return -1;
+
if (virDomainDefMaybeAddVirtioSerialController(def) < 0)
return -1;
@@ -13175,7 +13221,11 @@ int virDiskNameToBusDeviceIndex(const virDomainDiskDefPtr disk,
*devIdx = idx % 2;
break;
case VIR_DOMAIN_DISK_BUS_SCSI:
- *busIdx = idx / 7;
+ *busIdx = (idx / 7) * 2 + 1;
+ *devIdx = idx % 7;
+ break;
+ case VIR_DOMAIN_DISK_BUS_VSCSI:
+ *busIdx = (idx / 7) * 2;
*devIdx = idx % 7;
break;
case VIR_DOMAIN_DISK_BUS_FDC:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 5aa8fc1..0066eba 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -418,6 +418,7 @@ enum virDomainDiskBus {
VIR_DOMAIN_DISK_BUS_USB,
VIR_DOMAIN_DISK_BUS_UML,
VIR_DOMAIN_DISK_BUS_SATA,
+ VIR_DOMAIN_DISK_BUS_VSCSI,
VIR_DOMAIN_DISK_BUS_LAST
};
@@ -597,6 +598,7 @@ enum virDomainControllerType {
VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL,
VIR_DOMAIN_CONTROLLER_TYPE_CCID,
VIR_DOMAIN_CONTROLLER_TYPE_USB,
+ VIR_DOMAIN_CONTROLLER_TYPE_VSCSI,
VIR_DOMAIN_CONTROLLER_TYPE_LAST
};
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 070d13e..bb3be17 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -57,7 +57,8 @@ VIR_ENUM_IMPL(virDomainDiskQEMUBus, VIR_DOMAIN_DISK_BUS_LAST,
"xen",
"usb",
"uml",
- "sata")
+ "sata",
+ "vscsi")
VIR_ENUM_DECL(qemuDiskCacheV1)
@@ -429,6 +430,7 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk)
ret = virAsprintf(&dev_name, "ide%d-cd%d", busid, devid);
break;
case VIR_DOMAIN_DISK_BUS_SCSI:
+ case VIR_DOMAIN_DISK_BUS_VSCSI:
if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK)
ret = virAsprintf(&dev_name, "scsi%d-hd%d", busid, devid);
else
@@ -1836,6 +1838,7 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED,
switch (disk->bus) {
case VIR_DOMAIN_DISK_BUS_SCSI:
+ case VIR_DOMAIN_DISK_BUS_VSCSI:
if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unexpected address type for scsi disk"));
@@ -2223,6 +2226,7 @@ qemuBuildDriveDevStr(virDomainDefPtr def,
disk->info.addr.drive.unit);
break;
case VIR_DOMAIN_DISK_BUS_SCSI:
+ case VIR_DOMAIN_DISK_BUS_VSCSI:
if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
if (!qemuCapsGet(qemuCaps, QEMU_CAPS_SCSI_BLOCK)) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -6447,6 +6451,8 @@ qemuParseCommandLineDisk(virCapsPtr caps,
def->bus = VIR_DOMAIN_DISK_BUS_IDE;
else if (STREQ(values[i], "scsi"))
def->bus = VIR_DOMAIN_DISK_BUS_SCSI;
+ else if (STREQ(values[i], "vscsi"))
+ def->bus = VIR_DOMAIN_DISK_BUS_VSCSI;
else if (STREQ(values[i], "virtio"))
def->bus = VIR_DOMAIN_DISK_BUS_VIRTIO;
else if (STREQ(values[i], "xen"))
@@ -6577,7 +6583,8 @@ qemuParseCommandLineDisk(virCapsPtr caps,
if (def->bus == VIR_DOMAIN_DISK_BUS_IDE) {
def->dst = strdup("hda");
- } else if (def->bus == VIR_DOMAIN_DISK_BUS_SCSI) {
+ } else if (def->bus == VIR_DOMAIN_DISK_BUS_SCSI ||
+ def->bus == VIR_DOMAIN_DISK_BUS_VSCSI) {
def->dst = strdup("sda");
} else if (def->bus == VIR_DOMAIN_DISK_BUS_VIRTIO) {
def->dst = strdup("vda");
--
1.7.9.5
12 years, 6 months