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:
@@ -11028,6 +11154,18 @@ virDomainDefParseXML
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
---
src/qemu/qemu_cgroup.c | 71 ++
src/qemu
and the qdev
properties are(channel should always be 0):
bus=scsi.0
scsi-id=
lun=
Signed-off-by: Han Cheng
---
src/qemu/qemu_command.c | 130 +-
src/qemu/qemu_command.h |6 ++
2 files changed, 133 insertions(+), 3 deletions(-)
diff --git a
This patch adds util functions for scsi hostdev.
Signed-off-by: Han Cheng
---
po/POTFILES.in |1 +
src/Makefile.am |1 +
src/libvirt_private.syms | 22 +++
src/util/virscsi.c | 392 ++
src/util/virscsi.h
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
---
src/qemu/qemu_conf.h|2 +
src/qemu/qemu_driver.c |3 +
src/qemu/qemu_hostdev.c
Add scsi hostdev, it looks like:
The only parameter in -drive affects scsi-generic is readonly. Introduce
to .
Signed-off-by: Han Cheng
---
docs/formatdomain.html.in | 38 +++--
docs/schemas/domaincommon.rng | 29 +++
src/conf
This patch adds tests for scsi hostdev.
Signed-off-by: Han Cheng
---
.../qemuxml2argv-hostdev-scsi-boot.args| 10 ++
.../qemuxml2argv-hostdev-scsi-boot.xml | 34 +++
.../qemuxml2argv-hostdev-scsi-readonly.args| 10
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
---
src/qemu/qemu_hotplug.c |
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
---
src/conf/domain_conf.c |8
src/conf/domain_conf.h |6 +++---
src/libvirt_private.syms |2 +-
src/qemu
Adding two caps to support scsi-generic:
QEMU_CAPS_SCSI_GENERIC
QEMU_CAPS_SCSI_GENERIC_BOOTINDEX
Signed-off-by: Han Cheng
---
src/qemu/qemu_capabilities.c | 14 --
src/qemu/qemu_capabilities.h |2 ++
tests/qemuhelpdata/qemu-1.0-device | 10
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
---
docs/schemas
to help me 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 sc
On 04/05/2013 07:17 PM, Paolo Bonzini wrote:
Il 03/04/2013 05:37, Osier Yang ha scritto:
readonly
Indicates the device is readonly, only valid for SCSI device.
Since 1.0.5.
boot
Specifies that the device is bootable. Theorder
attribute determines the order in which
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 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/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
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 04:32 PM, Osier Yang wrote:
On 03/04/13 16:29, Osier Yang wrote:
On 01/04/13 20:00, Han Cheng wrote:
hostdev
The hostdev element is the main container for
describing
host devices. For usb device passthrough mode is always
- "subsystem" and type is "usb"
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 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 = N
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 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_
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 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
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/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/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.t
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 @@
id attribute that specifies the USB vendor and product id.
The ids can be given in decimal
This patch add tests for scsi hostdev.
Signed-off-by: Han Cheng
---
tests/qemuhelpdata/qemu-1.0-device | 10 ++
tests/qemuhelpdata/qemu-1.1.0-device | 10 ++
tests/qemuhelpdata/qemu-1.2.0-device |5 +++
tests/qemuhelpdata/qemu-kvm
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
---
src/qemu/qemu_hotplug.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 guest.
Signed-off-by: Han Cheng
---
src/qemu/qemu_conf.h|2 +
src/qemu/qemu_driver.c |3 +
src/qemu/qemu_hostdev.c | 227
Adding scsi hostdev, it should like:
Signed-off-by: Han Cheng
---
docs/formatdomain.html.in | 34 ++--
docs/schemas/domaincommon.rng | 24 +
src/conf/domain_audit.c | 10 ++
src/conf/domain_conf.c| 192
This patch add util functions for scsi hostdev.
Signed-off-by: Han Cheng
---
po/POTFILES.in |1 +
src/Makefile.am |1 +
src/libvirt_private.syms | 22 +++
src/util/virscsi.c | 399 ++
src/util/virscsi.h | 83
and the qdev
properties are(channel should always be 0):
bus=scsi.0
scsi-id=
lun=
Signed-off-by: Han Cheng
---
src/qemu/qemu_command.c | 133 +--
src/qemu/qemu_command.h |6 ++
2 files changed, 134 insertions(+), 5 deletions(-)
diff --git a
: Han Cheng
---
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/storagepoolcommon.rng
Adding two caps to support scsi-generic:
QEMU_CAPS_SCSI_GENERIC
QEMU_CAPS_SCSI_GENERIC_BOOTINDEX
Signed-off-by: Han Cheng
---
src/qemu/qemu_capabilities.c | 15 +--
src/qemu/qemu_capabilities.h |2 ++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/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
---
src/qemu/qemu_cgroup.c | 67 +++---
src/qemu
The only parameter in -drive affect scsi-generic is readonly. Introduce
to .
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
---
docs/formatdomain.html.in |3 +++
docs/schemas
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
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
>> +virDomainHostdevSubsysScsi
Acutally, I've changed xml from Paolo's proposal.
I deleted the 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 P
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:
>>
>>
>>
>>
>>
>>
>>
>>
>> @@ -3893,4 +3921,9 @@
dvice).
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
>>to.
>> The helper function to look up disk controller model may
virDomainDeviceInfoPtr src);
void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info);
void virDomainDefClearPCIAddresses(virDomainDefPtr def);
+void virDomainDefClearCCWAddresses(virDomainDefPtr def);
void virDomainDefClearDeviceAliases(virDomainDefPtr def);
typedef int (*virDomainDeviceIn
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 b/src/qem
---
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 +++
tests/qemuhelpdata/qe
Adding scsi hostdev, it should like:
---
docs/schemas/domaincommon.rng | 33 +
src/conf/domain_audit.c | 10 +++
src/conf/domain_conf.c| 149 +++--
src/conf/domain_conf.h|7
s may 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.ht
The only parameter in -drive affect scsi-generic is readonly. Introduce
to .
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| 18 ++-
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
propert
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
52 matches
Mail list logo