Thanks for your best efforts.
I only have one problem. Please find it at the end.
于 2013/4/10 16:59, Osier Yang 写道:
On 09/04/13 10:32, Han Cheng wrote:
Add scsi hostdev, it looks like:
hostdev mode='subsystem' type='scsi'
source
adapter name='scsi_host0
The definiton of scsi adapter in storagespool.rng (sourceinfoadapter)
can be used by scsi hostdev. Move it to basictypes.rng.
PortNumber is defined in both domaincommon.rng and storagespool.rng,
simplify it by moving it to basictypes.rng.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
finish this. Could you?
TODO:
change readonly to bool and change related managed and missing for
consistency.
Han Cheng (10):
conf: Change help function
docs/schemas: Move PortNumber and sourceinfoadapter to basictypes.rng
conf: Introduce scsi hostdev
qemu: New cap flag for scsi-generic
The helper function to look up disk controller model may be used by scsi
hostdev. But it should be changed to use device info.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
src/conf/domain_conf.c |8
src/conf/domain_conf.h |6 +++---
src/libvirt_private.syms |2
This patch adds hotplug for scsi hostdev.
And user should hotplug a virtio-scsi controller if doesn't exist.
Usb hostdev related codes are in qemuDomainAttachHostDevice, push down to
qemuDomainAttachHostUsbDevice.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
src/qemu/qemu_hotplug.c
affects scsi-generic is readonly. Introduce
readonly/ to hostdevsubsysscsi.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
docs/formatdomain.html.in | 38 +++--
docs/schemas/domaincommon.rng | 29 +++
src/conf/domain_audit.c | 10 +++
src/conf/domain_conf.c
Although virtio-scsi support SCSI PR, the device in host may do not
support this. To avoid losing data, we only allow one scsi hostdev be
passthrough to one live guest.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
src/qemu/qemu_conf.h|2 +
src/qemu/qemu_driver.c |3 +
src
This patch adds util functions for scsi hostdev.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
po/POTFILES.in |1 +
src/Makefile.am |1 +
src/libvirt_private.syms | 22 +++
src/util/virscsi.c | 392 ++
src
As libvirt gives guest minimal cgroup, we need to add sg into guest cgroup
whitelist for scsi hostdev. And we should set and restore selinux label
correctly for scsi hostdev.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
src/qemu/qemu_cgroup.c | 71
On 04/05/2013 07:17 PM, Paolo Bonzini wrote:
Il 03/04/2013 05:37, Osier Yang ha scritto:
codereadonly/code
ddIndicates the device is readonly, only valid for SCSI device.
span class=sinceSince 1.0.5/span.
/dd
dtcodeboot/code/dt
ddSpecifies that the device is bootable.
On 04/03/2013 06:20 PM, Osier Yang wrote:
On 01/04/13 20:01, Han Cheng wrote:
And user should hotplug a virtio-scsi controller if doesn't exist.
I'm wondering if it could be implicitly added.
As I know, adding controller implicitly is for back compatibility. New
codes don't need to do
On 04/03/2013 06:26 PM, Osier Yang wrote:
On 01/04/13 20:01, Han Cheng wrote:
diff --git a/tests/qemuhelpdata/qemu-1.0-device
b/tests/qemuhelpdata/qemu-1.0-device
index 0bdfbbd..d557f0e 100644
--- a/tests/qemuhelpdata/qemu-1.0-device
+++ b/tests/qemuhelpdata/qemu-1.0-device
@@ -136,3 +136,13
On 04/02/2013 10:15 AM, Hu Tao wrote:
On Mon, Apr 01, 2013 at 08:00:53PM +0800, Han Cheng wrote:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index edddf25..f8e3973 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -439,6 +439,8 @@ struct _virDomainHostdevDef
On 04/03/2013 01:06 PM, Hu Tao wrote:
On Mon, Apr 01, 2013 at 08:00:57PM +0800, Han Cheng wrote:
+int
+virSCSIDeviceListAdd(virSCSIDeviceListPtr list,
+ virSCSIDevicePtr dev)
+{
+if (virSCSIDeviceListFind(list, dev)) {
+virReportError(VIR_ERR_INTERNAL_ERROR
On 04/03/2013 05:04 PM, Osier Yang wrote:
On 01/04/13 20:00, Han Cheng wrote:
+ if (virAsprintf(tmp, SCSI_DEVFS /%s/vendor, dev-name) 0) {
+ virReportOOMError();
+ goto out;
+ }
+ if (virFileReadAll(tmp, 1024, vendor) 0)
+ goto out;
+ VIR_FREE(tmp);
+ tmp = NULL;
+ if (virAsprintf(tmp
On 04/02/2013 11:19 AM, Hu Tao wrote:
On Mon, Apr 01, 2013 at 08:00:55PM +0800, Han Cheng wrote:
diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index a776058..2fb5989 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -398,6 +398,16 @@ virDomainAuditHostdev
On 04/03/2013 04:32 PM, Osier Yang wrote:
On 03/04/13 16:29, Osier Yang wrote:
On 01/04/13 20:00, Han Cheng wrote:
dtcodehostdev/code/dt
ddThe codehostdev/code element is the main container for
describing
host devices. For usb device passthrough codemode/code is always
- subsystem
On 04/03/2013 05:43 PM, Osier Yang wrote:
On 01/04/13 20:00, Han Cheng wrote:
Although virtio-scsi support SCSI PR, the device in host may do not
support this. To avoid losing data, we only allow one scsi hostdev be
passthrough to one guest.
How about one specify (managed='no|yes
On 04/03/2013 01:06 PM, Hu Tao wrote:
On Mon, Apr 01, 2013 at 08:00:57PM +0800, Han Cheng wrote:
+struct _virSCSIDevice {
+unsigned int adapter;
+unsigned int bus;
+unsigned int target;
+unsigned int unit;
+
+char *name
On 04/03/2013 04:29 PM, Osier Yang wrote:
On 01/04/13 20:00, Han Cheng wrote:
@@ -10773,6 +10911,16 @@ virDomainDefParseXML(virCapsPtr caps,
goto error;
}
+ if (hostdev-source.subsys.type ==
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI
+ hostdev-info-type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE
On 04/01/2013 08:00 PM, Han Cheng wrote:
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index eac72c2..e1af64f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -557,7 +557,7 @@ qemuAssignDeviceDiskAliasCustom(virDomainDefPtr def,
if (disk-info.type
On 04/02/2013 11:02 AM, Han Cheng wrote:
On 04/02/2013 10:15 AM, Hu Tao wrote:
On Mon, Apr 01, 2013 at 08:00:53PM +0800, Han Cheng wrote:
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index f3fca7f..d9d6b9f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
On 04/03/2013 11:41 AM, Osier Yang wrote:
On 01/04/13 20:00, Han Cheng wrote:
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 7101f67..a3d8595 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -174,6 +174,8 @@ enum virQEMUCapsFlags
On 04/03/2013 11:51 AM, Osier Yang wrote:
On 03/04/13 11:48, Han Cheng wrote:
On 04/03/2013 11:41 AM, Osier Yang wrote:
On 01/04/13 20:00, Han Cheng wrote:
diff --git a/src/qemu/qemu_capabilities.h
b/src/qemu/qemu_capabilities.h
index 7101f67..a3d8595 100644
--- a/src/qemu
support for scsi hostdev.
The v1 could be found at:
https://www.redhat.com/archives/libvir-list/2013-March/msg00073.html
We may do some code refactoring to reduce code in pci/usb/sci hostdev later.
Han Cheng (10):
conf: Introduce readonly to hostdev and change helper function
docs/schemas
The only parameter in -drive affect scsi-generic is readonly. Introduce
readonly/ to hostdev.
The helper function to look up disk controller model may be used by scsi
hostdev. But it should be changed to use info.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
docs/formatdomain.html.in
As libvirt gives guest minimal cgroup, we need to add sg into guest cgroup
whitelist for scsi hostdev. And we should set and restore selinux label
correctly for scsi hostdev.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
src/qemu/qemu_cgroup.c | 67
Adding two caps to support scsi-generic:
QEMU_CAPS_SCSI_GENERIC
QEMU_CAPS_SCSI_GENERIC_BOOTINDEX
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
src/qemu/qemu_capabilities.c | 15 +--
src/qemu/qemu_capabilities.h |2 ++
2 files changed, 15 insertions(+), 2 deletions
-by: Han Cheng hanc.f...@cn.fujitsu.com
---
docs/schemas/domaincommon.rng |6 +-
docs/schemas/storagepool.rng | 18 ++
docs/schemas/storagepoolcommon.rng | 21 +
3 files changed, 24 insertions(+), 21 deletions(-)
create mode 100644 docs/schemas
and the qdev
properties are(channel should always be 0):
bus=scsicontroller.0
scsi-id=target
lun=unit
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
src/qemu/qemu_command.c | 133 +--
src/qemu/qemu_command.h |6 ++
2 files changed, 134
This patch add util functions for scsi hostdev.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
po/POTFILES.in |1 +
src/Makefile.am |1 +
src/libvirt_private.syms | 22 +++
src/util/virscsi.c | 399 ++
src
Adding scsi hostdev, it should like:
hostdev mode='subsystem' type='scsi'
source
adapter name='scsi_host0'/
address bus='0' target='0' unit='0'/
/source
address type='drive' controller='0' bus='0' target='4' unit='8'/
/hostdev
Signed-off-by: Han Cheng
Although virtio-scsi support SCSI PR, the device in host may do not
support this. To avoid losing data, we only allow one scsi hostdev be
passthrough to one guest.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
src/qemu/qemu_conf.h|2 +
src/qemu/qemu_driver.c |3 +
src/qemu
This patch add hotplug for scsi hostdev.
And user should hotplug a virtio-scsi controller if doesn't exist.
Usb hostdev related codes are in qemuDomainAttachHostDevice, push down to
qemuDomainAttachHostUsbDevice.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
src/qemu/qemu_hotplug.c
This patch add tests for scsi hostdev.
Signed-off-by: Han Cheng hanc.f...@cn.fujitsu.com
---
tests/qemuhelpdata/qemu-1.0-device | 10 ++
tests/qemuhelpdata/qemu-1.1.0-device | 10 ++
tests/qemuhelpdata/qemu-1.2.0-device |5 +++
tests
On 04/02/2013 10:15 AM, Hu Tao wrote:
On Mon, Apr 01, 2013 at 08:00:53PM +0800, Han Cheng wrote:
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2257,6 +2257,9 @@
codeid/code attribute that specifies the USB vendor and product id.
The ids can be given
On 03/06/2013 02:24 PM, Osier Yang wrote:
On 2013年03月04日 14:01, Han Cheng wrote:
@@ -2928,6 +2929,96 @@ virDomainParseLegacyDeviceAddress(char *devaddr,
}
static int
+virDomainHostdevSubsysScsiDefParseXML(const xmlNodePtr node
;
virDomainDefClearDeviceAliases;
virDomainDefClearPCIAddresses;
virDomainDefCompatibleDevice;
--
--
Han Cheng
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
No. 6 Wenzhu Road, Nanjing, 210012, China
TEL: +86+25-86630566-8540
FUJITSU INTERNAL: 79955-8540
FAX: +86+25
by your advice).
Other problems will be fixed by next version.
On 03/06/2013 01:40 PM, Osier Yang wrote:
On 2013年03月04日 14:01, Han Cheng wrote:
The only parameter in -drive affect scsi-generic is readonly. Introduce
readonly/ tohostdev.
The helper function to look up disk controller model may
On 03/06/2013 02:24 PM, Osier Yang wrote:
On 2013年03月04日 14:01, Han Cheng wrote:
Adding scsi hostdev, it should like:
hostdev mode='subsystem' type='scsi'
source
adapter name='scsi_host0'/
address bus='0' target='0' unit='0'/
/source
Acutally, I've changed xml from Paolo's proposal.
I deleted the target as it is not easy to parse for
virDomainDeviceInfoParseXML and there is nothing else. And I changed
address type from scsi to drive as they are the same.
On 03/06/2013 09:09 PM, Han Cheng wrote:
On 03/06/2013 02:24 PM, Osier
Sorry, just a test.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Sorry, just a test.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
The only parameter in -drive affect scsi-generic is readonly. Introduce
readonly/ to hostdev.
The helper function to look up disk controller model may be used by scsi
hostdev. But it should be changed to use info.
---
docs/schemas/domaincommon.rng |5 +
src/conf/domain_conf.c|
For scsi-generic, the command line will be like:
-drive file=/dev/sg0,if=none,id=drive-hostdev-scsi0-0-0-0 -device
scsi-generic,bus=scsi0.0,channel=0,scsi-id=4,lun=8,drive=drive-hostdev-scsi0-0-0-0,id=hostdev-scsi0-0-0-0
The relationship between the libvirt address attrs and the qdev
create
some redundant codes.
Any ideas?
Han Cheng (5):
conf: Introduce readonly to hostdev and change helper function
conf: Introduce scsi hostdev
qemu: New cap flag for scsi-generic
qemu: Build qemu command line for scsi-generic
tests: tests for scsi hostdev
docs/formatdomain.html.in
Adding scsi hostdev, it should like:
hostdev mode='subsystem' type='scsi'
source
adapter name='scsi_host0'/
address bus='0' target='0' unit='0'/
/source
address type='drive' controller='0' bus='0' target='4' unit='8'/
/hostdev
---
---
docs/formatdomain.html.in | 36
tests/qemuhelpdata/qemu-1.0-device | 10 +
tests/qemuhelpdata/qemu-1.1.0-device | 10 +
tests/qemuhelpdata/qemu-1.2.0-device |5 +++
Adding two caps to support scsi-generic:
QEMU_CAPS_SCSI_GENERIC
QEMU_CAPS_SCSI_HOST_BOOTINDEX
---
src/qemu/qemu_capabilities.c | 15 +--
src/qemu/qemu_capabilities.h |2 ++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c
49 matches
Mail list logo