[libvirt] [PATCH] util: Fix segmentation fault when seclabel fails to allocate memory

2019-11-01 Thread jcfaracco
From: Julio Faracco 

In function virSecurityDeviceLabelDefNew(), when libvirt fails to
allocate seclabel structure it returns a failure. This case is setting
seclabel as a NULL pointer and accessing its attribute below. This
commit fixes this wrong logic.

Signed-off-by: Julio Faracco 
---
 src/util/virseclabel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virseclabel.c b/src/util/virseclabel.c
index a2b5ebf6b7..2141d84210 100644
--- a/src/util/virseclabel.c
+++ b/src/util/virseclabel.c
@@ -77,7 +77,7 @@ virSecurityDeviceLabelDefNew(const char *model)
 
 if (VIR_ALLOC(seclabel) < 0) {
 virSecurityDeviceLabelDefFree(seclabel);
-seclabel = NULL;
+return NULL;
 }
 
 seclabel->model = g_strdup(model);
-- 
2.20.1

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



Re: [libvirt] [PATCH 6/9] conf: qemu: add virtio-fs fsdriver type

2019-11-01 Thread Jim Fehlig
On 11/1/19 6:16 AM, Ján Tomko wrote:
> Introduce a new 'virtio-fs' driver type for filesystem.
> 
> 
>

After resolving my confusion* regarding the example and description of the 
filesystem/driver element, I think this change is logical and shouldn't require 
much bikeshedding :-). Although you are missing docs for the new type.

Regards,
Jim

* The last filesystem example has , which 
doesn't match the schema or description. I'll send a doc cleanup patch for that.

>
>
>
> 
> 
> Signed-off-by: Ján Tomko 
> ---
>   docs/schemas/domaincommon.rng  | 1 +
>   src/conf/domain_conf.c | 1 +
>   src/conf/domain_conf.h | 1 +
>   src/qemu/qemu_command.c| 3 +++
>   src/qemu/qemu_domain.c | 4 
>   src/qemu/qemu_domain_address.c | 3 +++
>   tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml | 6 ++
>   7 files changed, 19 insertions(+)
> 
> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
> index e06f892da3..f6479c95a7 100644
> --- a/docs/schemas/domaincommon.rng
> +++ b/docs/schemas/domaincommon.rng
> @@ -2567,6 +2567,7 @@
>   loop
>   nbd
>   ploop
> +virtio-fs
> 
>   
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index d5aba7336f..2694e4bb68 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -476,6 +476,7 @@ VIR_ENUM_IMPL(virDomainFSDriver,
> "loop",
> "nbd",
> "ploop",
> +  "virtio-fs",
>   );
>   
>   VIR_ENUM_IMPL(virDomainFSAccessMode,
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index c69d1b7ef5..54a7e7c52f 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -770,6 +770,7 @@ typedef enum {
>   VIR_DOMAIN_FS_DRIVER_TYPE_LOOP,
>   VIR_DOMAIN_FS_DRIVER_TYPE_NBD,
>   VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP,
> +VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIO_FS,
>   
>   VIR_DOMAIN_FS_DRIVER_TYPE_LAST
>   } virDomainFSDriverType;
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index cbe601099f..985fcdd215 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -2697,6 +2697,9 @@ qemuBuildFilesystemCommandLine(virCommandPtr cmd,
>   if (qemuBuildFSDevCommandLine(cmd, def->fss[i], def, qemuCaps) 
> < 0)
>   return -1;
>   break;
> +case VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIO_FS:
> +/* TODO: vhost-user-fs-pci */
> +return 0;
>   case VIR_DOMAIN_FS_DRIVER_TYPE_LOOP:
>   case VIR_DOMAIN_FS_DRIVER_TYPE_NBD:
>   case VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP:
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 667cc89072..334039005c 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -7110,6 +7110,10 @@ qemuDomainDeviceDefValidateFS(virDomainFSDefPtr fs,
>  _("Filesystem driver type not supported"));
>   return -1;
>   
> +case VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIO_FS:
> +/* TODO: vhost-user-fs-pci */
> +return -0;
> +
>   case VIR_DOMAIN_FS_DRIVER_TYPE_LAST:
>   default:
>   virReportEnumRangeError(virDomainFSDriverType, fs->fsdriver);
> diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
> index ea5327d475..482373991c 100644
> --- a/src/qemu/qemu_domain_address.c
> +++ b/src/qemu/qemu_domain_address.c
> @@ -692,6 +692,9 @@ 
> qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
>   case VIR_DOMAIN_FS_MODEL_LAST:
>   break;
>   }
> +case VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIO_FS:
> +/* vhost-user-fs-pci */
> +return virtioFlags;
>   
>   case VIR_DOMAIN_FS_DRIVER_TYPE_LOOP:
>   case VIR_DOMAIN_FS_DRIVER_TYPE_NBD:
> diff --git a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml 
> b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
> index 284ee329b3..ecd5b33a28 100644
> --- a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
> +++ b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
> @@ -25,6 +25,12 @@
>   /usr/bin/qemu-system-x86_64
>   
>   
> +
> +  
> +  
> +  
> +   function='0x0'/>
> +
>   
>   
>   
> 


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

[libvirt] [PATCH] docs: Fix attribute names in filesystem/driver example

2019-11-01 Thread Jim Fehlig
Signed-off-by: Jim Fehlig 
---
 docs/formatdomain.html.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 7619c88514..84257c1bb4 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3847,7 +3847,7 @@
 readonly/
   /filesystem
   filesystem type='file' accessmode='passthrough'
-driver name='loop' type='raw'/
+driver type='loop' format='raw'/
 driver type='path' wrpolicy='immediate'/
 source file='/export/to/guest.img'/
 target dir='/import/from/host'/
-- 
2.23.0


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



[libvirt] s390: change default cpu model to host-model?

2019-11-01 Thread Christian Borntraeger
On the KVM forum I have discussed the default cpu model mode on s390.
Right now if the xml does not specify anything, libvirt defaults to 
not specifying anything on the qemu command line (no -cpu statement)
which is the equivalent of -cpu host for s390 which is equivalent to
host-passthrough. While this enables all features it does not provide
any migration safety by default.

So in fact we are kind of "broken" right now when it comes to safery.

So we discussed that it would make sense that an empty xml should actually
be defaulted to host-model, which results in - as of today - the same guest
features but in a migration safe way.

There is another change planned right now to actually make the cpu model
present in an xml if none was specified. So we could actually do this change
before, together  or after te other. Jiri and I think it probably makes most
sense to have both changes at the same time (in terms of libvirt version).

Does anyone see an issue with changing the default model mode to "host-model"
if the xml does not specify anything else?

Christian

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



[libvirt] [PATCH v3 5/6] rpc: Introduce virNetServerGetProgramLocked helper function

2019-11-01 Thread Marc Hartmayer
This patch introduces virNetServerGetProgramLocked. It's a function to
determine which program has to be used for a given @msg. This function
will be reused in the next patch.

Signed-off-by: Marc Hartmayer 
---
 src/rpc/virnetserver.c | 28 +---
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 54d0e4f31489..154747a1a097 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -171,6 +171,26 @@ static void virNetServerHandleJob(void *jobOpaque, void 
*opaque)
 VIR_FREE(job);
 }
 
