[libvirt] [PATCH 3/6] conf: Add

2019-01-13 Thread Cole Robinson
 devices lack the model= attribute which is used by
most other device types. bus= mostly acts as one, but it
serves other purposes too like determing what target=
prefix to use, and for matching against controller type=
values.

Extending bus= to handle additional virtio transitional
devices will complicate apps lives, and it isn't a clean
mapping anyways. So let's bite the bullet and add a new
 attribute, and wire up common handling
for virtio-{non-}transitional

Signed-off-by: Cole Robinson 
---
 docs/formatdomain.html.in |  8 
 docs/schemas/domaincommon.rng |  8 
 src/conf/domain_conf.c| 28 +
 src/conf/domain_conf.h| 10 +
 src/libvirt_private.syms  |  2 +
 ...virtio-non-transitional.x86_64-latest.args | 34 +++
 .../virtio-non-transitional.xml   | 26 
 .../virtio-transitional.x86_64-latest.args| 34 +++
 .../qemuxml2argvdata/virtio-transitional.xml  | 26 
 tests/qemuxml2argvtest.c  |  3 ++
 .../virtio-non-transitional.xml   | 42 +++
 .../virtio-transitional.xml   | 42 +++
 tests/qemuxml2xmltest.c   |  3 ++
 13 files changed, 266 insertions(+)
 create mode 100644 
tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.xml
 create mode 100644 
tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/virtio-transitional.xml
 create mode 100644 tests/qemuxml2xmloutdata/virtio-non-transitional.xml
 create mode 100644 tests/qemuxml2xmloutdata/virtio-transitional.xml

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 7f07bb7f55..5220e19417 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2922,6 +2922,14 @@
 Since 0.1.4
 
 
+  model
+
+Indicates the emulated device model of the disk. Typically
+this is indicated solely by the bus property but
+for bus "virtio" the model can be specified further
+with "virtio-transitional" or "virtio-non-transitional"
+Since 5.1.0
+
   rawio
 
 Indicates whether the disk needs rawio capability. Valid
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index aa50eac424..425d7f851a 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1506,6 +1506,14 @@
   
 
   
+  
+
+  
+virtio-transitional
+virtio-non-transitional
+  
+
+  
   
 
   
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 222bb8c482..f847fb0487 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -889,6 +889,11 @@ VIR_ENUM_IMPL(virDomainDiskDetectZeroes, 
VIR_DOMAIN_DISK_DETECT_ZEROES_LAST,
   "on",
   "unmap")
 
+VIR_ENUM_IMPL(virDomainDiskModel, VIR_DOMAIN_DISK_MODEL_LAST,
+  "default",
+  "virtio-transitional",
+  "virtio-non-transitional")
+
 VIR_ENUM_IMPL(virDomainDiskMirrorState, VIR_DOMAIN_DISK_MIRROR_STATE_LAST,
   "none",
   "yes",
@@ -5431,6 +5436,16 @@ virDomainDiskDefValidate(const virDomainDiskDef *disk)
 return -1;
 }
 
+if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO &&
+(disk->model == VIR_DOMAIN_DISK_MODEL_VIRTIO_TRANSITIONAL ||
+ disk->model == VIR_DOMAIN_DISK_MODEL_VIRTIO_NON_TRANSITIONAL)) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+   _("disk model '%s' only supported for bus '%s'"),
+   virDomainDiskModelTypeToString(disk->model),
+   virDomainDiskBusTypeToString(disk->bus));
+return -1;
+}
+
 return 0;
 }
 
@@ -9518,6 +9533,14 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
 }
 VIR_FREE(tmp);
 
+if ((tmp = virXMLPropString(node, "model")) &&
+(def->model = virDomainDiskModelTypeFromString(tmp)) < 0) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+   _("unknown disk model '%s'"), tmp);
+goto error;
+}
+VIR_FREE(tmp);
+
 snapshot = virXMLPropString(node, "snapshot");
 
 rawio = virXMLPropString(node, "rawio");
@@ -24311,6 +24334,11 @@ virDomainDiskDefFormat(virBufferPtr buf,
 virBufferAsprintf(buf,
   "model) {
+virBufferAsprintf(buf, " model='%s'",
+  virDomainDiskModelTypeToString(def->model));
+}
+
 if (def->rawio) {
 virBufferAsprintf(buf, " rawio='%s'",
   virTristateBoolTypeToString(def->rawio));
diff --git 

[libvirt] [PATCH 4/6] qemu: Wire up disk model=virtio-{non-}transitional

2019-01-13 Thread Cole Robinson
Add new  model values for virtio transitional devices. When
combined with bus='virtio':

* "virtio-transitional" maps to qemu "virtio-blk-pci-transitional"
* "virtio-non-transitional" maps to qemu "virtio-blk-pci-non-transitional"

Signed-off-by: Cole Robinson 
---
 src/qemu/qemu_command.c   | 31 ++-
 src/qemu/qemu_domain_address.c|  2 ++
 ...virtio-non-transitional.x86_64-latest.args |  7 +++--
 .../virtio-transitional.x86_64-latest.args|  4 +--
 .../virtio-non-transitional.xml   | 10 --
 5 files changed, 45 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 822d5f8669..ca6abea227 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -443,6 +443,33 @@ qemuBuildVirtioDevStr(virBufferPtr buf,
 return 0;
 }
 
+static int
+qemuBuildVirtioTransitional(virBufferPtr buf,
+const char *baseName,
+virDomainDeviceAddressType type,
+bool transitional,
+bool nontransitional)
+{
+if (qemuBuildVirtioDevStr(buf, baseName, type) < 0)
+return -1;
+
+if (type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
+(transitional || nontransitional)) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+   _("virtio transitional models are not supported "
+ "for address type=%s"),
+   virDomainDeviceAddressTypeToString(type));
+return -1;
+}
+
+if (transitional) {
+virBufferAddLit(buf, "-transitional");
+} else if (nontransitional) {
+virBufferAddLit(buf, "-non-transitional");
+}
+return 0;
+}
+
 
 static int
 qemuBuildVirtioOptionsStr(virBufferPtr buf,
@@ -2049,7 +2076,9 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
 break;
 
 case VIR_DOMAIN_DISK_BUS_VIRTIO:
-if (qemuBuildVirtioDevStr(, "virtio-blk", disk->info.type) < 0)
+if (qemuBuildVirtioTransitional(, "virtio-blk", disk->info.type,
+disk->model == 
VIR_DOMAIN_DISK_MODEL_VIRTIO_TRANSITIONAL,
+disk->model == 
VIR_DOMAIN_DISK_MODEL_VIRTIO_NON_TRANSITIONAL) < 0)
 goto error;
 
 if (disk->iothread)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index bd6c4031e0..1a77b74ad1 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -723,6 +723,8 @@ 
qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
 case VIR_DOMAIN_DEVICE_DISK:
 switch ((virDomainDiskBus) dev->data.disk->bus) {
 case VIR_DOMAIN_DISK_BUS_VIRTIO:
+if (dev->data.disk->model == 
VIR_DOMAIN_DISK_MODEL_VIRTIO_NON_TRANSITIONAL)
+return pciFlags;
 return virtioFlags; /* only virtio disks use PCI */
 
 case VIR_DOMAIN_DISK_BUS_IDE:
diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args 
b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
index 070b4b8334..a8f878c99c 100644
--- a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
@@ -25,10 +25,11 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
 -boot strict=on \
 -device 
pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
 addr=0x1 \
--device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \
+-device pcie-pci-bridge,id=pci.2,bus=pci.1,addr=0x0 \
+-device pcie-root-port,port=0x9,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x1 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
--device virtio-blk-pci,scsi=off,bus=pci.1,addr=0x0,drive=drive-virtio-disk0,\
-id=virtio-disk0,bootindex=1 \
+-device virtio-blk-pci-non-transitional,scsi=off,bus=pci.2,addr=0x1,\
+drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
 resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args 
b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
index 070b4b8334..7730b177e7 100644
--- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
@@ -27,8 +27,8 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
 addr=0x1 \
 -device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \
--device virtio-blk-pci,scsi=off,bus=pci.1,addr=0x0,drive=drive-virtio-disk0,\
-id=virtio-disk0,bootindex=1 \
+-device virtio-blk-pci-transitional,scsi=off,bus=pci.1,addr=0x0,\
+drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
 -sandbox 

[libvirt] [PATCH 2/6] tests: qemuxml2xml: Add basic DO_TEST_CAPS impl

2019-01-13 Thread Cole Robinson
Signed-off-by: Cole Robinson 
---
 tests/qemuxml2xmltest.c | 57 ++---
 1 file changed, 42 insertions(+), 15 deletions(-)

diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 82e2c0ee0f..b686a585e8 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -117,10 +117,10 @@ testInfoClear(struct testInfo *info)
 
 static int
 testInfoSetCommon(struct testInfo *info,
-  int gic)
+  int gic,
+  virQEMUCapsPtr qemuCaps)
 {
-if (!(info->qemuCaps = virQEMUCapsNew()))
-goto error;
+info->qemuCaps = qemuCaps;
 
 if (testQemuCapsSetGIC(info->qemuCaps, gic) < 0)
 goto error;
@@ -140,9 +140,10 @@ static int
 testInfoSet(struct testInfo *info,
 const char *name,
 int when,
-int gic)
+int gic,
+virQEMUCapsPtr qemuCaps)
 {
-if (testInfoSetCommon(info, gic) < 0)
+if (testInfoSetCommon(info, gic, qemuCaps) < 0)
 return -1;
 
 if (virAsprintf(>inName, "%s/qemuxml2argvdata/%s.xml",
@@ -194,9 +195,10 @@ static const char *statusPath = abs_srcdir 
"/qemustatusxml2xmldata/";
 static int
 testInfoSetStatus(struct testInfo *info,
   const char *name,
-  int gic)
+  int gic,
+  virQEMUCapsPtr qemuCaps)
 {
-if (testInfoSetCommon(info, gic) < 0)
+if (testInfoSetCommon(info, gic, qemuCaps) < 0)
 return -1;
 
 if (virAsprintf(>inName, "%s%s-in.xml", statusPath, name) < 0 ||
@@ -220,6 +222,7 @@ mymain(void)
 char *fakerootdir;
 struct testInfo info;
 virQEMUDriverConfigPtr cfg = NULL;
+virQEMUCapsPtr qemuCaps = NULL;
 
 if (VIR_STRDUP_QUIET(fakerootdir, FAKEROOTDIRTEMPLATE) < 0) {
 fprintf(stderr, "Out of memory\n");
@@ -240,14 +243,8 @@ mymain(void)
 
 cfg = virQEMUDriverGetConfig();
 
-# define DO_TEST_FULL(name, when, gic, ...) \
+# define DO_TEST_RUN(name, info) \
 do { \
-if (testInfoSet(, name, when, gic) < 0) { \
-VIR_TEST_DEBUG("Failed to generate test data for '%s'", name); \
-return -1; \
-} \
-virQEMUCapsSetList(info.qemuCaps, __VA_ARGS__, QEMU_CAPS_LAST); \
- \
 if (info.outInactiveName) { \
 if (virTestRun("QEMU XML-2-XML-inactive " name, \
 testXML2XMLInactive, ) < 0) \
@@ -262,6 +259,34 @@ mymain(void)
 testInfoClear(); \
 } while (0)
 
+# define DO_TEST_FULL(name, when, gic, ...) \
+do { \
+if (!(qemuCaps = virQEMUCapsNew())) \
+return -1; \
+if (testInfoSet(, name, when, gic, qemuCaps) < 0) { \
+VIR_TEST_DEBUG("Failed to generate test data for '%s'", name); \
+return -1; \
+} \
+virQEMUCapsSetList(info.qemuCaps, __VA_ARGS__, QEMU_CAPS_LAST); \
+DO_TEST_RUN(name, info); \
+} while (0)
+
+# define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_"
+
+# define DO_TEST_CAPS(name, arch, ver) \
+do { \
+if (!(qemuCaps = 
qemuTestParseCapabilitiesArch(virArchFromString(arch), \
+   TEST_CAPS_PATH ver "." 
arch ".xml"))) { \
+printf("bad\n"); \
+return -1; \
+} \
+if (testInfoSet(, name, WHEN_BOTH, GIC_NONE, qemuCaps) < 0) { \
+VIR_TEST_DEBUG("Failed to generate test data for '%s'", name); \
+return -1; \
+} \
+DO_TEST_RUN(name, info); \
+} while (0)
+
 # define NONE QEMU_CAPS_LAST
 
 # define DO_TEST(name, ...) \
@@ -1233,7 +1258,9 @@ mymain(void)
 
 # define DO_TEST_STATUS(name) \
 do { \
-if (testInfoSetStatus(, name, GIC_NONE) < 0) { \
+if (!(qemuCaps = virQEMUCapsNew())) \
+return -1; \
+if (testInfoSetStatus(, name, GIC_NONE, qemuCaps) < 0) { \
 VIR_TEST_DEBUG("Failed to generate status test data for '%s'", 
name); \
 return -1; \
 } \
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 5/6] qemu: domcaps: Report disk

2019-01-13 Thread Cole Robinson
This generates new XML like:


  
virtio-transitional
virtio-non-transitional
  


Signed-off-by: Cole Robinson 
---
 src/conf/domain_capabilities.c|   1 +
 src/conf/domain_capabilities.h|   1 +
 src/qemu/qemu_capabilities.c  |  11 ++
 src/qemu/qemu_capabilities.h  |   2 +
 .../bhyve_basic.x86_64.xml|   1 +
 .../bhyve_fbuf.x86_64.xml |   1 +
 .../bhyve_uefi.x86_64.xml |   1 +
 tests/domaincapsschemadata/full.xml   |   5 +
 .../domaincapsschemadata/libxl-xenfv-usb.xml  |   1 +
 .../domaincapsschemadata/libxl-xenpv-usb.xml  |   1 +
 .../qemu_1.7.0.x86_64.xml |   1 +
 .../qemu_2.12.0-virt.aarch64.xml  |   1 +
 .../qemu_2.12.0.ppc64.xml |   1 +
 .../qemu_2.12.0.s390x.xml |   1 +
 .../qemu_2.12.0.x86_64.xml|   1 +
 .../qemu_2.6.0-virt.aarch64.xml   |   1 +
 .../qemu_2.6.0.aarch64.xml|   1 +
 .../domaincapsschemadata/qemu_2.6.0.ppc64.xml |   1 +
 .../qemu_2.6.0.x86_64.xml |   1 +
 .../domaincapsschemadata/qemu_2.7.0.s390x.xml |   1 +
 .../qemu_2.8.0-tcg.x86_64.xml |   1 +
 .../domaincapsschemadata/qemu_2.8.0.s390x.xml |   1 +
 .../qemu_2.8.0.x86_64.xml |   1 +
 .../qemu_2.9.0-q35.x86_64.xml |   1 +
 .../qemu_2.9.0-tcg.x86_64.xml |   1 +
 .../qemu_2.9.0.x86_64.xml |   1 +
 .../domaincapsschemadata/qemu_3.0.0.s390x.xml |   1 +
 .../qemu_4.0.0.x86_64.xml | 153 ++
 tests/domaincapstest.c|   4 +
 .../caps_4.0.0.x86_64.xml |   2 +
 30 files changed, 201 insertions(+)
 create mode 100644 tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index ba2b6ba70f..4ed255d328 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -481,6 +481,7 @@ virDomainCapsDeviceDiskFormat(virBufferPtr buf,
 
 ENUM_PROCESS(disk, diskDevice, virDomainDiskDeviceTypeToString);
 ENUM_PROCESS(disk, bus, virDomainDiskBusTypeToString);
+ENUM_PROCESS(disk, model, virDomainDiskModelTypeToString);
 
 FORMAT_EPILOGUE(disk);
 }
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index 15e065359b..4a9a717539 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -65,6 +65,7 @@ struct _virDomainCapsDeviceDisk {
 bool supported;
 virDomainCapsEnum diskDevice;   /* Info about virDomainDiskDevice enum 
values */
 virDomainCapsEnum bus;  /* Info about virDomainDiskBus enum values 
*/
+virDomainCapsEnum model;   /* Info about virDomainDiskModel enum values */
 /* add new fields here */
 };
 
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index f504db7d05..24031579cd 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -520,6 +520,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
   /* 325 */
   "memory-backend-file.pmem",
   "nvdimm.unarmed",
+  "virtio-blk-pci-transitional",
+  "virtio-blk-pci-non-transitional",
 );
 
 
@@ -1108,6 +1110,8 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
 { "vfio-ap", QEMU_CAPS_DEVICE_VFIO_AP },
 { "zpci", QEMU_CAPS_DEVICE_ZPCI },
 { "memory-backend-memfd", QEMU_CAPS_OBJECT_MEMORY_MEMFD },
+{"virtio-blk-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_BLK_TRANSITIONAL},
+{"virtio-blk-pci-non-transitional", 
QEMU_CAPS_DEVICE_VIRTIO_BLK_NON_TRANSITIONAL},
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = {
@@ -5238,6 +5242,13 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr 
qemuCaps,
 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI))
 VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_SATA);
 
+if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_BLK_TRANSITIONAL))
+VIR_DOMAIN_CAPS_ENUM_SET(disk->model,
+ VIR_DOMAIN_DISK_MODEL_VIRTIO_TRANSITIONAL);
+if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_BLK_NON_TRANSITIONAL))
+VIR_DOMAIN_CAPS_ENUM_SET(disk->model,
+ 
VIR_DOMAIN_DISK_MODEL_VIRTIO_NON_TRANSITIONAL);
+
 return 0;
 }
 
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 6d5ed8a3cc..34265d7cc0 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -504,6 +504,8 @@ typedef enum { /* virQEMUCapsFlags grouping marker for 
syntax-check */
 /* 325 */
 QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM, /* -object memory-backend-file,pmem= */
 QEMU_CAPS_DEVICE_NVDIMM_UNARMED, /* -device nvdimm,unarmed= */
+

[libvirt] [PATCH 1/6] tests: Add capabilities data for QEMU 4.0.0 x86_64

2019-01-13 Thread Cole Robinson
The next release of QEMU is going to be 4.0.0. A bit early, but
this adds capabilities data for x86_64 from current qemu git
15bede554162dda822cd762c689edb6fa32b6e3b

Signed-off-by: Cole Robinson 
---
.replies file snipped so mailing list doesn't reject it

 .../caps_4.0.0.x86_64.replies | 23180 
 .../caps_4.0.0.x86_64.xml |  1384 +
 tests/qemucapabilitiestest.c  | 1 +
 3 files changed, 24565 insertions(+)
 create mode 100644 tests/qemucapabilitiesdata/caps_4.0.0.x86_64.replies
 create mode 100644 tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml

diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml 
b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
new file mode 100644
index 00..c2db392e83
--- /dev/null
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
@@ -0,0 +1,1384 @@
+
+  0
+  0
+  0
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  3001050
+  0
+  446361
+  v3.1.0-759-g15bede5541
+  x86_64
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

[libvirt] [PATCH 6/6] qemu: Support rng model=virtio-{non-}transitional

2019-01-13 Thread Cole Robinson
Add new  model values for virtio transitional devices

* "virtio-transitional" maps to qemu "virtio-rng-pci-transitional"
* "virtio-non-transitional" maps to qemu "virtio-rng-pci-non-transitional"

Signed-off-by: Cole Robinson 
---
 docs/formatdomain.html.in|  2 ++
 docs/schemas/domaincommon.rng|  6 +-
 src/conf/domain_conf.c   |  4 +++-
 src/conf/domain_conf.h   |  2 ++
 src/qemu/qemu_capabilities.c |  6 ++
 src/qemu/qemu_capabilities.h |  4 
 src/qemu/qemu_command.c  | 12 +---
 src/qemu/qemu_domain_address.c   |  6 --
 tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml |  2 ++
 .../virtio-non-transitional.x86_64-latest.args   |  2 ++
 tests/qemuxml2argvdata/virtio-non-transitional.xml   |  3 +++
 .../virtio-transitional.x86_64-latest.args   |  3 +++
 tests/qemuxml2argvdata/virtio-transitional.xml   |  3 +++
 tests/qemuxml2xmloutdata/virtio-non-transitional.xml |  4 
 tests/qemuxml2xmloutdata/virtio-transitional.xml |  9 +
 15 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5220e19417..5765f31048 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -7966,6 +7966,8 @@ qemu-kvm -net nic,model=? /dev/null
 
 
   'virtio' - supported by qemu and virtio-rng kernel module
+  'virtio-transitional' Since 5.1.0
+  'virtio-non-transitional' Since 
5.1.0
 
   
   rate
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 425d7f851a..d247170aeb 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -5442,7 +5442,11 @@
   
 
   
-virtio
+
+  virtio
+  virtio-transitional
+  virtio-non-transitional
+
   
   
 
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index f847fb0487..ec3cb226c1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -851,7 +851,9 @@ VIR_ENUM_IMPL(virDomainDiskTray, VIR_DOMAIN_DISK_TRAY_LAST,
 
 VIR_ENUM_IMPL(virDomainRNGModel,
   VIR_DOMAIN_RNG_MODEL_LAST,
-  "virtio");
+  "virtio",
+  "virtio-transitional",
+  "virtio-non-transitional");
 
 VIR_ENUM_IMPL(virDomainRNGBackend,
   VIR_DOMAIN_RNG_BACKEND_LAST,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 0c1879da0f..0b8b49ec30 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2112,6 +2112,8 @@ struct _virBlkioDevice {
 
 typedef enum {
 VIR_DOMAIN_RNG_MODEL_VIRTIO,
+VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL,
+VIR_DOMAIN_RNG_MODEL_VIRTIO_NON_TRANSITIONAL,
 
 VIR_DOMAIN_RNG_MODEL_LAST
 } virDomainRNGModel;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 24031579cd..84e8bc7863 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -522,6 +522,10 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
   "nvdimm.unarmed",
   "virtio-blk-pci-transitional",
   "virtio-blk-pci-non-transitional",
+  "virtio-rng-pci-transitional",
+
+  /* 330 */
+  "virtio-rng-pci-non-transitional",
 );
 
 
@@ -1112,6 +1116,8 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
 { "memory-backend-memfd", QEMU_CAPS_OBJECT_MEMORY_MEMFD },
 {"virtio-blk-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_BLK_TRANSITIONAL},
 {"virtio-blk-pci-non-transitional", 
QEMU_CAPS_DEVICE_VIRTIO_BLK_NON_TRANSITIONAL},
+{"virtio-rng-pci-transitional", QEMU_CAPS_DEVICE_VIRTIO_RNG_TRANSITIONAL},
+{"virtio-rng-pci-non-transitional", 
QEMU_CAPS_DEVICE_VIRTIO_RNG_NON_TRANSITIONAL},
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 34265d7cc0..86be890beb 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -506,6 +506,10 @@ typedef enum { /* virQEMUCapsFlags grouping marker for 
syntax-check */
 QEMU_CAPS_DEVICE_NVDIMM_UNARMED, /* -device nvdimm,unarmed= */
 QEMU_CAPS_DEVICE_VIRTIO_BLK_TRANSITIONAL, /* -device 
virtio-blk-pci-transitional */
 QEMU_CAPS_DEVICE_VIRTIO_BLK_NON_TRANSITIONAL, /* -device 
virtio-blk-pci-non-transitional */
+QEMU_CAPS_DEVICE_VIRTIO_RNG_TRANSITIONAL, /* -device 
virtio-blk-rng-transitional */
+
+/* 330 */
+QEMU_CAPS_DEVICE_VIRTIO_RNG_NON_TRANSITIONAL, /* -device 
virtio-rng-pci-non-transitional */
 
 QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ca6abea227..3f6f63f33d 100644
--- 

[libvirt] [PATCH 0/6] RFC: qemu: virtio-{non-}transitional support

2019-01-13 Thread Cole Robinson
This series adds the beginnings of support for virtio-transitional
and virtio-non-transitional qemu devices.

qemu patches, queued for qemu 4.0.0:
https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg00923.html
Previous libvirt discussion around this:
https://www.redhat.com/archives/libvir-list/2018-August/msg01073.html

Long story short we need to expose these options so apps have a
usable way to support rhel6 + virtio + q35.

This series only covers exposing the associated device models
for disk and rng devices to make sure I'm on the right track.
serial, net, scsi, input-host, balloon 9p, vsock, vhost-scsi
still need to be implemented. Those should follow the rng
example, except vhost-scsi may need to be a different approach.

The main RFC bits here are:

* The disk approach. danpb and I briefly discussed on IRC adding
  new bus= values vs a new model= attribute. We decided model=
  is the lesser of two evils, since bus= handling in apps is
  tied with target= generation, so adding new virtio-X bus=
  values will cause more work for apps. These patches add
  a  attribute

* The XML and naming. Previous discussions seemed to favor adding
  new model-style values rather than a 'transitional' attribute
  or similar. So these patches add model='virtio-transitional'
  and model='virtio-non-transitional'

* The PCI address handling. I just mapped virtio-non-transitional
  to imply plain PCI addressing. I think that's all we need but
  I'm not positive so I'd appreciate a review of that approach.


Cole Robinson (6):
  tests: Add capabilities data for QEMU 4.0.0 x86_64
  tests: qemuxml2xml: Add basic DO_TEST_CAPS impl
  conf: Add 
  qemu: Wire up disk model=virtio-{non-}transitional
  qemu: domcaps: Report disk 
  qemu: Support rng model=virtio-{non-}transitional

 docs/formatdomain.html.in |10 +
 docs/schemas/domaincommon.rng |14 +-
 src/conf/domain_capabilities.c| 1 +
 src/conf/domain_capabilities.h| 1 +
 src/conf/domain_conf.c|32 +-
 src/conf/domain_conf.h|12 +
 src/libvirt_private.syms  | 2 +
 src/qemu/qemu_capabilities.c  |17 +
 src/qemu/qemu_capabilities.h  | 6 +
 src/qemu/qemu_command.c   |43 +-
 src/qemu/qemu_domain_address.c| 8 +-
 .../bhyve_basic.x86_64.xml| 1 +
 .../bhyve_fbuf.x86_64.xml | 1 +
 .../bhyve_uefi.x86_64.xml | 1 +
 tests/domaincapsschemadata/full.xml   | 5 +
 .../domaincapsschemadata/libxl-xenfv-usb.xml  | 1 +
 .../domaincapsschemadata/libxl-xenpv-usb.xml  | 1 +
 .../qemu_1.7.0.x86_64.xml | 1 +
 .../qemu_2.12.0-virt.aarch64.xml  | 1 +
 .../qemu_2.12.0.ppc64.xml | 1 +
 .../qemu_2.12.0.s390x.xml | 1 +
 .../qemu_2.12.0.x86_64.xml| 1 +
 .../qemu_2.6.0-virt.aarch64.xml   | 1 +
 .../qemu_2.6.0.aarch64.xml| 1 +
 .../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 1 +
 .../qemu_2.6.0.x86_64.xml | 1 +
 .../domaincapsschemadata/qemu_2.7.0.s390x.xml | 1 +
 .../qemu_2.8.0-tcg.x86_64.xml | 1 +
 .../domaincapsschemadata/qemu_2.8.0.s390x.xml | 1 +
 .../qemu_2.8.0.x86_64.xml | 1 +
 .../qemu_2.9.0-q35.x86_64.xml | 1 +
 .../qemu_2.9.0-tcg.x86_64.xml | 1 +
 .../qemu_2.9.0.x86_64.xml | 1 +
 .../domaincapsschemadata/qemu_3.0.0.s390x.xml | 1 +
 .../qemu_4.0.0.x86_64.xml |   153 +
 tests/domaincapstest.c| 4 +
 .../caps_4.0.0.x86_64.replies | 23180 
 .../caps_4.0.0.x86_64.xml |  1388 +
 tests/qemucapabilitiestest.c  | 1 +
 ...virtio-non-transitional.x86_64-latest.args |37 +
 .../virtio-non-transitional.xml   |29 +
 .../virtio-transitional.x86_64-latest.args|37 +
 .../qemuxml2argvdata/virtio-transitional.xml  |29 +
 tests/qemuxml2argvtest.c  | 3 +
 .../virtio-non-transitional.xml   |50 +
 .../virtio-transitional.xml   |51 +
 tests/qemuxml2xmltest.c   |60 +-
 47 files changed, 25172 insertions(+), 23 deletions(-)
 create mode 100644 tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml
 create mode 100644 tests/qemucapabilitiesdata/caps_4.0.0.x86_64.replies
 create mode 100644 tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
 create mode 100644 
tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.xml
 create mode 100644 

[libvirt] Availability of Release Candidate 2 of libvirt-5.0.0

2019-01-13 Thread Daniel Veillard
  As planned I just tagged the release in git and pushed signed tarball and
rpms to the usual place:

   ftp://libvirt.org/libvirt/

  Seems to work for me in limited tests, https://ci.centos.org/view/libvirt/
shows the same status as at freeze time same 3 edge case are red.

  Let's give it some more testing in next couple of days, then if all is
fine I will push the release on Tuesday evening.

  Thanks !

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list