+/**
+ * virNetServerGetProgramLocked:
+ * @srv: server (must be locked by the caller)
+ * @msg: message
+ *
+ * Searches @srv for the right program for a given message @msg.
+ *
+ * Returns a pointer to the server program or NULL if not found.
+ */
+static virNetServerProgramPtr
+virNetServerGetProgramLocked(virNetServerPtr srv,
+ virNetMessagePtr msg)
+{
+size_t i;
+for (i = 0; i < srv->nprograms; i++) {
+if (virNetServerProgramMatches(srv->programs[i], msg))
+return srv->programs[i];
+}
+return NULL;
+}
 
 static void
 virNetServerDispatchNewMessage(virNetServerClientPtr client,
@@ -180,18 +200,12 @@ virNetServerDispatchNewMessage(virNetServerClientPtr 
client,
 virNetServerPtr srv = opaque;
 virNetServerProgramPtr prog = NULL;
 unsigned int priority = 0;
-size_t i;
 
 VIR_DEBUG("server=%p client=%p message=%p",
   srv, client, msg);
 
 virObjectLock(srv);
-for (i = 0; i < srv->nprograms; i++) {
-if (virNetServerProgramMatches(srv->programs[i], msg)) {
-prog = srv->programs[i];
-break;
-}
-}
+prog = virNetServerGetProgramLocked(srv, msg);
 /* we can unlock @srv since @prog can only become invalid in case
  * of disposing @srv, but let's grab a ref first to ensure nothing
  * disposes of it before we use it. */
-- 
2.21.0

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



[libvirt] [PATCH v3 6/6] remote/rpc: Use virNetServerGetProgram() to determine the program

2019-11-01 Thread Marc Hartmayer
Use virNetServerGetProgram() to determine the virNetServerProgram
instead of using hard coded global variables. This allows us to remove
the global variables @remoteProgram and @qemuProgram as they're now no
longer necessary.

Signed-off-by: Marc Hartmayer 
---
 src/libvirt_remote.syms |   1 +
 src/remote/remote_daemon.c  |   4 +-
 src/remote/remote_daemon.h  |   2 -
 src/remote/remote_daemon_dispatch.c | 118 +---
 src/rpc/gendispatch.pl  |   6 ++
 src/rpc/virnetserver.c  |  22 ++
 src/rpc/virnetserver.h  |   2 +
 7 files changed, 122 insertions(+), 33 deletions(-)

diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
index 0493467f4603..a6883f373608 100644
--- a/src/libvirt_remote.syms
+++ b/src/libvirt_remote.syms
@@ -124,6 +124,7 @@ virNetServerGetCurrentUnauthClients;
 virNetServerGetMaxClients;
 virNetServerGetMaxUnauthClients;
 virNetServerGetName;
+virNetServerGetProgram;
 virNetServerGetThreadPoolParameters;
 virNetServerHasClients;
 virNetServerNeedsAuth;
diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c
index 7e63e180344d..c8ac224d52e9 100644
--- a/src/remote/remote_daemon.c
+++ b/src/remote/remote_daemon.c
@@ -73,8 +73,6 @@ VIR_LOG_INIT("daemon." DAEMON_NAME);
 #if WITH_SASL
 virNetSASLContextPtr saslCtxt = NULL;
 #endif
-virNetServerProgramPtr remoteProgram = NULL;
-virNetServerProgramPtr qemuProgram = NULL;
 
 volatile bool driversInitialized = false;
 
@@ -1007,6 +1005,8 @@ int main(int argc, char **argv) {
 virNetServerPtr srv = NULL;
 virNetServerPtr srvAdm = NULL;
 virNetServerProgramPtr adminProgram = NULL;
+virNetServerProgramPtr qemuProgram = NULL;
+virNetServerProgramPtr remoteProgram = NULL;
 virNetServerProgramPtr lxcProgram = NULL;
 char *remote_config_file = NULL;
 int statuswrite = -1;
diff --git a/src/remote/remote_daemon.h b/src/remote/remote_daemon.h
index a2d9af403619..a3d6a220f868 100644
--- a/src/remote/remote_daemon.h
+++ b/src/remote/remote_daemon.h
@@ -97,5 +97,3 @@ struct daemonClientPrivate {
 #if WITH_SASL
 extern virNetSASLContextPtr saslCtxt;
 #endif
-extern virNetServerProgramPtr remoteProgram;
-extern virNetServerProgramPtr qemuProgram;
diff --git a/src/remote/remote_daemon_dispatch.c 
b/src/remote/remote_daemon_dispatch.c
index 70f1f7d815e8..8756bd1a222d 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -4170,9 +4170,9 @@ remoteDispatchNodeDeviceGetParent(virNetServerPtr server 
G_GNUC_UNUSED,
 }
 
 static int
-remoteDispatchConnectRegisterCloseCallback(virNetServerPtr server 
G_GNUC_UNUSED,
+remoteDispatchConnectRegisterCloseCallback(virNetServerPtr server,
virNetServerClientPtr client,
-   virNetMessagePtr msg G_GNUC_UNUSED,
+   virNetMessagePtr msg,
virNetMessageErrorPtr rerr)
 {
 int rv = -1;
@@ -4180,6 +4180,12 @@ 
remoteDispatchConnectRegisterCloseCallback(virNetServerPtr server G_GNUC_UNUSED,
 struct daemonClientPrivate *priv =
 virNetServerClientGetPrivateData(client);
 virConnectPtr conn = remoteGetHypervisorConn(client);
+virNetServerProgramPtr program;
+
+if (!(program = virNetServerGetProgram(server, msg))) {
+virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no matching program 
found"));
+goto cleanup;
+}
 
 virMutexLock(>lock);
 
@@ -4190,7 +4196,7 @@ 
remoteDispatchConnectRegisterCloseCallback(virNetServerPtr server G_GNUC_UNUSED,
 goto cleanup;
 
 callback->client = virObjectRef(client);
-callback->program = virObjectRef(remoteProgram);
+callback->program = virObjectRef(program);
 /* eventID, callbackID, and legacy are not used */
 callback->eventID = -1;
 callback->callbackID = -1;
@@ -4242,9 +4248,9 @@ 
remoteDispatchConnectUnregisterCloseCallback(virNetServerPtr server G_GNUC_UNUSE
 }
 
 static int
-remoteDispatchConnectDomainEventRegister(virNetServerPtr server G_GNUC_UNUSED,
+remoteDispatchConnectDomainEventRegister(virNetServerPtr server,
  virNetServerClientPtr client,
- virNetMessagePtr msg G_GNUC_UNUSED,
+ virNetMessagePtr msg,
  virNetMessageErrorPtr rerr 
G_GNUC_UNUSED,
  
remote_connect_domain_event_register_ret *ret G_GNUC_UNUSED)
 {
@@ -4255,6 +4261,12 @@ remoteDispatchConnectDomainEventRegister(virNetServerPtr 
server G_GNUC_UNUSED,
 struct daemonClientPrivate *priv =
 virNetServerClientGetPrivateData(client);
 virConnectPtr conn = remoteGetHypervisorConn(client);
+virNetServerProgramPtr program;
+
+if (!(program = virNetServerGetProgram(server, msg))) {
+

[libvirt] [PATCH v3 3/6] remote: Save reference to program in daemonClientEventCallback

2019-11-01 Thread Marc Hartmayer
As a result, you can later determine during the callback which program
was used. This makes it easier to refactor the code in the future and
is less prone to error.

Signed-off-by: Marc Hartmayer 
---
 src/remote/remote_daemon_dispatch.c | 108 +++-
 1 file changed, 59 insertions(+), 49 deletions(-)

diff --git a/src/remote/remote_daemon_dispatch.c 
b/src/remote/remote_daemon_dispatch.c
index be20556128ae..e7f6d4c9f138 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -78,6 +78,7 @@ VIR_LOG_INIT("daemon.remote");
 
 struct daemonClientEventCallback {
 virNetServerClientPtr client;
+virNetServerProgramPtr program;
 int eventID;
 int callbackID;
 bool legacy;
@@ -149,6 +150,7 @@ remoteEventCallbackFree(void *opaque)
 daemonClientEventCallbackPtr callback = opaque;
 if (!callback)
 return;
+virObjectUnref(callback->program);
 virObjectUnref(callback->client);
 VIR_FREE(callback);
 }
@@ -334,7 +336,7 @@ remoteRelayDomainEventLifecycle(virConnectPtr conn,
 data.detail = detail;
 
 if (callback->legacy) {
-remoteDispatchObjectEventSend(callback->client, remoteProgram,
+remoteDispatchObjectEventSend(callback->client, callback->program,
   REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE,
   
(xdrproc_t)xdr_remote_domain_event_lifecycle_msg,
   );
@@ -342,7 +344,7 @@ remoteRelayDomainEventLifecycle(virConnectPtr conn,
 remote_domain_event_callback_lifecycle_msg msg = { 
callback->callbackID,
data };
 
-remoteDispatchObjectEventSend(callback->client, remoteProgram,
+remoteDispatchObjectEventSend(callback->client, callback->program,
   
REMOTE_PROC_DOMAIN_EVENT_CALLBACK_LIFECYCLE,
   
(xdrproc_t)xdr_remote_domain_event_callback_lifecycle_msg,
   );
@@ -371,14 +373,14 @@ remoteRelayDomainEventReboot(virConnectPtr conn,
 make_nonnull_domain(, dom);
 
 if (callback->legacy) {
-remoteDispatchObjectEventSend(callback->client, remoteProgram,
+remoteDispatchObjectEventSend(callback->client, callback->program,
   REMOTE_PROC_DOMAIN_EVENT_REBOOT,
   
(xdrproc_t)xdr_remote_domain_event_reboot_msg, );
 } else {
 remote_domain_event_callback_reboot_msg msg = { callback->callbackID,
 data };
 
-remoteDispatchObjectEventSend(callback->client, remoteProgram,
+remoteDispatchObjectEventSend(callback->client, callback->program,
   REMOTE_PROC_DOMAIN_EVENT_CALLBACK_REBOOT,
   
(xdrproc_t)xdr_remote_domain_event_callback_reboot_msg, );
 }
@@ -410,14 +412,14 @@ remoteRelayDomainEventRTCChange(virConnectPtr conn,
 data.offset = offset;
 
 if (callback->legacy) {
-remoteDispatchObjectEventSend(callback->client, remoteProgram,
+remoteDispatchObjectEventSend(callback->client, callback->program,
   REMOTE_PROC_DOMAIN_EVENT_RTC_CHANGE,
   
(xdrproc_t)xdr_remote_domain_event_rtc_change_msg, );
 } else {
 remote_domain_event_callback_rtc_change_msg msg = { 
callback->callbackID,
 data };
 
-remoteDispatchObjectEventSend(callback->client, remoteProgram,
+remoteDispatchObjectEventSend(callback->client, callback->program,
   
REMOTE_PROC_DOMAIN_EVENT_CALLBACK_RTC_CHANGE,
   
(xdrproc_t)xdr_remote_domain_event_callback_rtc_change_msg, );
 }
@@ -448,14 +450,14 @@ remoteRelayDomainEventWatchdog(virConnectPtr conn,
 data.action = action;
 
 if (callback->legacy) {
-remoteDispatchObjectEventSend(callback->client, remoteProgram,
+remoteDispatchObjectEventSend(callback->client, callback->program,
   REMOTE_PROC_DOMAIN_EVENT_WATCHDOG,
   
(xdrproc_t)xdr_remote_domain_event_watchdog_msg, );
 } else {
 remote_domain_event_callback_watchdog_msg msg = { callback->callbackID,
   data };
 
-remoteDispatchObjectEventSend(callback->client, remoteProgram,
+remoteDispatchObjectEventSend(callback->client, callback->program,
   
REMOTE_PROC_DOMAIN_EVENT_CALLBACK_WATCHDOG,
   
(xdrproc_t)xdr_remote_domain_event_callback_watchdog_msg, );
 }
@@ -491,14 +493,14 @@ 

[libvirt] [PATCH v3 1/6] rpc: use the return value of virObjectRef directly

2019-11-01 Thread Marc Hartmayer
Use the return value of virObjectRef directly. This way, it's easier
for another reader to identify the reason why the additional reference
is required.

Signed-off-by: Marc Hartmayer 
Reviewed-by: John Ferlan 
---
 src/rpc/virnetserver.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 042661ffa5ea..54d0e4f31489 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -204,7 +204,7 @@ virNetServerDispatchNewMessage(virNetServerClientPtr client,
 if (VIR_ALLOC(job) < 0)
 goto error;
 
-job->client = client;
+job->client = virObjectRef(client);
 job->msg = msg;
 
 if (prog) {
@@ -212,7 +212,6 @@ virNetServerDispatchNewMessage(virNetServerClientPtr client,
 priority = virNetServerProgramGetPriority(prog, msg->header.proc);
 }
 
-virObjectRef(client);
 if (virThreadPoolSendJob(srv->workers, priority, job) < 0) {
 virObjectUnref(client);
 VIR_FREE(job);
-- 
2.21.0

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



[libvirt] [PATCH v3 4/6] remote: Use domainClientEventCallbacks for remoteReplayConnectionClosedEvent

2019-11-01 Thread Marc Hartmayer
This allows us later to get rid of another usage of the global
variable `remoteProgram`.

Signed-off-by: Marc Hartmayer 
---
 src/remote/remote_daemon_dispatch.c | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/remote/remote_daemon_dispatch.c 
b/src/remote/remote_daemon_dispatch.c
index e7f6d4c9f138..70f1f7d815e8 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -1620,12 +1620,12 @@ remoteRelayDomainQemuMonitorEvent(virConnectPtr conn,
 static
 void remoteRelayConnectionClosedEvent(virConnectPtr conn G_GNUC_UNUSED, int 
reason, void *opaque)
 {
-virNetServerClientPtr client = opaque;
+daemonClientEventCallbackPtr callback = opaque;
 
 VIR_DEBUG("Relaying connection closed event, reason %d", reason);
 
 remote_connect_event_connection_closed_msg msg = { reason };
-remoteDispatchObjectEventSend(client, remoteProgram,
+remoteDispatchObjectEventSend(callback->client, callback->program,
   REMOTE_PROC_CONNECT_EVENT_CONNECTION_CLOSED,
   
(xdrproc_t)xdr_remote_connect_event_connection_closed_msg,
   );
@@ -4176,6 +4176,7 @@ 
remoteDispatchConnectRegisterCloseCallback(virNetServerPtr server G_GNUC_UNUSED,
virNetMessageErrorPtr rerr)
 {
 int rv = -1;
+daemonClientEventCallbackPtr callback = NULL;
 struct daemonClientPrivate *priv =
 virNetServerClientGetPrivateData(client);
 virConnectPtr conn = remoteGetHypervisorConn(client);
@@ -4185,9 +4186,17 @@ 
remoteDispatchConnectRegisterCloseCallback(virNetServerPtr server G_GNUC_UNUSED,
 if (!conn)
 goto cleanup;
 
+if (VIR_ALLOC(callback) < 0)
+goto cleanup;
+
+callback->client = virObjectRef(client);
+callback->program = virObjectRef(remoteProgram);
+/* eventID, callbackID, and legacy are not used */
+callback->eventID = -1;
+callback->callbackID = -1;
 if (virConnectRegisterCloseCallback(conn,
 remoteRelayConnectionClosedEvent,
-client, NULL) < 0)
+callback, remoteEventCallbackFree) < 0)
 goto cleanup;
 
 priv->closeRegistered = true;
@@ -4195,8 +4204,10 @@ 
remoteDispatchConnectRegisterCloseCallback(virNetServerPtr server G_GNUC_UNUSED,
 
  cleanup:
 virMutexUnlock(>lock);
-if (rv < 0)
+if (rv < 0) {
+remoteEventCallbackFree(callback);
 virNetMessageSaveError(rerr);
+}
 return rv;
 }
 
-- 
2.21.0

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



[libvirt] [PATCH v3 0/6] Fix virConnectRegisterCloseCallback and get rid of global variables

2019-11-01 Thread Marc Hartmayer
After discussions with Peter and Pavel at the KVM forum, I am now
sending a v3 of this series after more than a year... sorry for that
long delay!

The second patch of this patch series fixes the behavior of
virConnectRegisterCloseCallback.

The subsequent patches remove the need to have the global variables
'qemuProgram' and 'remoteProgram' in libvirtd.[ch]. They only work in
combination with the fixed behavior of
virConnectRegisterCloseCallback.

Changelog:
 + v2->v3:
   - Rebased to current master
   - Added Johns r-b to the first patch, all other r-b's I have
 dropped as there were to many changes in the meantime
   - Removed accepted patches
   - Dropped patches 8 and 9
 + v1->v2:
   - Removed accepted patches
   - Removed NACKed patches
   - Added r-b to patch 5
   - Worked in comments
   - Rebased
   - Added patches 7-9

Marc Hartmayer (6):
  rpc: use the return value of virObjectRef directly
  virConnectRegisterCloseCallback: Cleanup 'opaque' if there is no
connectRegisterCloseCallback
  remote: Save reference to program in daemonClientEventCallback
  remote: Use domainClientEventCallbacks for
remoteReplayConnectionClosedEvent
  rpc: Introduce virNetServerGetProgramLocked helper function
  remote/rpc: Use virNetServerGetProgram() to determine the program

 src/libvirt-host.c  |  12 +-
 src/libvirt_remote.syms |   1 +
 src/remote/remote_daemon.c  |   4 +-
 src/remote/remote_daemon.h  |   2 -
 src/remote/remote_daemon_dispatch.c | 227 +++-
 src/rpc/gendispatch.pl  |   6 +
 src/rpc/virnetserver.c  |  53 +--
 src/rpc/virnetserver.h  |   2 +
 8 files changed, 217 insertions(+), 90 deletions(-)

-- 
2.21.0

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



[libvirt] [PATCH v3 2/6] virConnectRegisterCloseCallback: Cleanup 'opaque' if there is no connectRegisterCloseCallback

2019-11-01 Thread Marc Hartmayer
The commit 'close callback: move it to driver' (88f09b75eb99) moved
the responsibility for the close callback to the driver. But if the
driver doesn't support the connectRegisterCloseCallback API this
function does nothing, even no unsupported error report. This behavior
may lead to problems, for example memory leaks, as the caller cannot
differentiate whether the close callback was 'really' registered or
not.

Therefore call directly @freecb if the connectRegisterCloseCallback
API is not supported by the driver used by the connection.

Signed-off-by: Marc Hartmayer 
---
 src/libvirt-host.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/libvirt-host.c b/src/libvirt-host.c
index 221a1b7a4353..9c3a19f33b12 100644
--- a/src/libvirt-host.c
+++ b/src/libvirt-host.c
@@ -1398,7 +1398,7 @@ virConnectIsAlive(virConnectPtr conn)
  * @conn: pointer to connection object
  * @cb: callback to invoke upon close
  * @opaque: user data to pass to @cb
- * @freecb: callback to free @opaque
+ * @freecb: callback to free @opaque when not used anymore
  *
  * Registers a callback to be invoked when the connection
  * is closed. This callback is invoked when there is any
@@ -1428,9 +1428,13 @@ virConnectRegisterCloseCallback(virConnectPtr conn,
 virCheckConnectReturn(conn, -1);
 virCheckNonNullArgGoto(cb, error);
 
-if (conn->driver->connectRegisterCloseCallback &&
-conn->driver->connectRegisterCloseCallback(conn, cb, opaque, freecb) < 
0)
-goto error;
+if (conn->driver->connectRegisterCloseCallback) {
+if (conn->driver->connectRegisterCloseCallback(conn, cb, opaque, 
freecb) < 0)
+goto error;
+} else {
+if (freecb)
+freecb(opaque);
+}
 
 return 0;
 
-- 
2.21.0

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



Re: [libvirt] Entering freeze for libvirt 5.9.0

2019-11-01 Thread Daniel Veillard
On Fri, Nov 01, 2019 at 10:02:24AM +0100, Andrea Bolognani wrote:
> On Thu, 2019-10-31 at 17:55 +0100, Daniel Veillard wrote:
> > On Thu, Oct 31, 2019 at 04:02:12PM +0100, Andrea Bolognani wrote:
> > > May I suggest we give it a few extra days? Like, instead of releasing
> > > this weekend, wait until next Wednesday or something like that? That
> > > would give me time to at least take care of the release notes, and I
> > > don't think the delay will affect our users negatively.
> > 
> > Ok, I think I will wait till Tuesday morning (my time same as Lyon :-)
> 
> Sounds good! I'll to get the release notes done on Monday :)

  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



[libvirt] [PATCH 4/9] wip: tests: add xml2xml tests for virtio-fs

2019-11-01 Thread Ján Tomko
[to be squashed in with the actual XML addition]
---
 .../vhost-user-fs-fd-memory.xml   | 32 +
 .../vhost-user-fs-hugepages.xml   | 67 +++
 .../vhost-user-fs-fd-memory.x86_64-latest.xml |  1 +
 .../vhost-user-fs-hugepages.x86_64-latest.xml |  1 +
 tests/qemuxml2xmltest.c   |  3 +
 5 files changed, 104 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
 create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml
 create mode 12 
tests/qemuxml2xmloutdata/vhost-user-fs-fd-memory.x86_64-latest.xml
 create mode 12 
tests/qemuxml2xmloutdata/vhost-user-fs-hugepages.x86_64-latest.xml

diff --git a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml 
b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
new file mode 100644
index 00..284ee329b3
--- /dev/null
+++ b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
@@ -0,0 +1,32 @@
+
+  guest
+  126f2720-6f8e-45ab-a886-ec9277079a67
+  14680064
+  14680064
+  
+
+
+  
+  2
+  
+hvm
+
+  
+  
+
+  
+
+  
+  
+  destroy
+  restart
+  destroy
+  
+/usr/bin/qemu-system-x86_64
+
+
+
+
+
+  
+
diff --git a/tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml 
b/tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml
new file mode 100644
index 00..0633394028
--- /dev/null
+++ b/tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml
@@ -0,0 +1,67 @@
+
+  guest
+  1ccfd97d-5eb4-478a-bbe6-88d254c16db7
+  4194304
+  4194304
+  
+
+  
+
+
+  
+  2
+  
+hvm
+
+  
+  
+
+
+  
+  
+
+  
+
+  
+  
+  destroy
+  restart
+  destroy
+  
+/usr/bin/qemu-system-x86_64
+
+  
+  
+  
+  
+
+
+
+  
+
+
+
+  
+  
+  
+
+
+  
+  
+  
+
+
+  
+  
+  
+
+
+  
+  
+  
+
+
+
+
+  
+
diff --git a/tests/qemuxml2xmloutdata/vhost-user-fs-fd-memory.x86_64-latest.xml 
b/tests/qemuxml2xmloutdata/vhost-user-fs-fd-memory.x86_64-latest.xml
new file mode 12
index 00..fbc552ef94
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/vhost-user-fs-fd-memory.x86_64-latest.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/vhost-user-fs-fd-memory.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmloutdata/vhost-user-fs-hugepages.x86_64-latest.xml 
b/tests/qemuxml2xmloutdata/vhost-user-fs-hugepages.x86_64-latest.xml
new file mode 12
index 00..0c0f05b254
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/vhost-user-fs-hugepages.x86_64-latest.xml
@@ -0,0 +1 @@
+../qemuxml2argvdata/vhost-user-fs-hugepages.xml
\ No newline at end of file
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 89c9494e6c..fa999e0094 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1315,6 +1315,9 @@ mymain(void)
 DO_TEST("vhost-vsock-ccw-auto", QEMU_CAPS_DEVICE_VHOST_VSOCK,
 QEMU_CAPS_CCW);
 
+DO_TEST_CAPS_LATEST("vhost-user-fs-fd-memory");
+DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages");
+
 DO_TEST("riscv64-virt",
 QEMU_CAPS_DEVICE_VIRTIO_MMIO);
 DO_TEST("riscv64-virt-pci",
-- 
2.21.0

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



[libvirt] [PATCH 8/9] wip: start virtiofsd

2019-11-01 Thread Ján Tomko
Start virtiofsd for each  device using it.

Pre-create the socket for communication with QEMU and pass it
to virtiofsd.

Note that virtiofsd needs to run as root.
---
 src/conf/domain_conf.h|   1 +
 src/qemu/qemu_extdevice.c | 191 ++
 tests/qemuxml2argvtest.c  |   6 ++
 3 files changed, 198 insertions(+)

diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 54a7e7c52f..78f88a0c2f 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -817,6 +817,7 @@ struct _virDomainFSDef {
 unsigned long long space_soft_limit; /* in bytes */
 bool symlinksResolved;
 virDomainVirtioOptionsPtr virtio;
+char *vhost_user_fs_path; /* TODO put this in private data */
 };
 
 
diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c
index 463f76c21a..cb44ca325f 100644
--- a/src/qemu/qemu_extdevice.c
+++ b/src/qemu/qemu_extdevice.c
@@ -20,6 +20,7 @@
 
 #include 
 
+#include "qemu_command.h"
 #include "qemu_extdevice.h"
 #include "qemu_vhost_user_gpu.h"
 #include "qemu_domain.h"
@@ -149,6 +150,178 @@ qemuExtDevicesCleanupHost(virQEMUDriverPtr driver,
 qemuExtTPMCleanupHost(def);
 }
 
+static char *
+qemuExtVirtioFSCreatePidFilename(virQEMUDriverConfigPtr cfg,
+ const virDomainDef *def,
+ const char *alias)
+{
+g_autofree char *shortName = NULL;
+g_autofree char *name = NULL;
+
+if (!(shortName = virDomainDefGetShortName(def)) ||
+virAsprintf(, "%s-%s-virtiofsd", shortName, alias) < 0)
+return NULL;
+
+return virPidFileBuildPath(cfg->stateDir, name);
+}
+
+
+static char *
+qemuExtVirtioFSCreateSocketFilename(virQEMUDriverConfigPtr cfg,
+const virDomainDef *def,
+const char *alias)
+{
+g_autofree char *shortName = NULL;
+g_autofree char *name = NULL;
+
+if (!(shortName = virDomainDefGetShortName(def)) ||
+virAsprintf(, "%s-%s-virtiofsd", shortName, alias) < 0)
+return NULL;
+
+return virFileBuildPath(cfg->stateDir, name, ".sock");
+}
+
+
+static int
+qemuExtVirtioFSdStart(virQEMUDriverPtr driver,
+  virDomainObjPtr vm,
+  virDomainFSDefPtr fs)
+{
+g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
+g_autoptr(virCommand) cmd = NULL;
+g_autofree char *pidfile = NULL;
+char errbuf[1024] = { 0 };
+virDomainChrSourceDefPtr chrdev = virDomainChrSourceDefNew(NULL);
+pid_t pid = (pid_t) -1;
+VIR_AUTOCLOSE errfd = -1;
+VIR_AUTOCLOSE fd = -1;
+int exitstatus = 0;
+int cmdret = 0;
+int ret = -1;
+int rc;
+
+chrdev->type = VIR_DOMAIN_CHR_TYPE_UNIX;
+chrdev->data.nix.listen = true;
+
+if (!(pidfile = qemuExtVirtioFSCreatePidFilename(cfg, vm->def, 
fs->info.alias)))
+goto cleanup;
+
+if (!(chrdev->data.nix.path = qemuExtVirtioFSCreateSocketFilename(cfg, 
vm->def, fs->info.alias)))
+goto cleanup;
+
+if (qemuSecuritySetDaemonSocketLabel(driver->securityManager, vm->def) < 0)
+goto cleanup;
+fd = qemuOpenChrChardevUNIXSocket(chrdev);
+if (fd < 0)
+goto cleanup;
+if (qemuSecurityClearSocketLabel(driver->securityManager, vm->def) < 0)
+goto cleanup;
+
+/* TODO: do not call this here */
+virDomainChrDef chr = { .source = chrdev };
+if (qemuSecuritySetChardevLabel(driver, vm, ) < 0)
+goto cleanup;
+
+/* TODO: configure path */
+if (!(cmd = virCommandNew("/usr/libexec/virtiofsd")))
+goto cleanup;
+
+virCommandSetPidFile(cmd, pidfile);
+virCommandSetErrorFD(cmd, );
+virCommandDaemonize(cmd);
+
+virCommandAddArg(cmd, "--syslog");
+virCommandAddArgFormat(cmd, "--fd=%d", fd);
+virCommandPassFD(cmd, fd, VIR_COMMAND_PASS_FD_CLOSE_PARENT);
+fd = -1;
+
+virCommandAddArg(cmd, "-o");
+/* TODO: validate path? */
+virCommandAddArgFormat(cmd, "source=%s", fs->src->path);
+virCommandAddArg(cmd, "-d");
+
+if (qemuExtDeviceLogCommand(driver, vm, cmd, "virtiofsd") < 0)
+goto cleanup;
+
+cmdret = virCommandRun(cmd, );
+
+if (cmdret < 0 || exitstatus != 0) {
+virReportError(VIR_ERR_INTERNAL_ERROR,
+   _("Could not start 'virtiofsd'. exitstatus: %d"), 
exitstatus);
+goto error;
+}
+
+rc = virPidFileReadPath(pidfile, );
+if (rc < 0) {
+virReportSystemError(-rc,
+ _("Unable to read virtiofsd pidfile '%s'"),
+ pidfile);
+goto error;
+}
+
+if (virProcessKill(pid, 0) != 0) {
+if (saferead(errfd, errbuf, sizeof(errbuf) - 1) < 0) {
+virReportSystemError(errno, "%s",
+ _("virtiofsd died unexpectedly"));
+} else {
+virReportError(VIR_ERR_OPERATION_FAILED,
+   _("virtiofsd died and reported: 

[libvirt] [PATCH 6/9] conf: qemu: add virtio-fs fsdriver type

2019-11-01 Thread Ján Tomko
Introduce a new 'virtio-fs' driver type for filesystem.


  
  
  
  


Signed-off-by: Ján Tomko 
---
 docs/schemas/domaincommon.rng  | 1 +
 src/conf/domain_conf.c | 1 +
 src/conf/domain_conf.h | 1 +
 src/qemu/qemu_command.c| 3 +++
 src/qemu/qemu_domain.c | 4 
 src/qemu/qemu_domain_address.c | 3 +++
 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml | 6 ++
 7 files changed, 19 insertions(+)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index e06f892da3..f6479c95a7 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2567,6 +2567,7 @@
 loop
 nbd
 ploop
+virtio-fs
   
 
   
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d5aba7336f..2694e4bb68 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -476,6 +476,7 @@ VIR_ENUM_IMPL(virDomainFSDriver,
   "loop",
   "nbd",
   "ploop",
+  "virtio-fs",
 );
 
 VIR_ENUM_IMPL(virDomainFSAccessMode,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index c69d1b7ef5..54a7e7c52f 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -770,6 +770,7 @@ typedef enum {
 VIR_DOMAIN_FS_DRIVER_TYPE_LOOP,
 VIR_DOMAIN_FS_DRIVER_TYPE_NBD,
 VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP,
+VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIO_FS,
 
 VIR_DOMAIN_FS_DRIVER_TYPE_LAST
 } virDomainFSDriverType;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index cbe601099f..985fcdd215 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2697,6 +2697,9 @@ qemuBuildFilesystemCommandLine(virCommandPtr cmd,
 if (qemuBuildFSDevCommandLine(cmd, def->fss[i], def, qemuCaps) < 0)
 return -1;
 break;
+case VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIO_FS:
+/* TODO: vhost-user-fs-pci */
+return 0;
 case VIR_DOMAIN_FS_DRIVER_TYPE_LOOP:
 case VIR_DOMAIN_FS_DRIVER_TYPE_NBD:
 case VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP:
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 667cc89072..334039005c 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -7110,6 +7110,10 @@ qemuDomainDeviceDefValidateFS(virDomainFSDefPtr fs,
_("Filesystem driver type not supported"));
 return -1;
 
+case VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIO_FS:
+/* TODO: vhost-user-fs-pci */
+return -0;
+
 case VIR_DOMAIN_FS_DRIVER_TYPE_LAST:
 default:
 virReportEnumRangeError(virDomainFSDriverType, fs->fsdriver);
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index ea5327d475..482373991c 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -692,6 +692,9 @@ 
qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
 case VIR_DOMAIN_FS_MODEL_LAST:
 break;
 }
+case VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIO_FS:
+/* vhost-user-fs-pci */
+return virtioFlags;
 
 case VIR_DOMAIN_FS_DRIVER_TYPE_LOOP:
 case VIR_DOMAIN_FS_DRIVER_TYPE_NBD:
diff --git a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml 
b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
index 284ee329b3..ecd5b33a28 100644
--- a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
+++ b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
@@ -25,6 +25,12 @@
 /usr/bin/qemu-system-x86_64
 
 
+
+  
+  
+  
+  
+
 
 
 
-- 
2.21.0

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

[libvirt] [PATCH 3/9] qemu: add QEMU_CAPS_VHOST_USER_FS

2019-11-01 Thread Ján Tomko
Introduced by QEMU commit TBD
---
 src/qemu/qemu_capabilities.c | 4 
 src/qemu/qemu_capabilities.h | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 9bb3c96448..29ee0d089f 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -547,6 +547,9 @@ VIR_ENUM_IMPL(virQEMUCaps,
   "query-cpu-model-comparison",
   "ramfb",
   "machine.pseries.cap-ccf-assist",
+
+  /* 345 */
+  "vhost-user-fs",
 );
 
 
@@ -1141,6 +1144,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
 { "vhost-user-gpu", QEMU_CAPS_DEVICE_VHOST_USER_GPU },
 { "vhost-user-vga", QEMU_CAPS_DEVICE_VHOST_USER_VGA },
 { "ramfb", QEMU_CAPS_DEVICE_RAMFB },
+{ "vhost-user-fs-device", QEMU_CAPS_DEVICE_VHOST_USER_FS },
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 10f0ce2654..33ac7e60b6 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -529,6 +529,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for 
syntax-check */
 QEMU_CAPS_DEVICE_RAMFB, /* -device ramfb */
 QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, /* -machine 
pseries.cap-ccf-assist */
 
+/* 345 */
+QEMU_CAPS_DEVICE_VHOST_USER_FS, /* -device vhost-user-fs */
+
 QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
 
-- 
2.21.0

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



[libvirt] [RFC PATCH 0/9] add virtiofs support (virtio-fs epopee)

2019-11-01 Thread Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1694166

A work in progress, but I'm sending it now to get the XML
bikesh^Wdiscussion out of the way.

TODO:
  * documentation
(due to the requirement of shared memory and therefore
 a  topology specification, this probably deserves
 a separate article on https://libvirt.org/kbase.html )
  * validation - refuse unsupported combinations and block
migration
  * remove a few hardcoded values
* figure out the binary path from qemu interop config
* leave queue-size and cache-size on their default values
  or expose them in XML
  * use FD passing for vhost-user-fs device as well
  * clean up the code

Tested with:
  commit 32e72ec0613e164ce9608d865396fb2da278
  Author: Linus Torvalds 
  Date:   Wed Oct 30 14:17:18 2019 +0100

Merge tag 'iommu-fixes-v5.4-rc5' of 
git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

  and

  commit d3d2efbb0e37494708dde359a9d0f492f84833e8
  Author: Dr. David Alan Gilbert 
  CommitDate: 2019-10-24 11:50:55 +0100

virtio-fs: Allow mapping of meta data version table

  from https://gitlab.com/virtio-fs/qemu/tree/virtio-fs-dev

  git fetch https://gitlab.com/virtio-fs/qemu.git virtio-fs-dev
  (not yet merged upstream)

Ján Tomko (9):
  qemu: address: take fsdriver type into account
  qemu: cmdline: take fsdriver into account
  qemu: add QEMU_CAPS_VHOST_USER_FS
  wip: tests: add xml2xml tests for virtio-fs
  wip: add XML -> ARGV tests for virtio-fs
  conf: qemu: add virtio-fs fsdriver type
  qemu: pass private data to qemuBuildFilesystemCommandLine
  wip: start virtiofsd
  wip: build vhost-user-fs device command line

 docs/schemas/domaincommon.rng |   1 +
 src/conf/domain_conf.c|   1 +
 src/conf/domain_conf.h|   2 +
 src/qemu/qemu_capabilities.c  |   4 +
 src/qemu/qemu_capabilities.h  |   3 +
 src/qemu/qemu_command.c   |  67 +-
 src/qemu/qemu_domain.c|   4 +
 src/qemu/qemu_domain_address.c|  35 +++-
 src/qemu/qemu_extdevice.c | 191 ++
 ...vhost-user-fs-fd-memory.x86_64-latest.args |  38 
 .../vhost-user-fs-fd-memory.xml   |  38 
 ...vhost-user-fs-hugepages.x86_64-latest.args |  42 
 .../vhost-user-fs-hugepages.xml   |  67 ++
 tests/qemuxml2argvtest.c  |   9 +
 .../vhost-user-fs-fd-memory.x86_64-latest.xml |   1 +
 .../vhost-user-fs-hugepages.x86_64-latest.xml |   1 +
 tests/qemuxml2xmltest.c   |   3 +
 17 files changed, 493 insertions(+), 14 deletions(-)
 create mode 100644 
tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
 create mode 100644 
tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml
 create mode 12 
tests/qemuxml2xmloutdata/vhost-user-fs-fd-memory.x86_64-latest.xml
 create mode 12 
tests/qemuxml2xmloutdata/vhost-user-fs-hugepages.x86_64-latest.xml

-- 
2.21.0

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

[libvirt] [PATCH 2/9] qemu: cmdline: take fsdriver into account

2019-11-01 Thread Ján Tomko
Signed-off-by: Ján Tomko 
---
 src/qemu/qemu_command.c | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index be9839cc64..cbe601099f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2689,8 +2689,20 @@ qemuBuildFilesystemCommandLine(virCommandPtr cmd,
 size_t i;
 
 for (i = 0; i < def->nfss; i++) {
-if (qemuBuildFSDevCommandLine(cmd, def->fss[i], def, qemuCaps) < 0)
-return -1;
+switch ((virDomainFSDriverType) def->fss[i]->fsdriver) {
+case VIR_DOMAIN_FS_DRIVER_TYPE_DEFAULT:
+case VIR_DOMAIN_FS_DRIVER_TYPE_PATH:
+case VIR_DOMAIN_FS_DRIVER_TYPE_HANDLE:
+/* these drivers are handled by virtio-9p-pci */
+if (qemuBuildFSDevCommandLine(cmd, def->fss[i], def, qemuCaps) < 0)
+return -1;
+break;
+case VIR_DOMAIN_FS_DRIVER_TYPE_LOOP:
+case VIR_DOMAIN_FS_DRIVER_TYPE_NBD:
+case VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP:
+case VIR_DOMAIN_FS_DRIVER_TYPE_LAST:
+break;
+}
 }
 
 return 0;
-- 
2.21.0

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

[libvirt] [PATCH 9/9] wip: build vhost-user-fs device command line

2019-11-01 Thread Ján Tomko
Format the 'vhost-user-fs' device on the QEMU command line.
---
 src/qemu/qemu_command.c   | 49 +--
 ...vhost-user-fs-fd-memory.x86_64-latest.args |  3 ++
 2 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d953e3626a..a3008e47ee 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2593,6 +2593,46 @@ qemuBuildDisksCommandLine(virCommandPtr cmd,
 }
 
 
+static int
+qemuBuildVHostUserFsCommandLine(virCommandPtr cmd,
+virDomainFSDef *fs,
+const virDomainDef *def G_GNUC_UNUSED,
+qemuDomainObjPrivatePtr priv)
+{
+/* TODO: reject non-passthrough accessmode */
+g_autofree char *chardev_alias = NULL;
+g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
+const char *tag = fs->dst;
+
+chardev_alias = g_strdup_printf("chr-vu-%s", fs->info.alias);
+
+virCommandAddArg(cmd, "-chardev");
+virBufferAddLit(, "socket");
+virBufferAsprintf(, ",id=%s", chardev_alias);
+virBufferEscapeString(, ",path=%s", fs->vhost_user_fs_path);
+virCommandAddArg(cmd, virBufferContentAndReset());
+
+virCommandAddArg(cmd, "-device");
+
+if (qemuBuildVirtioDevStr(, "vhost-user-fs", priv->qemuCaps,
+  VIR_DOMAIN_DEVICE_FS, fs) < 0)
+return -1;
+
+virBufferAsprintf(, ",chardev=%s", chardev_alias);
+/* TODO: do not hardcode this */
+virBufferAsprintf(, ",queue-size=%u", 1024);
+virBufferEscapeString(, ",tag=%s,cache-size=2G", tag);
+if (qemuBuildVirtioOptionsStr(, fs->virtio, priv->qemuCaps) < 0)
+return -1;
+
+if (qemuBuildDeviceAddressStr(, def, >info, priv->qemuCaps) < 0)
+return -1;
+
+virCommandAddArg(cmd, virBufferContentAndReset());
+return 0;
+}
+
+
 static char *
 qemuBuildFSStr(virDomainFSDefPtr fs)
 {
@@ -2685,7 +2725,7 @@ static int
 qemuBuildFilesystemCommandLine(virCommandPtr cmd,
const virDomainDef *def,
virQEMUCapsPtr qemuCaps,
-   qemuDomainObjPrivatePtr priv G_GNUC_UNUSED)
+   qemuDomainObjPrivatePtr priv)
 {
 size_t i;
 
@@ -2699,8 +2739,11 @@ qemuBuildFilesystemCommandLine(virCommandPtr cmd,
 return -1;
 break;
 case VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIO_FS:
-/* TODO: vhost-user-fs-pci */
-return 0;
+/* vhost-user-fs-pci */
+if (qemuBuildVHostUserFsCommandLine(cmd, def->fss[i], def, priv) < 
0)
+return -1;
+break;
+
 case VIR_DOMAIN_FS_DRIVER_TYPE_LOOP:
 case VIR_DOMAIN_FS_DRIVER_TYPE_NBD:
 case VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP:
diff --git a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args 
b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
index 39c7dbf6d8..a63d6b6dcc 100644
--- a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
@@ -30,6 +30,9 @@ size=15032385536 \
 -no-shutdown \
 -no-acpi \
 -boot strict=on \
+-chardev socket,id=chr-vu-fs0,path=/tmp/lib/domain--1-guest/fs0.vhost-fs.sock \
+-device vhost-user-fs-pci,chardev=chr-vu-fs0,queue-size=1024,tag=/path,\
+cache-size=2G,bus=pci.0,addr=0x2 \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
 resourcecontrol=deny \
 -msg timestamp=on
-- 
2.21.0

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



[libvirt] [PATCH 5/9] wip: add XML -> ARGV tests for virtio-fs

2019-11-01 Thread Ján Tomko
To be squashed in with the actual command line addition.
---
 ...vhost-user-fs-fd-memory.x86_64-latest.args | 35 
 ...vhost-user-fs-hugepages.x86_64-latest.args | 42 +++
 tests/qemuxml2argvtest.c  |  3 ++
 3 files changed, 80 insertions(+)
 create mode 100644 
tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
 create mode 100644 
tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args 
b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
new file mode 100644
index 00..39c7dbf6d8
--- /dev/null
+++ b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-guest/master-key.aes \
+-machine pc,accel=kvm,usb=off,dump-guest-core=off \
+-m 14336 \
+-overcommit mem-lock=off \
+-smp 2,sockets=2,cores=1,threads=1 \
+-object memory-backend-file,id=ram-node0,\
+mem-path=/var/lib/libvirt/qemu/ram/libvirt/qemu/-1-guest/ram-node0,share=yes,\
+size=15032385536 \
+-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
+-uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args 
b/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args
new file mode 100644
index 00..aa6a60d70d
--- /dev/null
+++ b/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args
@@ -0,0 +1,42 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-guest/master-key.aes \
+-machine q35,accel=tcg,usb=off,dump-guest-core=off \
+-m 2048 \
+-overcommit mem-lock=off \
+-smp 2,sockets=2,cores=1,threads=1 \
+-object memory-backend-file,id=ram-node0,prealloc=yes,\
+mem-path=/dev/hugepages2M/libvirt/qemu/-1-guest,share=yes,size=2147483648 \
+-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-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-root-port,port=0xa,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 \
+-device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 \
+-drive file=/var/lib/libvirt/images/guest.qcow2,format=qcow2,if=none,\
+id=drive-virtio-disk0 \
+-device virtio-blk-pci,scsi=off,bus=pci.4,addr=0x0,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/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index fd330df3e0..24df0a48e7 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2982,6 +2982,9 @@ mymain(void)
 
 DO_TEST_CAPS_VER("launch-security-sev", "2.12.0");
 
+DO_TEST_CAPS_LATEST("vhost-user-fs-fd-memory");
+DO_TEST_CAPS_LATEST("vhost-user-fs-hugepages");
+
 DO_TEST("riscv64-virt",
 QEMU_CAPS_DEVICE_VIRTIO_MMIO);
 DO_TEST("riscv64-virt-pci",
-- 
2.21.0

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



[libvirt] [PATCH 1/9] qemu: address: take fsdriver type into account

2019-11-01 Thread Ján Tomko
---
 src/qemu/qemu_domain_address.c | 34 +++---
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 82db62e988..ea5327d475 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -676,18 +676,30 @@ 
qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
 break;
 
 case VIR_DOMAIN_DEVICE_FS:
-/* the only type of filesystem so far is virtio-9p-pci */
-switch ((virDomainFSModel) dev->data.fs->model) {
-case VIR_DOMAIN_FS_MODEL_VIRTIO_TRANSITIONAL:
-/* Transitional devices only work in conventional PCI slots */
-return pciFlags;
-case VIR_DOMAIN_FS_MODEL_VIRTIO:
-case VIR_DOMAIN_FS_MODEL_VIRTIO_NON_TRANSITIONAL:
-case VIR_DOMAIN_FS_MODEL_DEFAULT:
-return virtioFlags;
-case VIR_DOMAIN_FS_MODEL_LAST:
-break;
+switch ((virDomainFSDriverType) dev->data.fs->fsdriver) {
+case VIR_DOMAIN_FS_DRIVER_TYPE_DEFAULT:
+case VIR_DOMAIN_FS_DRIVER_TYPE_PATH:
+case VIR_DOMAIN_FS_DRIVER_TYPE_HANDLE:
+/* these drivers are handled by virtio-9p-pci */
+switch ((virDomainFSModel) dev->data.fs->model) {
+case VIR_DOMAIN_FS_MODEL_VIRTIO_TRANSITIONAL:
+/* Transitional devices only work in conventional PCI slots */
+return pciFlags;
+case VIR_DOMAIN_FS_MODEL_VIRTIO:
+case VIR_DOMAIN_FS_MODEL_VIRTIO_NON_TRANSITIONAL:
+case VIR_DOMAIN_FS_MODEL_DEFAULT:
+return virtioFlags;
+case VIR_DOMAIN_FS_MODEL_LAST:
+break;
+}
+
+case VIR_DOMAIN_FS_DRIVER_TYPE_LOOP:
+case VIR_DOMAIN_FS_DRIVER_TYPE_NBD:
+case VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP:
+case VIR_DOMAIN_FS_DRIVER_TYPE_LAST:
+return 0;
 }
+
 return 0;
 
 case VIR_DOMAIN_DEVICE_NET: {
-- 
2.21.0

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



[libvirt] [PATCH 7/9] qemu: pass private data to qemuBuildFilesystemCommandLine

2019-11-01 Thread Ján Tomko
This will be used by a future patch.

Signed-off-by: Ján Tomko 
---
 src/qemu/qemu_command.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 985fcdd215..d953e3626a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2684,7 +2684,8 @@ qemuBuildFSDevCommandLine(virCommandPtr cmd,
 static int
 qemuBuildFilesystemCommandLine(virCommandPtr cmd,
const virDomainDef *def,
-   virQEMUCapsPtr qemuCaps)
+   virQEMUCapsPtr qemuCaps,
+   qemuDomainObjPrivatePtr priv G_GNUC_UNUSED)
 {
 size_t i;
 
@@ -10309,7 +10310,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
 if (qemuBuildDisksCommandLine(cmd, def, qemuCaps) < 0)
 return NULL;
 
-if (qemuBuildFilesystemCommandLine(cmd, def, qemuCaps) < 0)
+if (qemuBuildFilesystemCommandLine(cmd, def, qemuCaps, priv) < 0)
 return NULL;
 
 if (qemuBuildNetCommandLine(driver, vm, logManager, secManager, cmd,
-- 
2.21.0

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

Re: [libvirt] [PULL 1/9] IDE: deprecate ide-drive

2019-11-01 Thread Peter Krempa
On Thu, Oct 31, 2019 at 23:02:45 +0100, Paolo Bonzini wrote:
> On 31/10/19 11:58, John Snow wrote:
> > It's an old compatibility shim that just delegates to ide-cd or ide-hd.
> > I'd like to refactor these some day, and getting rid of the super-object
> > will make that easier.
> > 
> > Either way, we don't need this.
> 
> Good idea.  I will prepare a similar patch for scsi-disk, even though
> technically we're already in soft freeze; it makes no sense to deprecate
> only one of the two.

I checked in libvirt and you are welcome to do so since we no longer use
it similarly to ide-disk.



signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Entering freeze for libvirt 5.9.0

2019-11-01 Thread Andrea Bolognani
On Thu, 2019-10-31 at 17:55 +0100, Daniel Veillard wrote:
> On Thu, Oct 31, 2019 at 04:02:12PM +0100, Andrea Bolognani wrote:
> > May I suggest we give it a few extra days? Like, instead of releasing
> > this weekend, wait until next Wednesday or something like that? That
> > would give me time to at least take care of the release notes, and I
> > don't think the delay will affect our users negatively.
> 
> Ok, I think I will wait till Tuesday morning (my time same as Lyon :-)

Sounds good! I'll to get the release notes done on Monday :)

-- 
Andrea Bolognani / Red Hat / Virtualization

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



Re: [libvirt] [PULL 1/9] IDE: deprecate ide-drive

2019-11-01 Thread Paolo Bonzini
On 01/11/19 06:40, Markus Armbruster wrote:
> Paolo Bonzini  writes:
> 
>> On 31/10/19 11:58, John Snow wrote:
>>> It's an old compatibility shim that just delegates to ide-cd or ide-hd.
>>> I'd like to refactor these some day, and getting rid of the super-object
>>> will make that easier.
>>>
>>> Either way, we don't need this.
>>
>> Good idea.  I will prepare a similar patch for scsi-disk, even though
>> technically we're already in soft freeze; it makes no sense to deprecate
>> only one of the two.
> 
> We still use scsi-disk for -drive if=scsi,... and for the desugaring of
> the usb-storage device, via scsi_bus_legacy_add_drive().  I figure you'd
> need to either wean them off scsi-disk or deprecate them, too.

Yes, it's enough to add a bool media_cdrom argument to
scsi_bus_legacy_add_drive.

Paolo

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